Commit f2e44a4794e3a0d7f11bc318ce07d9dd5312c6c1

Authored by Birendra
1 parent dbe03d72

fix bug in modesty setting

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -697,7 +697,42 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
697 697 $rootScope.aiaPingInterval = configresult.pingInterval;
698 698 $rootScope.aiaAnimationPath = configresult.serverPath;
699 699 $rootScope.MaxOneFileSize = configresult.fileSize;
700   - AuthenticateAlreadyLoggedInUser();
  700 + var loggedInUser = JSON.parse($scope.currentUserDetails);
  701 + //incase site user login userid is 0 so then using license id
  702 + //logout site user while reload url without parameter
  703 + var userId=loggedInUser.Id==0?loggedInUser.LicenseId:loggedInUser.Id;
  704 + $scope.checkuserstatus = {
  705 + userId: userId,
  706 + tagName: loggedInUser.Id==0?'logout':'update',
  707 + isAlreadyLoggedIn:true
  708 + }
  709 +
  710 + // this case found when browser closed by user after login. after long time (after 20 min) open site again
  711 + // loggedInUserDetails contain user detail so user auto login but it is logout by
  712 + // 1.by agent job 2. or by admin section from db
  713 + // so check user session again before auto login
  714 + AuthenticationService.ManageUserLoginStatus($scope.checkuserstatus)
  715 + .then(
  716 + function (loginStatus) {
  717 + if(loginStatus!=null)
  718 + {
  719 + if(loginStatus=='False')
  720 + {
  721 + $rootScope.LogoutUserSession();
  722 + }
  723 + else
  724 + {
  725 + AuthenticateAlreadyLoggedInUser();
  726 + }
  727 + }
  728 +
  729 + }),
  730 + function (error) {
  731 + console.log(' Error in user login status = ' + error.statusText);
  732 + $rootScope.errorMessage = error;
  733 + $("#messageModal").modal('show');
  734 + }
  735 +
701 736 });
702 737  
703 738 }
... ... @@ -987,13 +1022,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
987 1022 $rootScope.haveRoleAdmin = false;
988 1023 }
989 1024  
990   -
991   - // if (result.UserTypeId == 6) {
992   - // $('#modestyDiv').css('pointerEvent', 'none');
993   - // $('#modestyDiv').css('opacity', 0.4);
994   - // $("#modestyDiv").find("*").prop('disabled', true);
995   - // }
996   -
997 1025 if (result.LicenseInfo != null) {
998 1026  
999 1027 // set license id
... ... @@ -1019,9 +1047,15 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1019 1047 $rootScope.userData = result;
1020 1048 $rootScope.userModules = result.Modules;
1021 1049  
1022   - // $("#modestyDiv").css("pointer-events", "none");
1023   - // $("#modestyDiv").css("opacity", 0.5);
1024   - //2.
  1050 + //only instructor allowed to change modesty
  1051 + //concurrent user of non-instructor
  1052 + if( result.UserTypeId == 6 && result.EditionId!=1 && result.EditionId!=2)
  1053 + {
  1054 + $("#modestyDiv").css("pointer-events", "none");
  1055 + $("#modestyDiv").css("opacity", 0.5);
  1056 + $("#modestyDiv").find("*").prop('disabled', true);
  1057 + }
  1058 +
1025 1059 localStorage.setItem('loggedInUserDetails', JSON.stringify(result));
1026 1060  
1027 1061 // 3.ShowAssignedModulesPopup
... ... @@ -1269,6 +1303,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1269 1303  
1270 1304 $rootScope.LoginDisableUI();
1271 1305 $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails');
  1306 + var sitedetail=$rootScope.siteUrlInfo;
1272 1307 ConfigurationService.getCofigValue()
1273 1308 .then(
1274 1309 function (configresult) {
... ... @@ -1282,13 +1317,13 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1282 1317 var loggedInUser = JSON.parse($scope.currentUserDetails);
1283 1318 //check already login by account number bcz no login id for site login
1284 1319 //maintain user session by licenseid of site login
1285   - if(loggedInUser!==null && loggedInUser.AccountNumber==$rootScope.siteUrlInfo.accountNumber)
  1320 + if(loggedInUser!==null && loggedInUser.AccountNumber==sitedetail.accountNumber)
1286 1321 {
1287   - $rootScope.AuthenticateClientSiteUser($rootScope.siteUrlInfo,true);
  1322 + $rootScope.AuthenticateClientSiteUser(sitedetail,true);
1288 1323 }
1289 1324 else
1290 1325 {
1291   - $rootScope.AuthenticateClientSiteUser($rootScope.siteUrlInfo,false);
  1326 + $rootScope.AuthenticateClientSiteUser(sitedetail,false);
1292 1327 }
1293 1328 });
1294 1329 }
... ... @@ -1423,6 +1458,14 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
1423 1458 else {
1424 1459 if (result.LicenseInfo != null ) {
1425 1460  
  1461 + //only site instructor allowed to change modesty
  1462 + if(result.EditionId!=1 && result.EditionId!=2)
  1463 + {
  1464 + $("#modestyDiv").css("pointer-events", "none");
  1465 + $("#modestyDiv").css("opacity", 0.5);
  1466 + $("#modestyDiv").find("*").prop('disabled', true);
  1467 + }
  1468 +
1426 1469 // set license id
1427 1470 $scope.UpdateUserExportImageData(result.Id, 'LicenseId', result.LicenseId)
1428 1471  
... ...
400-SOURCECODE/Admin/src/app/shared/global.ts
... ... @@ -46,7 +46,7 @@ export class GlobalService {
46 46  
47 47 this.NoRecords = 'No Record Found.';
48 48  
49   - this.hostURL = "http://192.168.81.63:92/API/Adminapi/";//Birendra Machine IP
  49 + this.hostURL = "http://192.168.43.9/API/Adminapi/";//Birendra Machine IP
50 50 this.LiveAPIURL = "http://interactiveanatomy.com/API/Adminapi/";
51 51 this.QAAPIURL = "http://qa.beta.interactiveanatomy.com/API/Adminapi/";
52 52 this.LocalURL = "http://localhost:4200";
... ... @@ -67,7 +67,7 @@ export class GlobalService {
67 67  
68 68 }
69 69  
70   - if (this.resourceBaseUrl == this.ProtocolType+"192.168.81.63:92/API/Adminapi/") {
  70 + if (this.resourceBaseUrl == this.ProtocolType+"192.168.43.9/API/Adminapi/") {
71 71 if(window.location.hostname=="localhost")
72 72 {
73 73 // for 'ng serve --open' command
... ...
400-SOURCECODE/Admin/src/assets/styles/bootstrap.css
... ... @@ -1325,13 +1325,13 @@ pre code {
1325 1325 width: 50%;
1326 1326 }
1327 1327 .col-lg-5 {
1328   - width: 45.66666667%;
  1328 + width: 50.66666667%;
1329 1329 }
1330 1330 .col-lg-4 {
1331 1331 width: 33.33333333%;
1332 1332 }
1333 1333 .col-lg-3 {
1334   - width: 25%;
  1334 + width: 27%;
1335 1335 }
1336 1336 .col-lg-2 {
1337 1337 width: 16.66666667%;
... ...