diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index f832254..45f641c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -119,6 +119,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic if (url.indexOf('?unb:') != -1) { + $rootScope.isVisibleLogin = true; $rootScope.UnblockUser(); } else if (url.indexOf('?em:') != -1) { @@ -352,29 +353,47 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic var userInfo = JSON.parse(currentUserDetails); if (userInfo.LoginId != undefined || userInfo.LoginId != "" || userInfo.LoginId != null) { - if (userInfo.LicenseInfo.IsTermAccepted) { + + if (userInfo.UserType == UserTypeConstants.SUPER_ADMIN || userInfo.UserType == UserTypeConstants.GENERAL_ADMIN && result.IsActive) { //(!result.IsSubscriptionExpired) && + $rootScope.userData = userInfo; + $rootScope.userModules = userInfo.Modules; + $rootScope.isVisibleLogin = false; - //$rootScope.haveRoleAdmin = true; - $rootScope.licenseeAccountNumber = userInfo.LicenseInfo.AccountNumber; + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } - } - else { - if ($('#dvTerms').length > 0) { - $('#dvTerms').html(userInfo.TermsOfServiceText); + + else + { + if (userInfo.LicenseInfo.IsTermAccepted) { + $rootScope.userData = userInfo; + $rootScope.userModules = userInfo.Modules; + $rootScope.isVisibleLogin = false; + //$rootScope.haveRoleAdmin = true; + + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } + + } + else { + if ($('#dvTerms').length > 0) { + $('#dvTerms').html(userInfo.TermsAndConditionsText); + } + $rootScope.isVisibleLogin = true; + $('#dvTermCondition').fadeIn(); + $rootScope.userData = userInfo; + $rootScope.userModules = userInfo.Modules; + //$rootScope.haveRoleAdmin = true; + $location.path('/'); } - $rootScope.isVisibleLogin = true; - $('#dvTermCondition').fadeIn(); - $rootScope.userData = userInfo; - $rootScope.userModules = userInfo.Modules; - //$rootScope.haveRoleAdmin = true; - $rootScope.licenseeAccountNumber = userInfo.LicenseInfo.AccountNumber; - $location.path('/'); } } } @@ -580,7 +599,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } }, function (error) { - console.log(' Error in authentication = ' + error.statusText); + console.log(' Error in UnblockUser = ' + error.statusText); $rootScope.errorMessage = error; $("#messageModal").modal('show'); } diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index ea9870a..d80869a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -230,7 +230,7 @@