diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index d8cc549..3e698f6 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -68,7 +68,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.shapestyleFillBorderColor = "black"; $rootScope.shapestyleborderWidth = 2; $rootScope.shapestyleborderStyles = "solid"; - $rootScope.errorMassage = ''; + //$rootScope.errorMessage = ''; $rootScope.disableFileMenu = "disableFileMenu"; $rootScope.userInfo = { @@ -82,7 +82,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic }; $rootScope.userData; $rootScope.userModules; - $rootScope.errorMesaage; + $rootScope.passwordMismatchMessage; $rootScope.isVisibleLogin; $rootScope.haveRoleAdmin; var isfilloptionChecked = ""; @@ -100,7 +100,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic if (userInfo.username == "" || userInfo.username == null || userInfo.password == "" || userInfo.password == null) { // alert(LoginMessageConstants.USER_CREDENTIALS_MISSING); - $rootScope.errorMassage = LoginMessageConstants.USER_CREDENTIALS_MISSING; + $rootScope.errorMessage = LoginMessageConstants.USER_CREDENTIALS_MISSING; $("#messageModal").modal('show'); } else { @@ -117,14 +117,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic if (result == LoginConstants.USER_NOT_FOUND) { $rootScope.isVisibleLogin = true; // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); - $rootScope.errorMassage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; + $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; $("#messageModal").modal('show'); } else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { //alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); $rootScope.isVisibleLogin = true; - $rootScope.errorMassage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; $("#messageModal").modal('show'); } else { @@ -151,7 +151,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic console.log(' Error in authentication = ' + error.statusText); // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); $rootScope.isVisibleLogin = true; - $rootScope.errorMassage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; $("#messageModal").modal('show'); }); } @@ -210,17 +210,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic .then(function (result) { if (result == LoginConstants.USER_NOT_FOUND) { // alert(LoginMessageConstants.INCORRECT_EMAIL_ID); - $rootScope.errorMassage = LoginMessageConstants.INCORRECT_EMAIL_ID; + $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID; $("#messageModal").modal('show'); } else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); - $rootScope.errorMassage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; $("#messageModal").modal('show'); } else if (result == LoginConstants.MAIL_NOT_SENT) { // alert(LoginMessageConstants.MAIL_NOT_SENT); - $rootScope.errorMassage = LoginMessageConstants.MAIL_NOT_SENT; + $rootScope.errorMessage = LoginMessageConstants.MAIL_NOT_SENT; $("#messageModal").modal('show'); } else { @@ -239,7 +239,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic else message = LoginMessageConstants.USERID_SENT_IN_EMAIL //alert(message); - $rootScope.errorMassage = message; + $rootScope.errorMessage = message; $("#messageModal").modal('show'); @@ -250,19 +250,19 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic function (error) { console.log(' Error in authentication = ' + error.statusText); // alert(LoginConstants.ERROR_IN_FECTHING_DETAILS); - $rootScope.errorMassage = LoginConstants.ERROR_IN_FECTHING_DETAILS; + $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS; $("#messageModal").modal('show'); }); } else { // alert(LoginMessageConstants.INCORRECT_EMAIL_ID); - $rootScope.errorMassage = LoginMessageConstants.INCORRECT_EMAIL_ID; + $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID; $("#messageModal").modal('show'); } } else { //alert(LoginMessageConstants.BLANK_EMAIL_ID); - $rootScope.errorMassage = LoginMessageConstants.BLANK_EMAIL_ID; + $rootScope.errorMessage = LoginMessageConstants.BLANK_EMAIL_ID; $("#messageModal").modal('show'); } @@ -289,28 +289,30 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic userInfo.emailId = split[1]; } - if (userInfo.newPassword === userInfo.confirmPassword) { - $rootScope.errorMesaage = null; + if (userInfo.newPassword != null) { + + if (userInfo.newPassword === userInfo.confirmPassword) { + $rootScope.passwordMismatchMessage = null; AuthenticationService.ResetUserPassword(userInfo) .then( function (result) { if (result == LoginConstants.USER_NOT_FOUND) { // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); - $rootScope.errorMassage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; + $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; $("#messageModal").modal('show'); } else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); - $rootScope.errorMassage = LoginConstants.ERROR_IN_FECTHING_DETAILS; + $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS; $("#messageModal").modal('show'); } else { if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); - $rootScope.errorMassage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; + $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; $("#messageModal").modal('show'); $rootScope.isVisibleLogin = true; $rootScope.isVisibleResetPass = false; @@ -321,13 +323,18 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic function (error) { console.log(' Error in authentication = ' + error.statusText); // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); - $rootScope.errorMassage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; $("#messageModal").modal('show'); }); } else { - $rootScope.errorMesaage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH; + $rootScope.passwordMismatchMassage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH; + //$("#messageModal").modal('show'); + } + } + else { + $rootScope.errorMessage = LoginMessageConstants.NEW_PASSWORD_FIELD_IS_EMPTY; $("#messageModal").modal('show'); } } @@ -3598,7 +3605,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic AdminService.SendAdminAccessRequestMail(userInfo) .then(function (result) { if (result == AdminConstants.MAIL_SENT) { - $rootScope.errorMassage = AdminConstants.MAIL_SENT_SUCCESS_MESSAGE; + $rootScope.errorMessage = AdminConstants.MAIL_SENT_SUCCESS_MESSAGE; $("#messageModal").modal('show'); } $("#adminModal").fadeOut(); @@ -3607,7 +3614,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic }, function (error) { console.log(' Error in sending mail to admin support = ' + error.statusText); - $rootScope.errorMassage = AdminConstants.ERROR_IN_SENDING_MAIL; + $rootScope.errorMessage = AdminConstants.ERROR_IN_SENDING_MAIL; $("#messageModal").modal('show'); }); }; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js index f1e6e65..6aaa0a8 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js @@ -306,6 +306,7 @@ AIA.constant("LoginMessageConstants", { "NEW_AND_OLD_PASSWORD_DONOT_MATCH": "Your new password and confirm password not matched!", "USER_CREDENTIALS_MISSING": "Please Enter your credentials.", "USER_NOT_FOUND": "User not found.", + "NEW_PASSWORD_FIELD_IS_EMPTY": "Please enter new password to reset your password." //"ERROR_IN_FECTHING_DETAILS": "Error in fecthing details.", //"MAIL_NOT_SENT": "Mail not sent." diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index baf48fd..6ff3a2e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -1127,7 +1127,7 @@