Commit dbe03d722e2ab541e5e4473247fe424609a6d449

Authored by Birendra
1 parent 68649f51

fix bug in active session

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -1629,10 +1629,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1629 1629 userId: null,
1630 1630 tagName: null,
1631 1631 loginStatus: null,
1632   - isAlreadyLoggedIn:$rootScope.isAlreadyLoggedIn
  1632 + isAlreadyLoggedIn:null
1633 1633 }
1634 1634 console.log('user session start');
1635   - $rootScope.CheckUserSession('insert');
  1635 + $rootScope.CheckUserSession('insert',$rootScope.isAlreadyLoggedIn);
1636 1636  
1637 1637 $rootScope.$on('IdleStart', function() {
1638 1638 // this event fire when idle time finish and time out start
... ... @@ -1650,14 +1650,14 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1650 1650 // config set in AIA.js -:IdleProvider.timeout(15);
1651 1651 $rootScope.isSessionTimeout=true;
1652 1652 console.log('session is timeout');
1653   - $rootScope.CheckUserSession('logout');
  1653 + $rootScope.CheckUserSession('logout',true);
1654 1654 });
1655 1655 $rootScope.$on('Keepalive', function() {
1656 1656 // it watch the session on perticular time interval during idle time period
1657 1657 // config set in AIA.js -: KeepaliveProvider.interval(10);
1658 1658 //we will use it to recieve request from databse if user logout from admin activity
1659 1659 console.log('ping user session');
1660   - $rootScope.CheckUserSession('update');
  1660 + $rootScope.CheckUserSession('update',true);
1661 1661 });
1662 1662  
1663 1663  
... ... @@ -1684,7 +1684,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1684 1684 $rootScope.isSessionTimeout=true;
1685 1685 localStorage.removeItem('loggedInUserDetails');
1686 1686 localStorage.clear();
1687   - $rootScope.CheckUserSession('logout');
  1687 + $rootScope.CheckUserSession('logout',true);
1688 1688 $timeout(function(){
1689 1689 document.location = '/';
1690 1690 $rootScope.isVisibleLogin = true;
... ... @@ -1699,20 +1699,20 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1699 1699 $rootScope.isVisibleLogin = true;
1700 1700 }
1701 1701  
1702   - $rootScope.CheckUserSession = function (tagName) {
  1702 + $rootScope.CheckUserSession = function (tagName,isAlreadyLoggedIn) {
1703 1703 //console.log('user login id: '+$rootScope.userData.Id);
1704 1704 //console.log('user login activity tag: '+tagName);
1705 1705 if($rootScope.userData==undefined) return;
1706 1706 //incase site user login userid is 0 so then using license id
1707 1707 $rootScope.userStatus.userId=$rootScope.userData.Id==0?$rootScope.userData.LicenseId:$rootScope.userData.Id;
1708 1708 $rootScope.userStatus.tagName=tagName;
  1709 + $rootScope.userStatus.isAlreadyLoggedIn=isAlreadyLoggedIn;
  1710 + $rootScope.isAlreadyLoggedIn=true;
1709 1711 AuthenticationService.ManageUserLoginStatus($rootScope.userStatus)
1710 1712 .then(
1711 1713 function (loginStatus) {
1712 1714 if(loginStatus!=null)
1713 1715 {
1714   - $rootScope.userStatus.loginStatus = loginStatus;
1715   - $rootScope.userStatus.isAlreadyLoggedIn=true;
1716 1716 if(loginStatus=='False')
1717 1717 {
1718 1718 $rootScope.LogoutUserSession();
... ...
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
... ... @@ -392,7 +392,8 @@ export class UsersList implements OnInit, AfterViewChecked {
392 392 this._loadingService.ShowLoading("global-loading");
393 393 this.userservice.ManageUserLoginStatus({
394 394 userId: this.selectedId,
395   - tagName: 'logout'
  395 + tagName: 'logout',
  396 + isAlreadyLoggedIn:true
396 397 }).subscribe(x => {
397 398 console.log(x);
398 399 this.EditbuttonStatus=undefined;
... ...