Commit 12277ca52272719dc98da9c65ee6837e79f526c5
1 parent
3a31bb7b
Committing updated files
Showing
2 changed files
with
40 additions
and
39 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -353,56 +353,56 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
353 | 353 | var split = url.split('?em:'); |
354 | 354 | userInfo.emailId = split[1]; |
355 | 355 | } |
356 | - | |
357 | 356 | if (userInfo.newPassword != null) { |
358 | 357 | |
359 | 358 | if (userInfo.newPassword === userInfo.confirmPassword) { |
360 | 359 | $rootScope.passwordMismatchMessage = null; |
361 | 360 | |
362 | - AuthenticationService.ResetUserPassword(userInfo) | |
363 | - .then( | |
364 | - function (result) { | |
365 | - if (result == LoginConstants.USER_NOT_FOUND) { | |
366 | - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); | |
367 | - $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; | |
368 | - $("#messageModal").modal('show'); | |
369 | - | |
370 | - } | |
371 | - else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { | |
372 | - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | |
373 | - $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS; | |
374 | - $("#messageModal").modal('show'); | |
361 | + AuthenticationService.ResetUserPassword(userInfo) | |
362 | + .then( | |
363 | + function (result) { | |
364 | + if (result == LoginConstants.USER_NOT_FOUND) { | |
365 | + // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); | |
366 | + $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; | |
367 | + $("#messageModal").modal('show'); | |
375 | 368 | |
376 | - } | |
377 | - else { | |
378 | - //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { | |
379 | - if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) { | |
380 | - // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); | |
381 | - $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; | |
369 | + } | |
370 | + else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { | |
371 | + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | |
372 | + $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS; | |
382 | 373 | $("#messageModal").modal('show'); |
383 | - $rootScope.isVisibleLogin = true; | |
384 | - $rootScope.isVisibleResetPass = false; | |
385 | - $location.url("/"); | |
374 | + | |
386 | 375 | } |
387 | - } | |
388 | - }, | |
389 | - function (error) { | |
390 | - console.log(' Error in authentication = ' + error.statusText); | |
391 | - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | |
392 | - $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; | |
393 | - $("#messageModal").modal('show'); | |
376 | + else { | |
377 | + //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { | |
378 | + if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) { | |
379 | + // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); | |
380 | + $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; | |
381 | + $("#messageModal").modal('show'); | |
382 | + $rootScope.isVisibleLogin = true; | |
383 | + $rootScope.isVisibleResetPass = false; | |
384 | + $location.url("/"); | |
385 | + } | |
386 | + } | |
387 | + }, | |
388 | + function (error) { | |
389 | + console.log(' Error in authentication = ' + error.statusText); | |
390 | + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | |
391 | + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; | |
392 | + $("#messageModal").modal('show'); | |
394 | 393 | |
395 | - }); | |
396 | - } | |
397 | - else { | |
398 | - $rootScope.passwordMismatchMassage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH; | |
399 | - //$("#messageModal").modal('show'); | |
394 | + }); | |
395 | + } | |
396 | + else { | |
397 | + $rootScope.errorMessage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH; | |
398 | + $("#messageModal").modal('show'); | |
400 | 399 | } |
401 | 400 | } |
402 | 401 | else { |
403 | 402 | $rootScope.errorMessage = LoginMessageConstants.NEW_PASSWORD_FIELD_IS_EMPTY; |
404 | 403 | $("#messageModal").modal('show'); |
405 | 404 | } |
405 | + | |
406 | 406 | } |
407 | 407 | |
408 | 408 | $rootScope.lexiconLanguageArray = []; | ... | ... |
400-SOURCECODE/AIAHTML5.Web/index.html
... | ... | @@ -1115,9 +1115,10 @@ |
1115 | 1115 | </tr> |
1116 | 1116 | <tr> |
1117 | 1117 | <td> |
1118 | - <input class="form-control" name="newPassword" value="*****" type="password" style="padding:3px 5px; height:25px; width:98%;" ng-model="userInfo.newPassword" ng-minlength="5" required> | |
1118 | + <input class="form-control" name="newPassword" value="*****" type="password" style="padding:3px 5px; height:25px; width:98%;" ng-model="userInfo.newPassword" ng-minlength="8" ng-maxlength="20" required> | |
1119 | 1119 | <span style="color: maroon; font-weight:bold" ng-show="resetPasswordForm.newPassword.$touched && resetPasswordForm.newPassword.$invalid && resetPasswordForm.newPassword.$pristine">The password is required.</span> |
1120 | - <p ng-show="resetPasswordForm.newPassword.$error.minlength" style="font-weight: bold; color: maroon;">Password is too short.</p> | |
1120 | + <p ng-show="resetPasswordForm.newPassword.$error.minlength" style="font-weight: bold; color: maroon;">Password length must be between 8 - 20 characters.</p> | |
1121 | + <p ng-show="resetPasswordForm.newPassword.$error.maxlength" style="font-weight: bold; color: maroon;">Password length must be between 8 - 20 characters.</p> | |
1121 | 1122 | </td> |
1122 | 1123 | </tr> |
1123 | 1124 | <tr> |
... | ... | @@ -1131,7 +1132,7 @@ |
1131 | 1132 | <td> |
1132 | 1133 | <input class="form-control" name="confirmPassword" value="*****" type="password" style="padding:3px 5px; height:25px; width:98%;" ng-model="userInfo.confirmPassword" required> |
1133 | 1134 | <span style="color: maroon; font-weight: bold; " ng-show="resetPasswordForm.confirmPassword.$touched && resetPasswordForm.confirmPassword.$invalid">Confirm password is required.</span> |
1134 | - <span style="color: maroon; font-weight: bold; " ng-if="passwordMismatchMessage">{{passwordMismatchMessage}}</span> | |
1135 | + <span style="color: maroon; font-weight: bold; " ng-if="resetPasswordForm.newPassword !== resetPasswordForm.confirmPassword">{{passwordMismatchMessage}}</span> | |
1135 | 1136 | </td> |
1136 | 1137 | </tr> |
1137 | 1138 | <tr> |
... | ... | @@ -1139,7 +1140,7 @@ |
1139 | 1140 | </tr> |
1140 | 1141 | <tr> |
1141 | 1142 | <td> |
1142 | - <button type="submit" ng-click="ResetUserPassword(userInfo)" ng-submit="submitForm(resetPwdForm.$valid)" style="background: #0072a7; border: 1px solid #005076; cursor: pointer; color: #fff; padding: 5px 10px; font-size: 16px; text-transform: uppercase; text-align: center; text-decoration: none; font-family: gotham, 'Helvetica Neue', helvetica, arial, sans-serif; " id="btnUpdatePassword">Submit</button> | |
1143 | + <button type="submit" ng-disabled="resetPasswordForm.$invalid" ng-submit="submitForm(resetPasswordForm.$valid)" ng-click="ResetUserPassword(userInfo)" style="background: #0072a7; border: 1px solid #005076; cursor: pointer; color: #fff; padding: 5px 10px; font-size: 16px; text-transform: uppercase; text-align: center; text-decoration: none; font-family: gotham, 'Helvetica Neue', helvetica, arial, sans-serif; " id="btnUpdatePassword">Submit</button> <!--ng-submit="submitForm(resetPwdForm.$valid)"--> <!--ng-click="ResetUserPassword(userInfo)"--> | |
1143 | 1144 | </td> |
1144 | 1145 | </tr> |
1145 | 1146 | </tbody> | ... | ... |