diff --git a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll.config b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll.config index ca03c37..3c4b171 100644 --- a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll.config +++ b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll.config @@ -37,8 +37,8 @@ - - + + diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 0ef1c42..251d6bc 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -161,25 +161,39 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } } - $rootScope.SendMailToUser = function (userInfo, isPasswordMissing) { + $rootScope.SendMailToUser = function (userInfo, isMailForPassword) { if ((userInfo.emailId != null) && (userInfo.emailId != '')) { if (validateEmail(userInfo.emailId)) { - if (isPasswordMissing == 'true') + if (isMailForPassword == 'true') userInfo.isPassword = true; else userInfo.isPassword = false; AuthenticationService.SendMailToUser(userInfo) .then(function (result) { - if($('.forgot-sm').length>0) { - $('.forgot-sm').fadeOut(); - $('.forgot-sm').modal('hide'); - alert('UserID sent in mail successfully.'); + if (result == LoginConstants.USER_NOT_FOUND) { + alert("Error occured."); } - if($('.forgot-sm1').length>0) { - $('.forgot-sm1').fadeOut(); - $('.forgot-sm1').modal('hide'); - alert('Password sent in mail successfully.'); + else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { + alert("Error occured."); + } + else { + if (result.loginId != undefined || result.loginId != "" || result.loginId != null) { + var message; + if ($('.forgot-sm').length > 0) { + $('.forgot-sm').fadeOut(); + $('.forgot-sm').modal('hide'); + } + if ($('.forgot-sm1').length > 0) { + $('.forgot-sm1').fadeOut(); + $('.forgot-sm1').modal('hide'); + } + if (isMailForPassword) + message = "Password"; + else + message = "UserId"; + alert(message + " sent in mail successfully."); + } } }, @@ -189,40 +203,23 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic }); } else { - alert("Please, enter correct email id"); + alert("Please enter correct email id"); } } else { - alert("Please, enter your email id"); + alert("Please enter your email id"); } - }; + }; - // $rootScope.SendMailToUser = function (userInfo, missingPass) { - // if ((userInfo.emailId != null) && (userInfo.emailId != '')) { - // if (validateEmail(userInfo.emailId)) { - // if (missingPass == 'true') - // userInfo.isPassword = true; - // else - // userInfo.isPassword = false; - - // AuthenticationService.SendMailToUser(userInfo); - // } - // else { - // alert("Please, enter correct email id"); - // } - // } - // else { - // alert("Please, enter your email id"); - // } - //}; + $rootScope.closeResetPasswordPopup = function () { + $("#passwordReset").fadeOut(); + $("#passwordReset").modal('hide'); + } function validateEmail(email) { var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } - //$(document).ready(function () { - // getUserDetails(); - //}); $rootScope.ResetUserPassword = function (userInfo) { var url = $location.url(); @@ -244,7 +241,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } else { if (result.loginId != undefined || result.loginId != "" || result.loginId != null) { - alert('Password has been reset.'); + alert('Your password has been reset.'); $rootScope.isVisibleLogin = true; $rootScope.isVisibleResetPass = false; $location.url() = "/"; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js index 8ced1ec..76d14c8 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js @@ -27,14 +27,6 @@ } }) .success(function (data, status, headers, config) { - //if (data == "User not found.") - // alert("User does not exists."); - //else { - // if (!userInfo.ispassword) { - // alert("UserID sent in mail successfully."); - // $('.forgot-sm').fadeOut(); - // } - //} console.log('success'); deferred.resolve(data); }).error(function (data, status, headers, config) { diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index 3d3eb32..4866cbd 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -1092,9 +1092,8 @@ - - - + + @@ -1109,8 +1108,8 @@ - The password is required. - Password is too short. + The password is required. + Password is too short. @@ -1123,7 +1122,7 @@ - Confirm password is required. + Confirm password is required. {{errorMesaage}} @@ -1132,8 +1131,8 @@ - Submit - Close + Submit + Close
Password is too short.