Commit 801042e3d3a7c46b8be08c1224e6899741deb520
1 parent
58cef765
committing code files related to unblock user functionality implementation
Showing
4 changed files
with
15 additions
and
14 deletions
400-SOURCECODE/AIAHTML5.API/Controllers/ResetPasswordController.cs
... | ... | @@ -42,7 +42,7 @@ namespace AIAHTML5.API.Controllers |
42 | 42 | int result = 0; |
43 | 43 | if (!String.IsNullOrEmpty(userInfo["newPassword"].ToString())) |
44 | 44 | { |
45 | - result = AIAHTML5.API.Models.Users.UpdatePassword(userInfo); | |
45 | + result = AIAHTML5.API.Models.Users.UpdatePassword(userInfo, userData.LoginId, userData.EmailId); | |
46 | 46 | if (result > 0) |
47 | 47 | response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.PASSWORD_UPDATE_SUCCESS) }; |
48 | 48 | else | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
... | ... | @@ -54,7 +54,7 @@ namespace AIAHTML5.API.Models |
54 | 54 | } |
55 | 55 | catch (SqlException ex) |
56 | 56 | { |
57 | - logger.Fatal("Exception in GetSQLData for command text =" + commandText + ", Exception= " + ex.Message + ", STACKTRACE= "+ ex.StackTrace); | |
57 | + logger.Fatal("Exception in GetSQLData for command text =" + commandText + ", Exception= " + ex.Message + ", STACKTRACE= " + ex.StackTrace); | |
58 | 58 | } |
59 | 59 | return ds; |
60 | 60 | } |
... | ... | @@ -556,7 +556,7 @@ namespace AIAHTML5.API.Models |
556 | 556 | return objUser; |
557 | 557 | } |
558 | 558 | |
559 | - public static int UpdateUserPassword(dynamic userInfo) | |
559 | + public static int UpdateUserPassword(dynamic userInfo, string loginId, string emailId) | |
560 | 560 | { |
561 | 561 | int result = 0; |
562 | 562 | conn = new SqlConnection(dbConnectionString); |
... | ... | @@ -565,8 +565,8 @@ namespace AIAHTML5.API.Models |
565 | 565 | conn.Open(); |
566 | 566 | cmd.CommandText = "UpdateUserPassword"; |
567 | 567 | cmd.CommandType = CommandType.StoredProcedure; |
568 | - cmd.Parameters.AddWithValue("@sLoginId", userInfo["loginId"].ToString()); | |
569 | - cmd.Parameters.AddWithValue("@sEmailId", userInfo["emailId"].ToString()); | |
568 | + cmd.Parameters.AddWithValue("@sLoginId", loginId); | |
569 | + cmd.Parameters.AddWithValue("@sEmailId", emailId); | |
570 | 570 | cmd.Parameters.AddWithValue("@sNewPassword", userInfo["newPassword"].ToString()); |
571 | 571 | result = cmd.ExecuteNonQuery(); |
572 | 572 | conn.Close(); |
... | ... | @@ -850,7 +850,7 @@ namespace AIAHTML5.API.Models |
850 | 850 | } |
851 | 851 | catch (SqlException ex) |
852 | 852 | { |
853 | - logger.Fatal("Exception in InsertIncorrectLoginAttempts for UserId= " + userId + ", Exception= " + ex.Message + ", STACKTRACE= "+ ex.StackTrace); | |
853 | + logger.Fatal("Exception in InsertIncorrectLoginAttempts for UserId= " + userId + ", Exception= " + ex.Message + ", STACKTRACE= " + ex.StackTrace); | |
854 | 854 | } |
855 | 855 | return result; |
856 | 856 | } |
... | ... | @@ -936,7 +936,7 @@ namespace AIAHTML5.API.Models |
936 | 936 | catch (SqlException ex) |
937 | 937 | { |
938 | 938 | conn.Close(); |
939 | - logger.Fatal("Exception in DeleteIncorrectLoginAttempts for UserId= " + userId + ", Exception= " + ex.Message + ", STACKTRACE= "+ ex.StackTrace); | |
939 | + logger.Fatal("Exception in DeleteIncorrectLoginAttempts for UserId= " + userId + ", Exception= " + ex.Message + ", STACKTRACE= " + ex.StackTrace); | |
940 | 940 | } |
941 | 941 | return result; |
942 | 942 | } | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
... | ... | @@ -63,7 +63,6 @@ namespace AIAHTML5.API.Models |
63 | 63 | logger.Fatal("Exception in AuthenticateUser for loginId =" + credentials["username"].ToString() + " and password= " + credentials["password"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace); |
64 | 64 | |
65 | 65 | string errorMessage = AIAConstants.ERROR_IN_FECTHING_DETAILS; |
66 | - string error = "Message: " + e.Message + ", STACKTRACE: " + e.StackTrace; | |
67 | 66 | userDetails = errorMessage; |
68 | 67 | } |
69 | 68 | return userDetails; |
... | ... | @@ -131,7 +130,7 @@ namespace AIAHTML5.API.Models |
131 | 130 | |
132 | 131 | } |
133 | 132 | |
134 | - internal static dynamic UpdatePassword(Newtonsoft.Json.Linq.JObject userInfo) | |
133 | + internal static dynamic UpdatePassword(Newtonsoft.Json.Linq.JObject userInfo, string sLoginId, string sEmailId) | |
135 | 134 | { |
136 | 135 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
137 | 136 | //var client = new MongoClient(); |
... | ... | @@ -144,7 +143,7 @@ namespace AIAHTML5.API.Models |
144 | 143 | |
145 | 144 | //var result = collection.UpdateOne(filter, update); |
146 | 145 | |
147 | - int result = DBModel.UpdateUserPassword(userInfo); | |
146 | + int result = DBModel.UpdateUserPassword(userInfo, sLoginId, sEmailId); | |
148 | 147 | |
149 | 148 | if (result > 0) |
150 | 149 | return result; |
... | ... | @@ -158,7 +157,7 @@ namespace AIAHTML5.API.Models |
158 | 157 | } |
159 | 158 | } |
160 | 159 | |
161 | - internal static dynamic UpdateLicenseTerm(string accNumber) | |
160 | + internal static dynamic UpdateLicenseTerm(string accNumber) | |
162 | 161 | { |
163 | 162 | int result = DBModel.UpdateLicenseTermStatus(accNumber); |
164 | 163 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -511,7 +511,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
511 | 511 | } |
512 | 512 | else { |
513 | 513 | $rootScope.errorMessage = LoginMessageConstants.USER_ALREADY_UNBLOCKED; |
514 | - $("#messageModal").modal('show'); | |
514 | + //$("#messageModal").modal('show'); | |
515 | 515 | //$('#messageModal.btn-primary').click(function () { |
516 | 516 | // document.location = '/'; |
517 | 517 | //}); |
... | ... | @@ -3749,11 +3749,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3749 | 3749 | }); |
3750 | 3750 | } |
3751 | 3751 | $rootScope.getLocalStorageValue = function (localStorageParam) { |
3752 | + | |
3753 | + | |
3752 | 3754 | |
3753 | 3755 | if ((localStorage.getItem('loggedInUserDetails') == null) && ($rootScope.isVisibleLogin == false)) |
3754 | 3756 | { |
3755 | - | |
3756 | - $rootScope.LogoutUser(); | |
3757 | + if ($location.url().indexOf('?') == -1) | |
3758 | + $rootScope.LogoutUser(); | |
3757 | 3759 | |
3758 | 3760 | |
3759 | 3761 | } | ... | ... |