diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 2f65ae7..59ffc5f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -42,6 +42,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.current_year = AIAConstants.current_year; // on refersh this variable will also get null that is why we are only checking this variable on initialize that if it is null that means page gets refershed. $rootScope.refreshcheck = null; + + $rootScope.isLoginAvilableModel = true; $rootScope.isCloseSettingClicked = false; @@ -158,6 +160,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.AuthenticateUser = function (userInfo) { + + alert("sdfsdf" + $rootScope.isLoginAvilableModel); if (navigator.cookieEnabled) { $rootScope.errorMessage = ""; @@ -173,6 +177,8 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic .then( function (result) { + + if (result == LoginConstants.USER_NOT_FOUND) { $rootScope.isVisibleLogin = true; // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); @@ -240,7 +246,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $("#messageModal").modal('show'); } else { - + debugger; //if (result.UserType == UserTypeConstants.SUPER_ADMIN && result.IsActive) { //(!result.IsSubscriptionExpired) && if (result.LicenseId == 0 && result.IsActive) { $rootScope.userData = result; @@ -248,7 +254,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.isVisibleLogin = false; $rootScope.haveRoleAdmin = true; localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); - ShowAssignedModulesPopup(result.Modules); + alert("first" + $rootScope.isLoginAvilableModel); + if (($rootScope.isLoginAvilableModel == true) && ($rootScope.refreshcheck == null)) + { + + ShowAssignedModulesPopup(result.Modules); + localStorage.setItem('isLoginAvilableModel',false); + } + $location.path('/'); } @@ -259,7 +272,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.isVisibleLogin = false; $rootScope.haveRoleAdmin = false; localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); - ShowAssignedModulesPopup(result.Modules); + if (($rootScope.isLoginAvilableModel) && ($rootScope.refreshcheck == null)) { + ShowAssignedModulesPopup(result.Modules); + localStorage.setItem('isLoginAvilableModel', false); + } $location.path('/'); } @@ -393,6 +409,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic function getUserDetails() { //Retain logged in user details var currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); + $rootScope.isLoginAvilableModel = $rootScope.getLocalStorageValue('isLoginAvilableModel'); if (currentUserDetails) { try { var userInfo = JSON.parse(currentUserDetails); @@ -404,12 +421,19 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.userData = userInfo; $rootScope.userModules = userInfo.Modules; - - $rootScope.isVisibleLogin = false; + userInfo["username"] = userInfo.LoginId; + userInfo["password"] = userInfo.Password; + + $rootScope.AuthenticateUser(userInfo); + // $rootScope.isVisibleLogin = false; $rootScope.haveRoleAdmin = true; if ($rootScope.refreshcheck == null) { + //setTimeout(function () { + + // $('#dvUserModulesInfo').modal('hide') + //}, 400); if ($location.path() == "/lab-exercises-detail") { $location.url('/');