diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 04e0f4a..5cb9464 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -697,7 +697,42 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.aiaPingInterval = configresult.pingInterval; $rootScope.aiaAnimationPath = configresult.serverPath; $rootScope.MaxOneFileSize = configresult.fileSize; - AuthenticateAlreadyLoggedInUser(); + var loggedInUser = JSON.parse($scope.currentUserDetails); + //incase site user login userid is 0 so then using license id + //logout site user while reload url without parameter + var userId=loggedInUser.Id==0?loggedInUser.LicenseId:loggedInUser.Id; + $scope.checkuserstatus = { + userId: userId, + tagName: loggedInUser.Id==0?'logout':'update', + isAlreadyLoggedIn:true + } + + // this case found when browser closed by user after login. after long time (after 20 min) open site again + // loggedInUserDetails contain user detail so user auto login but it is logout by + // 1.by agent job 2. or by admin section from db + // so check user session again before auto login + AuthenticationService.ManageUserLoginStatus($scope.checkuserstatus) + .then( + function (loginStatus) { + if(loginStatus!=null) + { + if(loginStatus=='False') + { + $rootScope.LogoutUserSession(); + } + else + { + AuthenticateAlreadyLoggedInUser(); + } + } + + }), + function (error) { + console.log(' Error in user login status = ' + error.statusText); + $rootScope.errorMessage = error; + $("#messageModal").modal('show'); + } + }); } @@ -987,13 +1022,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.haveRoleAdmin = false; } - - // if (result.UserTypeId == 6) { - // $('#modestyDiv').css('pointerEvent', 'none'); - // $('#modestyDiv').css('opacity', 0.4); - // $("#modestyDiv").find("*").prop('disabled', true); - // } - if (result.LicenseInfo != null) { // set license id @@ -1019,9 +1047,15 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.userData = result; $rootScope.userModules = result.Modules; - // $("#modestyDiv").css("pointer-events", "none"); - // $("#modestyDiv").css("opacity", 0.5); - //2. + //only instructor allowed to change modesty + //concurrent user of non-instructor + if( result.UserTypeId == 6 && result.EditionId!=1 && result.EditionId!=2) + { + $("#modestyDiv").css("pointer-events", "none"); + $("#modestyDiv").css("opacity", 0.5); + $("#modestyDiv").find("*").prop('disabled', true); + } + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); // 3.ShowAssignedModulesPopup @@ -1269,6 +1303,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.LoginDisableUI(); $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); + var sitedetail=$rootScope.siteUrlInfo; ConfigurationService.getCofigValue() .then( function (configresult) { @@ -1282,13 +1317,13 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data var loggedInUser = JSON.parse($scope.currentUserDetails); //check already login by account number bcz no login id for site login //maintain user session by licenseid of site login - if(loggedInUser!==null && loggedInUser.AccountNumber==$rootScope.siteUrlInfo.accountNumber) + if(loggedInUser!==null && loggedInUser.AccountNumber==sitedetail.accountNumber) { - $rootScope.AuthenticateClientSiteUser($rootScope.siteUrlInfo,true); + $rootScope.AuthenticateClientSiteUser(sitedetail,true); } else { - $rootScope.AuthenticateClientSiteUser($rootScope.siteUrlInfo,false); + $rootScope.AuthenticateClientSiteUser(sitedetail,false); } }); } @@ -1423,6 +1458,14 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data else { if (result.LicenseInfo != null ) { + //only site instructor allowed to change modesty + if(result.EditionId!=1 && result.EditionId!=2) + { + $("#modestyDiv").css("pointer-events", "none"); + $("#modestyDiv").css("opacity", 0.5); + $("#modestyDiv").find("*").prop('disabled', true); + } + // set license id $scope.UpdateUserExportImageData(result.Id, 'LicenseId', result.LicenseId) diff --git a/400-SOURCECODE/Admin/src/app/shared/global.ts b/400-SOURCECODE/Admin/src/app/shared/global.ts index a759929..e7eab93 100644 --- a/400-SOURCECODE/Admin/src/app/shared/global.ts +++ b/400-SOURCECODE/Admin/src/app/shared/global.ts @@ -46,7 +46,7 @@ export class GlobalService { this.NoRecords = 'No Record Found.'; - this.hostURL = "http://192.168.81.63:92/API/Adminapi/";//Birendra Machine IP + this.hostURL = "http://192.168.43.9/API/Adminapi/";//Birendra Machine IP this.LiveAPIURL = "http://interactiveanatomy.com/API/Adminapi/"; this.QAAPIURL = "http://qa.beta.interactiveanatomy.com/API/Adminapi/"; this.LocalURL = "http://localhost:4200"; @@ -67,7 +67,7 @@ export class GlobalService { } - if (this.resourceBaseUrl == this.ProtocolType+"192.168.81.63:92/API/Adminapi/") { + if (this.resourceBaseUrl == this.ProtocolType+"192.168.43.9/API/Adminapi/") { if(window.location.hostname=="localhost") { // for 'ng serve --open' command diff --git a/400-SOURCECODE/Admin/src/assets/styles/bootstrap.css b/400-SOURCECODE/Admin/src/assets/styles/bootstrap.css index d552a44..3f4d1b6 100644 --- a/400-SOURCECODE/Admin/src/assets/styles/bootstrap.css +++ b/400-SOURCECODE/Admin/src/assets/styles/bootstrap.css @@ -1325,13 +1325,13 @@ pre code { width: 50%; } .col-lg-5 { - width: 45.66666667%; + width: 50.66666667%; } .col-lg-4 { width: 33.33333333%; } .col-lg-3 { - width: 25%; + width: 27%; } .col-lg-2 { width: 16.66666667%;