Commit 1ddc894a7a84cec4978d95b4b6fffbb4875c1379
merge Merge branch 'SessionBug' into AIA_Production
Showing
14 changed files
with
97 additions
and
77 deletions
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs
@@ -119,10 +119,10 @@ namespace AIAHTML5.ADMIN.API.Controllers | @@ -119,10 +119,10 @@ namespace AIAHTML5.ADMIN.API.Controllers | ||
119 | bool Status = false; | 119 | bool Status = false; |
120 | int userId = jsonData["userId"].Value<Int32>(); | 120 | int userId = jsonData["userId"].Value<Int32>(); |
121 | string tagName = jsonData["tagName"].Value<string>(); | 121 | string tagName = jsonData["tagName"].Value<string>(); |
122 | - bool isAlreadyLoggedIn = jsonData["isAlreadyLoggedIn"].Value<bool>(); | 122 | + long SessionId = jsonData["SessionId"].Value<long>(); |
123 | try | 123 | try |
124 | { | 124 | { |
125 | - Status = UserModel.ManageUserLoginStatus(dbContext, userId, tagName, isAlreadyLoggedIn); | 125 | + Status = UserModel.ManageUserLoginStatus(dbContext, userId, tagName, SessionId); |
126 | 126 | ||
127 | return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); | 127 | return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); |
128 | } | 128 | } |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
@@ -4995,7 +4995,7 @@ namespace AIAHTML5.ADMIN.API.Entity | @@ -4995,7 +4995,7 @@ namespace AIAHTML5.ADMIN.API.Entity | ||
4995 | return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_InsertAIAUser", sLoginIdParameter, sPasswordParameter, sFirstnameParameter, sLastnameParameter, iUserTypeIdParameter, sEmailIdParameter, iSecurityQuesIdParameter, sSecurityAnswerParameter, iCreatorIdParameter, iLicenseIdParameter, iEditionIdParameter, status); | 4995 | return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_InsertAIAUser", sLoginIdParameter, sPasswordParameter, sFirstnameParameter, sLastnameParameter, iUserTypeIdParameter, sEmailIdParameter, iSecurityQuesIdParameter, sSecurityAnswerParameter, iCreatorIdParameter, iLicenseIdParameter, iEditionIdParameter, status); |
4996 | } | 4996 | } |
4997 | 4997 | ||
4998 | - public virtual ObjectResult<Nullable<bool>> usp_ManageUserLoginStatus(Nullable<int> userId, string tag, Nullable<bool> isAlreadyLogin) | 4998 | + public virtual ObjectResult<Nullable<bool>> usp_ManageUserLoginStatus(Nullable<int> userId, string tag, Nullable<long> sessionId) |
4999 | { | 4999 | { |
5000 | var userIdParameter = userId.HasValue ? | 5000 | var userIdParameter = userId.HasValue ? |
5001 | new ObjectParameter("userId", userId) : | 5001 | new ObjectParameter("userId", userId) : |
@@ -5005,11 +5005,11 @@ namespace AIAHTML5.ADMIN.API.Entity | @@ -5005,11 +5005,11 @@ namespace AIAHTML5.ADMIN.API.Entity | ||
5005 | new ObjectParameter("tag", tag) : | 5005 | new ObjectParameter("tag", tag) : |
5006 | new ObjectParameter("tag", typeof(string)); | 5006 | new ObjectParameter("tag", typeof(string)); |
5007 | 5007 | ||
5008 | - var isAlreadyLoginParameter = isAlreadyLogin.HasValue ? | ||
5009 | - new ObjectParameter("isAlreadyLogin", isAlreadyLogin) : | ||
5010 | - new ObjectParameter("isAlreadyLogin", typeof(bool)); | 5008 | + var sessionIdParameter = sessionId.HasValue ? |
5009 | + new ObjectParameter("sessionId", sessionId) : | ||
5010 | + new ObjectParameter("sessionId", typeof(long)); | ||
5011 | 5011 | ||
5012 | - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Nullable<bool>>("usp_ManageUserLoginStatus", userIdParameter, tagParameter, isAlreadyLoginParameter); | 5012 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Nullable<bool>>("usp_ManageUserLoginStatus", userIdParameter, tagParameter, sessionIdParameter); |
5013 | } | 5013 | } |
5014 | } | 5014 | } |
5015 | } | 5015 | } |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
@@ -1410,7 +1410,7 @@ | @@ -1410,7 +1410,7 @@ | ||
1410 | <Function Name="usp_ManageUserLoginStatus" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | 1410 | <Function Name="usp_ManageUserLoginStatus" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
1411 | <Parameter Name="userId" Type="int" Mode="In" /> | 1411 | <Parameter Name="userId" Type="int" Mode="In" /> |
1412 | <Parameter Name="tag" Type="varchar" Mode="In" /> | 1412 | <Parameter Name="tag" Type="varchar" Mode="In" /> |
1413 | - <Parameter Name="isAlreadyLogin" Type="bit" Mode="In" /> | 1413 | + <Parameter Name="sessionId" Type="bigint" Mode="In" /> |
1414 | </Function> | 1414 | </Function> |
1415 | <Function Name="usp_SaveLabExerciseAttempts" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | 1415 | <Function Name="usp_SaveLabExerciseAttempts" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
1416 | <Parameter Name="UserId" Type="int" Mode="In" /> | 1416 | <Parameter Name="UserId" Type="int" Mode="In" /> |
@@ -3006,7 +3006,7 @@ | @@ -3006,7 +3006,7 @@ | ||
3006 | <FunctionImport Name="usp_ManageUserLoginStatus" ReturnType="Collection(Boolean)"> | 3006 | <FunctionImport Name="usp_ManageUserLoginStatus" ReturnType="Collection(Boolean)"> |
3007 | <Parameter Name="userId" Mode="In" Type="Int32" /> | 3007 | <Parameter Name="userId" Mode="In" Type="Int32" /> |
3008 | <Parameter Name="tag" Mode="In" Type="String" /> | 3008 | <Parameter Name="tag" Mode="In" Type="String" /> |
3009 | - <Parameter Name="isAlreadyLogin" Mode="In" Type="Boolean" /> | 3009 | + <Parameter Name="sessionId" Mode="In" Type="Int64" /> |
3010 | </FunctionImport> | 3010 | </FunctionImport> |
3011 | </EntityContainer> | 3011 | </EntityContainer> |
3012 | <ComplexType Name="DA_GetBaseLayer_Result"> | 3012 | <ComplexType Name="DA_GetBaseLayer_Result"> |
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs
@@ -65,12 +65,12 @@ namespace AIAHTML5.ADMIN.API.Models | @@ -65,12 +65,12 @@ namespace AIAHTML5.ADMIN.API.Models | ||
65 | return false; | 65 | return false; |
66 | } | 66 | } |
67 | } | 67 | } |
68 | - public static bool ManageUserLoginStatus(AIADatabaseV5Entities dbContext, int userId, string tagName, bool isAlreadyLoggedIn) | 68 | + public static bool ManageUserLoginStatus(AIADatabaseV5Entities dbContext, int userId, string tagName, long SessionId) |
69 | { | 69 | { |
70 | bool loginStatus = false; | 70 | bool loginStatus = false; |
71 | try | 71 | try |
72 | { | 72 | { |
73 | - loginStatus = Convert.ToBoolean(dbContext.usp_ManageUserLoginStatus(userId, tagName, isAlreadyLoggedIn).FirstOrDefault()); | 73 | + loginStatus = Convert.ToBoolean(dbContext.usp_ManageUserLoginStatus(userId, tagName, SessionId).FirstOrDefault()); |
74 | 74 | ||
75 | return loginStatus; | 75 | return loginStatus; |
76 | } | 76 | } |
400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
@@ -370,9 +370,9 @@ namespace AIAHTML5.API.Controllers | @@ -370,9 +370,9 @@ namespace AIAHTML5.API.Controllers | ||
370 | { | 370 | { |
371 | int userId = jsonData["userId"].Value<int>(); | 371 | int userId = jsonData["userId"].Value<int>(); |
372 | string tagName = jsonData["tagName"].Value<string>(); | 372 | string tagName = jsonData["tagName"].Value<string>(); |
373 | - bool isAlreadyLoggedIn = jsonData["isAlreadyLoggedIn"].Value<bool>(); | 373 | + long SessionId = jsonData["SessionId"].Value<long>(); |
374 | 374 | ||
375 | - loginStatus = AIAHTML5.API.Models.Users.GetUserLoginStatus(userId, tagName, isAlreadyLoggedIn); | 375 | + loginStatus = AIAHTML5.API.Models.Users.GetUserLoginStatus(userId, tagName, SessionId); |
376 | 376 | ||
377 | return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(loginStatus) }; | 377 | return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(loginStatus) }; |
378 | } | 378 | } |
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
@@ -310,7 +310,7 @@ namespace AIAHTML5.API.Models | @@ -310,7 +310,7 @@ namespace AIAHTML5.API.Models | ||
310 | return objUser; | 310 | return objUser; |
311 | } | 311 | } |
312 | 312 | ||
313 | - internal static string GetUserLoginStatus(int userId,string tagName,bool isAlreadyLoggedIn) | 313 | + internal static string GetUserLoginStatus(int userId,string tagName, long SessionId) |
314 | { | 314 | { |
315 | string status=string.Empty; | 315 | string status=string.Empty; |
316 | DBModel objModel = new DBModel(); | 316 | DBModel objModel = new DBModel(); |
@@ -325,7 +325,7 @@ namespace AIAHTML5.API.Models | @@ -325,7 +325,7 @@ namespace AIAHTML5.API.Models | ||
325 | cmd.CommandType = CommandType.StoredProcedure; | 325 | cmd.CommandType = CommandType.StoredProcedure; |
326 | cmd.Parameters.AddWithValue("@userId", userId); | 326 | cmd.Parameters.AddWithValue("@userId", userId); |
327 | cmd.Parameters.AddWithValue("@tag", tagName); | 327 | cmd.Parameters.AddWithValue("@tag", tagName); |
328 | - cmd.Parameters.AddWithValue("@isAlreadyLogin", isAlreadyLoggedIn); | 328 | + cmd.Parameters.AddWithValue("@sessionId", SessionId); |
329 | adapter = new SqlDataAdapter(cmd); | 329 | adapter = new SqlDataAdapter(cmd); |
330 | adapter.Fill(ds); | 330 | adapter.Fill(ds); |
331 | 331 |
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
@@ -306,10 +306,10 @@ namespace AIAHTML5.API.Models | @@ -306,10 +306,10 @@ namespace AIAHTML5.API.Models | ||
306 | } | 306 | } |
307 | 307 | ||
308 | 308 | ||
309 | - internal static string GetUserLoginStatus(int userId, string tagName,bool isAlreadyLoggedIn) | 309 | + internal static string GetUserLoginStatus(int userId, string tagName, long SessionId) |
310 | { | 310 | { |
311 | string status = null; | 311 | string status = null; |
312 | - status = DBModel.GetUserLoginStatus(userId, tagName, isAlreadyLoggedIn); | 312 | + status = DBModel.GetUserLoginStatus(userId, tagName, SessionId); |
313 | 313 | ||
314 | return status; | 314 | return status; |
315 | } | 315 | } |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -78,32 +78,11 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -78,32 +78,11 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
78 | //$rootScope.errorMessage = ''; // Commented initialization to retain message when coming to login after password reset success screen | 78 | //$rootScope.errorMessage = ''; // Commented initialization to retain message when coming to login after password reset success screen |
79 | $rootScope.disableFileMenu = "disableFileMenu"; | 79 | $rootScope.disableFileMenu = "disableFileMenu"; |
80 | 80 | ||
81 | - $rootScope.userInfo = { | ||
82 | - username: null, | ||
83 | - password: null, | ||
84 | - emailId: null, | ||
85 | - newPassword: null, | ||
86 | - confirmPassword: null, | ||
87 | - userMessage: null, | ||
88 | - unblockUser: false, | ||
89 | - isMailForForgotPassword:false | ||
90 | - }; | ||
91 | $rootScope.userLicenseInfo = { | 81 | $rootScope.userLicenseInfo = { |
92 | userLicenseId: 0, | 82 | userLicenseId: 0, |
93 | licenseeAccountNumber: null | 83 | licenseeAccountNumber: null |
94 | }; | 84 | }; |
95 | 85 | ||
96 | - $rootScope.siteUrlInfo = { | ||
97 | - siteIP: null, | ||
98 | - remoteIPAddress:null, | ||
99 | - status: null, | ||
100 | - accountNumber: null, | ||
101 | - edition: null, | ||
102 | - urlReferer: null, | ||
103 | - calsCreds: null, | ||
104 | - userId: null, | ||
105 | - password:null | ||
106 | - } | ||
107 | $rootScope.userData; | 86 | $rootScope.userData; |
108 | $rootScope.userModules; | 87 | $rootScope.userModules; |
109 | $rootScope.passwordMismatchMessage; | 88 | $rootScope.passwordMismatchMessage; |
@@ -134,7 +113,35 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -134,7 +113,35 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
134 | } | 113 | } |
135 | 114 | ||
136 | $rootScope.initializeAIA = function () { | 115 | $rootScope.initializeAIA = function () { |
137 | - if (params != null && params != undefined && params!="") { | 116 | + var date = new Date(); |
117 | + $rootScope.userInfo = { | ||
118 | + username: null, | ||
119 | + password: null, | ||
120 | + emailId: null, | ||
121 | + newPassword: null, | ||
122 | + confirmPassword: null, | ||
123 | + userMessage: null, | ||
124 | + unblockUser: false, | ||
125 | + isMailForForgotPassword: false, | ||
126 | + SessionId:date.getTime() | ||
127 | + }; | ||
128 | + | ||
129 | + $rootScope.siteUrlInfo = { | ||
130 | + siteIP: null, | ||
131 | + remoteIPAddress: null, | ||
132 | + status: null, | ||
133 | + accountNumber: null, | ||
134 | + edition: null, | ||
135 | + urlReferer: null, | ||
136 | + calsCreds: null, | ||
137 | + userId: null, | ||
138 | + password: null, | ||
139 | + mtype:null, | ||
140 | + id:null, | ||
141 | + SessionId:date.getTime() | ||
142 | + } | ||
143 | + | ||
144 | + if (params != null && params != undefined && params != "") { | ||
138 | 145 | ||
139 | $scope.ValidateClientSiteUrl(); | 146 | $scope.ValidateClientSiteUrl(); |
140 | } | 147 | } |
@@ -166,6 +173,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -166,6 +173,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
166 | $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); | 173 | $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); |
167 | if ($scope.currentUserDetails != undefined) { | 174 | if ($scope.currentUserDetails != undefined) { |
168 | $rootScope.isVisibleLogin = false; | 175 | $rootScope.isVisibleLogin = false; |
176 | + $location.url('/'); | ||
169 | ConfigurationService.getCofigValue() | 177 | ConfigurationService.getCofigValue() |
170 | .then( | 178 | .then( |
171 | function (configresult) { | 179 | function (configresult) { |
@@ -181,7 +189,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -181,7 +189,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
181 | $scope.checkuserstatus = { | 189 | $scope.checkuserstatus = { |
182 | userId: userId, | 190 | userId: userId, |
183 | tagName: loggedInUser.Id==0?'logout':'update', | 191 | tagName: loggedInUser.Id==0?'logout':'update', |
184 | - isAlreadyLoggedIn:true | 192 | + SessionId:loggedInUser.SessionId |
185 | } | 193 | } |
186 | 194 | ||
187 | // this case found when browser closed by user after login. after long time (after 20 min) open site again | 195 | // this case found when browser closed by user after login. after long time (after 20 min) open site again |
@@ -259,6 +267,12 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -259,6 +267,12 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
259 | $('#spinnerLogin').css('visibility', 'hidden'); | 267 | $('#spinnerLogin').css('visibility', 'hidden'); |
260 | $('.loginPanel').css('pointer-events', 'auto'); | 268 | $('.loginPanel').css('pointer-events', 'auto'); |
261 | $('.loginPanel').css('opacity', '1'); | 269 | $('.loginPanel').css('opacity', '1'); |
270 | + | ||
271 | + $rootScope.isLoading = false; | ||
272 | + $('#spinner').css('visibility', 'hidden'); | ||
273 | + $('#HomeContainerDiv').css('pointer-events', 'auto'); | ||
274 | + $('#HomeContainerDiv').css('opacity', '1'); | ||
275 | + | ||
262 | } | 276 | } |
263 | $rootScope.LoginDisableUI=function() | 277 | $rootScope.LoginDisableUI=function() |
264 | { | 278 | { |
@@ -266,8 +280,14 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -266,8 +280,14 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
266 | $('#spinnerLogin').css('visibility', 'visible'); | 280 | $('#spinnerLogin').css('visibility', 'visible'); |
267 | $('.loginPanel').css('pointer-events', 'none'); | 281 | $('.loginPanel').css('pointer-events', 'none'); |
268 | $('.loginPanel').css('opacity', '0.7'); | 282 | $('.loginPanel').css('opacity', '0.7'); |
283 | + | ||
284 | + $rootScope.isLoading = true; | ||
285 | + $('#spinner').css('visibility', 'visible'); | ||
286 | + $('#HomeContainerDiv').css('pointer-events', 'none'); | ||
287 | + $('#HomeContainerDiv').css('opacity', '0.7'); | ||
288 | + | ||
269 | } | 289 | } |
270 | - $rootScope.AuthenticateUser = function (userInfo,isAlreadyLoggedIn) { | 290 | + $rootScope.AuthenticateUser = function (userInfo) { |
271 | if (navigator.cookieEnabled) { | 291 | if (navigator.cookieEnabled) { |
272 | $rootScope.errorMessage = ""; | 292 | $rootScope.errorMessage = ""; |
273 | if (userInfo.username == "" || userInfo.username == null || userInfo.username == undefined || userInfo.password == "" || userInfo.password == null || userInfo.password == undefined) { | 293 | if (userInfo.username == "" || userInfo.username == null || userInfo.username == undefined || userInfo.password == "" || userInfo.password == null || userInfo.password == undefined) { |
@@ -299,7 +319,8 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -299,7 +319,8 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
299 | result.aiaIdleTime=$rootScope.aiaIdleTime; | 319 | result.aiaIdleTime=$rootScope.aiaIdleTime; |
300 | result.aiaIdleTimeOut=$rootScope.aiaIdleTimeOut; | 320 | result.aiaIdleTimeOut=$rootScope.aiaIdleTimeOut; |
301 | result.aiaPingInterval=$rootScope.aiaPingInterval; | 321 | result.aiaPingInterval=$rootScope.aiaPingInterval; |
302 | - $rootScope.isAlreadyLoggedIn=isAlreadyLoggedIn==undefined?false:isAlreadyLoggedIn; | 322 | + result.SessionId=userInfo.SessionId; |
323 | + | ||
303 | //display user name | 324 | //display user name |
304 | $rootScope.userName=result.FirstName+" "+result.LastName; | 325 | $rootScope.userName=result.FirstName+" "+result.LastName; |
305 | 326 | ||
@@ -684,17 +705,21 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -684,17 +705,21 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
684 | //maintain user session by licenseid of site login | 705 | //maintain user session by licenseid of site login |
685 | if(loggedInUser!==null && loggedInUser.AccountNumber==sitedetail.accountNumber) | 706 | if(loggedInUser!==null && loggedInUser.AccountNumber==sitedetail.accountNumber) |
686 | { | 707 | { |
687 | - $rootScope.AuthenticateClientSiteUser(sitedetail,true); | 708 | + //using old session id |
709 | + sitedetail.SessionId = loggedInUser.SessionId; | ||
710 | + $rootScope.AuthenticateClientSiteUser(sitedetail); | ||
688 | } | 711 | } |
689 | else | 712 | else |
690 | { | 713 | { |
691 | - $rootScope.AuthenticateClientSiteUser(sitedetail,false); | 714 | + //using new sessionid |
715 | + $rootScope.AuthenticateClientSiteUser(sitedetail); | ||
692 | } | 716 | } |
693 | }); | 717 | }); |
694 | } | 718 | } |
695 | } | 719 | } |
696 | 720 | ||
697 | - $rootScope.AuthenticateClientSiteUser = function (siteInfo,isAlreadyLoggedIn) { | 721 | + $rootScope.AuthenticateClientSiteUser = function (siteInfo) { |
722 | + $rootScope.LoginDisableUI(); | ||
698 | AuthenticationService.validateClientSite(siteInfo) | 723 | AuthenticationService.validateClientSite(siteInfo) |
699 | .then( | 724 | .then( |
700 | function (result) { | 725 | function (result) { |
@@ -745,7 +770,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -745,7 +770,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
745 | result.aiaIdleTime=$rootScope.aiaIdleTime; | 770 | result.aiaIdleTime=$rootScope.aiaIdleTime; |
746 | result.aiaIdleTimeOut=$rootScope.aiaIdleTimeOut; | 771 | result.aiaIdleTimeOut=$rootScope.aiaIdleTimeOut; |
747 | result.aiaPingInterval=$rootScope.aiaPingInterval; | 772 | result.aiaPingInterval=$rootScope.aiaPingInterval; |
748 | - $rootScope.isAlreadyLoggedIn=isAlreadyLoggedIn==undefined?false:isAlreadyLoggedIn; | 773 | + result.SessionId=siteInfo.SessionId; |
749 | //display user name | 774 | //display user name |
750 | $rootScope.userName=result.FirstName+" "+result.LastName; | 775 | $rootScope.userName=result.FirstName+" "+result.LastName; |
751 | if (typeof result.FirstName != undefined || result.FirstName != "" || result.FirstName != null) { | 776 | if (typeof result.FirstName != undefined || result.FirstName != "" || result.FirstName != null) { |
@@ -1047,11 +1072,10 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -1047,11 +1072,10 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
1047 | $rootScope.userStatus = { | 1072 | $rootScope.userStatus = { |
1048 | userId: null, | 1073 | userId: null, |
1049 | tagName: null, | 1074 | tagName: null, |
1050 | - loginStatus: null, | ||
1051 | - isAlreadyLoggedIn:null | 1075 | + SessionId:null |
1052 | } | 1076 | } |
1053 | console.log('user session start'); | 1077 | console.log('user session start'); |
1054 | - $rootScope.CheckUserSession('insert',$rootScope.isAlreadyLoggedIn); | 1078 | + $rootScope.CheckUserSession('insert'); |
1055 | 1079 | ||
1056 | $rootScope.$on('IdleStart', function() { | 1080 | $rootScope.$on('IdleStart', function() { |
1057 | // this event fire when idle time finish and time out start | 1081 | // this event fire when idle time finish and time out start |
@@ -1069,14 +1093,14 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -1069,14 +1093,14 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
1069 | // config set in AIA.js -:IdleProvider.timeout(15); | 1093 | // config set in AIA.js -:IdleProvider.timeout(15); |
1070 | $rootScope.isSessionTimeout=true; | 1094 | $rootScope.isSessionTimeout=true; |
1071 | console.log('session is timeout'); | 1095 | console.log('session is timeout'); |
1072 | - $rootScope.CheckUserSession('logout',true); | 1096 | + $rootScope.CheckUserSession('logout'); |
1073 | }); | 1097 | }); |
1074 | $rootScope.$on('Keepalive', function() { | 1098 | $rootScope.$on('Keepalive', function() { |
1075 | // it watch the session on perticular time interval during idle time period | 1099 | // it watch the session on perticular time interval during idle time period |
1076 | // config set in AIA.js -: KeepaliveProvider.interval(10); | 1100 | // config set in AIA.js -: KeepaliveProvider.interval(10); |
1077 | //we will use it to recieve request from databse if user logout from admin activity | 1101 | //we will use it to recieve request from databse if user logout from admin activity |
1078 | console.log('ping user session'); | 1102 | console.log('ping user session'); |
1079 | - $rootScope.CheckUserSession('update',true); | 1103 | + $rootScope.CheckUserSession('update'); |
1080 | }); | 1104 | }); |
1081 | 1105 | ||
1082 | 1106 | ||
@@ -1103,7 +1127,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -1103,7 +1127,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
1103 | $rootScope.isSessionTimeout=true; | 1127 | $rootScope.isSessionTimeout=true; |
1104 | localStorage.removeItem('loggedInUserDetails'); | 1128 | localStorage.removeItem('loggedInUserDetails'); |
1105 | localStorage.clear(); | 1129 | localStorage.clear(); |
1106 | - $rootScope.CheckUserSession('logout',true); | 1130 | + $rootScope.CheckUserSession('logout'); |
1107 | $timeout(function(){ | 1131 | $timeout(function(){ |
1108 | document.location = '/'; | 1132 | document.location = '/'; |
1109 | $rootScope.isVisibleLogin = true; | 1133 | $rootScope.isVisibleLogin = true; |
@@ -1118,15 +1142,15 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -1118,15 +1142,15 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
1118 | $rootScope.isVisibleLogin = true; | 1142 | $rootScope.isVisibleLogin = true; |
1119 | } | 1143 | } |
1120 | 1144 | ||
1121 | - $rootScope.CheckUserSession = function (tagName,isAlreadyLoggedIn) { | 1145 | + $rootScope.CheckUserSession = function (tagName) { |
1122 | //console.log('user login id: '+$rootScope.userData.Id); | 1146 | //console.log('user login id: '+$rootScope.userData.Id); |
1123 | //console.log('user login activity tag: '+tagName); | 1147 | //console.log('user login activity tag: '+tagName); |
1124 | if($rootScope.userData==undefined) return; | 1148 | if($rootScope.userData==undefined) return; |
1125 | //incase site user login userid is 0 so then using license id | 1149 | //incase site user login userid is 0 so then using license id |
1126 | $rootScope.userStatus.userId=$rootScope.userData.Id==0?$rootScope.userData.LicenseId:$rootScope.userData.Id; | 1150 | $rootScope.userStatus.userId=$rootScope.userData.Id==0?$rootScope.userData.LicenseId:$rootScope.userData.Id; |
1127 | $rootScope.userStatus.tagName=tagName; | 1151 | $rootScope.userStatus.tagName=tagName; |
1128 | - $rootScope.userStatus.isAlreadyLoggedIn=isAlreadyLoggedIn; | ||
1129 | - $rootScope.isAlreadyLoggedIn=true; | 1152 | + $rootScope.userStatus.SessionId=$rootScope.userData.SessionId; |
1153 | + | ||
1130 | AuthenticationService.ManageUserLoginStatus($rootScope.userStatus) | 1154 | AuthenticationService.ManageUserLoginStatus($rootScope.userStatus) |
1131 | .then( | 1155 | .then( |
1132 | function (loginStatus) { | 1156 | function (loginStatus) { |
@@ -1162,20 +1186,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | @@ -1162,20 +1186,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A | ||
1162 | userInfo["password"] = userInfo.Password; | 1186 | userInfo["password"] = userInfo.Password; |
1163 | 1187 | ||
1164 | 1188 | ||
1165 | - $rootScope.AuthenticateUser(userInfo,true); | ||
1166 | - | ||
1167 | - if ($rootScope.refreshcheck == null) { | ||
1168 | - | ||
1169 | - if ($location.path() == "/lab-exercises-detail") { | ||
1170 | - | ||
1171 | - $location.url('/'); | ||
1172 | - } | ||
1173 | - else { | ||
1174 | - | ||
1175 | - $location.url('/'); | ||
1176 | - } | ||
1177 | - $rootScope.isVisibleLogin = false; | ||
1178 | - } | 1189 | + $rootScope.AuthenticateUser(userInfo); |
1179 | } | 1190 | } |
1180 | 1191 | ||
1181 | 1192 |
400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js
@@ -57,8 +57,8 @@ | @@ -57,8 +57,8 @@ | ||
57 | }).error(function (data, status, headers, config) { | 57 | }).error(function (data, status, headers, config) { |
58 | console.log('error') | 58 | console.log('error') |
59 | deferred.reject(data); | 59 | deferred.reject(data); |
60 | - $rootScope.errorMessage = data; | ||
61 | - $("#messageModal").modal('show'); | 60 | + // $rootScope.errorMessage = data; |
61 | + // $("#messageModal").modal('show'); | ||
62 | 62 | ||
63 | }); | 63 | }); |
64 | return deferred.promise; | 64 | return deferred.promise; |
400-SOURCECODE/AIAHTML5.Web/index.aspx
@@ -308,7 +308,7 @@ | @@ -308,7 +308,7 @@ | ||
308 | </div> | 308 | </div> |
309 | </div> | 309 | </div> |
310 | <div id="index" ng-hide="isVisibleLogin"> | 310 | <div id="index" ng-hide="isVisibleLogin"> |
311 | - <div class="container-fluid "> | 311 | + <div class="container-fluid " id="HomeContainerDiv"> |
312 | <!--Header--> | 312 | <!--Header--> |
313 | 313 | ||
314 | <nav class="navbar navbar-inverse navbar-fixed-top"> | 314 | <nav class="navbar navbar-inverse navbar-fixed-top"> |
400-SOURCECODE/Admin/src/app/app.component.ts
@@ -81,6 +81,11 @@ export class AppComponent implements OnInit { | @@ -81,6 +81,11 @@ export class AppComponent implements OnInit { | ||
81 | // console.log("You\'ve gone idle!"); | 81 | // console.log("You\'ve gone idle!"); |
82 | // }); | 82 | // }); |
83 | 83 | ||
84 | + if(window.location.hostname=="localhost") | ||
85 | + { | ||
86 | + //insert new session | ||
87 | + this.loginManageStatus('insert'); | ||
88 | + } | ||
84 | this.idle.watch(); | 89 | this.idle.watch(); |
85 | 90 | ||
86 | } | 91 | } |
@@ -134,7 +139,7 @@ export class AppComponent implements OnInit { | @@ -134,7 +139,7 @@ export class AppComponent implements OnInit { | ||
134 | this.userservice.ManageUserLoginStatus({ | 139 | this.userservice.ManageUserLoginStatus({ |
135 | userId: this.global.UserId, | 140 | userId: this.global.UserId, |
136 | tagName: tagname, | 141 | tagName: tagname, |
137 | - isAlreadyLoggedIn:true | 142 | + SessionId:this.global.SessionId |
138 | }).subscribe(status => { | 143 | }).subscribe(status => { |
139 | console.log(status); | 144 | console.log(status); |
140 | if(status=='False') | 145 | if(status=='False') |
400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts
@@ -56,7 +56,7 @@ export class UserService { | @@ -56,7 +56,7 @@ export class UserService { | ||
56 | 56 | ||
57 | //////////Manage UserLogin Status/////////// | 57 | //////////Manage UserLogin Status/////////// |
58 | ManageUserLoginStatus(obj: any) { | 58 | ManageUserLoginStatus(obj: any) { |
59 | - var jsonData = { 'userId': obj.userId, 'tagName': obj.tagName,'isAlreadyLoggedIn': obj.isAlreadyLoggedIn }; | 59 | + var jsonData = { 'userId': obj.userId, 'tagName': obj.tagName,'SessionId': obj.SessionId }; |
60 | console.log(obj); | 60 | console.log(obj); |
61 | var headers = new Headers({ | 61 | var headers = new Headers({ |
62 | 'Content-Type': 'application/json' | 62 | 'Content-Type': 'application/json' |
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
@@ -392,8 +392,8 @@ export class UsersList implements OnInit, AfterViewChecked { | @@ -392,8 +392,8 @@ export class UsersList implements OnInit, AfterViewChecked { | ||
392 | this._loadingService.ShowLoading("global-loading"); | 392 | this._loadingService.ShowLoading("global-loading"); |
393 | this.userservice.ManageUserLoginStatus({ | 393 | this.userservice.ManageUserLoginStatus({ |
394 | userId: this.selectedId, | 394 | userId: this.selectedId, |
395 | - tagName: 'logout', | ||
396 | - isAlreadyLoggedIn:true | 395 | + tagName: 'adminlogout', |
396 | + SessionId:this.global.SessionId | ||
397 | }).subscribe(x => { | 397 | }).subscribe(x => { |
398 | console.log(x); | 398 | console.log(x); |
399 | this.EditbuttonStatus=undefined; | 399 | this.EditbuttonStatus=undefined; |
400-SOURCECODE/Admin/src/app/shared/global.ts
@@ -27,6 +27,7 @@ export class GlobalService { | @@ -27,6 +27,7 @@ export class GlobalService { | ||
27 | aiaIdleTime:number=0; | 27 | aiaIdleTime:number=0; |
28 | aiaIdleTimeOut:number=0; | 28 | aiaIdleTimeOut:number=0; |
29 | aiaPingInterval:number=0; | 29 | aiaPingInterval:number=0; |
30 | + SessionId:number=0; | ||
30 | RemoveColumns: Array<string> = ["Serial_No", "LicenseId","RowNum"] | 31 | RemoveColumns: Array<string> = ["Serial_No", "LicenseId","RowNum"] |
31 | error; | 32 | error; |
32 | public href: string = ""; | 33 | public href: string = ""; |
@@ -41,6 +42,7 @@ export class GlobalService { | @@ -41,6 +42,7 @@ export class GlobalService { | ||
41 | this.aiaIdleTime=this.loggedInUser.aiaIdleTime; | 42 | this.aiaIdleTime=this.loggedInUser.aiaIdleTime; |
42 | this.aiaIdleTimeOut=this.loggedInUser.aiaIdleTimeOut; | 43 | this.aiaIdleTimeOut=this.loggedInUser.aiaIdleTimeOut; |
43 | this.aiaPingInterval=this.loggedInUser.aiaPingInterval; | 44 | this.aiaPingInterval=this.loggedInUser.aiaPingInterval; |
45 | + this.SessionId=this.loggedInUser.SessionId; | ||
44 | 46 | ||
45 | } | 47 | } |
46 | 48 | ||
@@ -72,9 +74,11 @@ export class GlobalService { | @@ -72,9 +74,11 @@ export class GlobalService { | ||
72 | { | 74 | { |
73 | // for 'ng serve --open' command | 75 | // for 'ng serve --open' command |
74 | //**** for localhost:4200 *****// | 76 | //**** for localhost:4200 *****// |
77 | + var date = new Date(); | ||
78 | + var newsessionid = date.getTime();//timestamp is the number of milliseconds that have passed since January 1, 1970 | ||
75 | localStorage.setItem('loggedInUserDetails', JSON.stringify( | 79 | localStorage.setItem('loggedInUserDetails', JSON.stringify( |
76 | { | 80 | { |
77 | - "Id": 1, "FirstName": "Maribel", "LastName": "sfsfsfsfsfsfs", "EmailId": "ravi.vishwakarma@ebix.com", "LoginId": "superadmin", "Password": "ebix@2016","aiaIdleTime": 300,"aiaIdleTimeOut": 30,"aiaPingInterval": 10, "SecurityQuestionId": 1, "SecurityAnswer": "boxer", "CreatorId": 1, "CreationDate": "2009-03-02T00:00:00", "DeactivationDate": null, "ModifierId": 1, "ModifiedDate": "2017-01-24T02:03:19", "UserType": "Super Admin", "UserTypeId": 1, "IsActive": true, "IsCorrectPassword": false, "IncorrectLoginAttemptCount": 0, "IsBlocked": false, "LicenseId": 0, "EditionId": 0, "LoginFailureCauseId": 0, "Modules": [{ "slug": "da-view-list", "name": "Dissectible Anatomy", "id": 1 }, { "slug": "tile-view-list", "name": "Atlas Anatomy", "id": 2 }, { "slug": "3d-anatomy-list", "name": "3D Anatomy", "id": 3 }, { "slug": "clinical-illustrations", "name": "Clinical Illustrations", "id": 4 }, { "slug": "clinical-animations", "name": "Clinical Animations", "id": 5 }, { "slug": "Link/encyclopedia", "name": "Encyclopedia", "id": 6 }, { "slug": "curriculum-builder", "name": "Curriculum Builder", "id": 7 }, { "slug": "anatomy-test", "name": "Anatomy Test", "id": 8 }, { "slug": "Link/IP-10", "name": "IP 10", "id": 9 }, { "slug": "lab-exercises", "name": "Lab Exercises", "id": 10 }, { "slug": "Link/indepth-reports", "name": "In-Depth Reports", "id": 11 }, { "slug": "Link/complementary-and-alternate-medicine", "name": "CAM", "id": 12 }, { "slug": "ADAM-images", "name": "A.D.A.M. Images", "id": 13 }, { "slug": "Link/bodyguide", "name": "Body Guide", "id": 14 }, { "slug": "Link/health-navigator", "name": "Symptom Navigator", "id": 15 }, { "slug": "Link/wellness-tools", "name": "The Wellness Tools", "id": 16 }, { "slug": "Link/aod", "name": "A.D.A.M. OnDemand", "id": 1017 }], "LicenseInfo": { "Id": 0, "AccountNumber": "AIAS000319" }, "LicenseSubscriptions": null, "IsSubscriptionExpired": false, "SubscriptionExpirationDate": null, "TermsAndConditionsTitle": null, "TermsAndConditionsText": null | 81 | + "Id": 1, "FirstName": "Maribel", "LastName": "sfsfsfsfsfsfs", "EmailId": "ravi.vishwakarma@ebix.com", "LoginId": "superadmin", "Password": "ebix@2016","aiaIdleTime": 300,"aiaIdleTimeOut": 30,"aiaPingInterval": 10,"SessionId":newsessionid, "SecurityQuestionId": 1, "SecurityAnswer": "boxer", "CreatorId": 1, "CreationDate": "2009-03-02T00:00:00", "DeactivationDate": null, "ModifierId": 1, "ModifiedDate": "2017-01-24T02:03:19", "UserType": "Super Admin", "UserTypeId": 1, "IsActive": true, "IsCorrectPassword": false, "IncorrectLoginAttemptCount": 0, "IsBlocked": false, "LicenseId": 0, "EditionId": 0, "LoginFailureCauseId": 0, "Modules": [{ "slug": "da-view-list", "name": "Dissectible Anatomy", "id": 1 }, { "slug": "tile-view-list", "name": "Atlas Anatomy", "id": 2 }, { "slug": "3d-anatomy-list", "name": "3D Anatomy", "id": 3 }, { "slug": "clinical-illustrations", "name": "Clinical Illustrations", "id": 4 }, { "slug": "clinical-animations", "name": "Clinical Animations", "id": 5 }, { "slug": "Link/encyclopedia", "name": "Encyclopedia", "id": 6 }, { "slug": "curriculum-builder", "name": "Curriculum Builder", "id": 7 }, { "slug": "anatomy-test", "name": "Anatomy Test", "id": 8 }, { "slug": "Link/IP-10", "name": "IP 10", "id": 9 }, { "slug": "lab-exercises", "name": "Lab Exercises", "id": 10 }, { "slug": "Link/indepth-reports", "name": "In-Depth Reports", "id": 11 }, { "slug": "Link/complementary-and-alternate-medicine", "name": "CAM", "id": 12 }, { "slug": "ADAM-images", "name": "A.D.A.M. Images", "id": 13 }, { "slug": "Link/bodyguide", "name": "Body Guide", "id": 14 }, { "slug": "Link/health-navigator", "name": "Symptom Navigator", "id": 15 }, { "slug": "Link/wellness-tools", "name": "The Wellness Tools", "id": 16 }, { "slug": "Link/aod", "name": "A.D.A.M. OnDemand", "id": 1017 }], "LicenseInfo": { "Id": 0, "AccountNumber": "AIAS000319" }, "LicenseSubscriptions": null, "IsSubscriptionExpired": false, "SubscriptionExpirationDate": null, "TermsAndConditionsTitle": null, "TermsAndConditionsText": null |
78 | })); | 82 | })); |
79 | } | 83 | } |
80 | 84 |