Commit 5043c84fb904f4259026160d13fea86bd01e1cd4
1 parent
f725cce2
AuthenticateAlreadyLoggedInUser was not having correct coe.
Need to test on serevr
Showing
1 changed file
with
69 additions
and
52 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -499,72 +499,89 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A |
499 | 499 | |
500 | 500 | isCommingSoonModel = $rootScope.getLocalStorageValue('isCommingSoonModel'); |
501 | 501 | |
502 | - try { | |
503 | - var userInfo = JSON.parse($scope.currentUserDetails); | |
502 | + try { | |
503 | + var userInfo = JSON.parse($scope.currentUserDetails); | |
504 | 504 | |
505 | - if (userInfo.LoginId != undefined || userInfo.LoginId != "" || userInfo.LoginId != null) { | |
506 | - | |
507 | - if (userInfo.UserType == UserTypeConstants.SUPER_ADMIN && userInfo.IsActive) { | |
505 | + if (userInfo.LoginId != undefined || userInfo.LoginId != "" || userInfo.LoginId != null) { | |
508 | 506 | |
509 | - //0 | |
510 | - $rootScope.userData = userInfo; | |
511 | - $rootScope.userModules = userInfo.Modules; | |
507 | + userInfo["username"] = userInfo.LoginId; | |
508 | + userInfo["password"] = userInfo.Password; | |
512 | 509 | |
513 | - //1. | |
514 | - userInfo["username"] = userInfo.LoginId; | |
515 | - userInfo["password"] = userInfo.Password; | |
510 | + //2. | |
511 | + $rootScope.AuthenticateUser(userInfo); | |
512 | + // if (userInfo.UserType == UserTypeConstants.SUPER_ADMIN && userInfo.IsActive) { | |
516 | 513 | |
517 | - //2. | |
518 | - $rootScope.AuthenticateUser(userInfo); | |
514 | + ////0 | |
515 | + //$rootScope.userData = userInfo; | |
516 | + //$rootScope.userModules = userInfo.Modules; | |
519 | 517 | |
520 | - $rootScope.haveRoleAdmin = true; | |
521 | - | |
522 | - if ($rootScope.refreshcheck == null) { | |
523 | - | |
524 | - if ($location.path() == "/lab-exercises-detail") { | |
518 | + //1. | |
519 | + //userInfo["username"] = userInfo.LoginId; | |
520 | + //userInfo["password"] = userInfo.Password; | |
525 | 521 | |
526 | - $location.url('/'); | |
527 | - } | |
528 | - else { | |
522 | + //2. | |
523 | + // $rootScope.AuthenticateUser(userInfo); | |
529 | 524 | |
530 | - $location.path('/'); | |
531 | - } | |
532 | - $rootScope.isVisibleLogin = false; | |
533 | - } | |
534 | - | |
535 | - } | |
536 | - | |
537 | - else | |
538 | - { | |
539 | - $rootScope.haveRoleAdmin = false; | |
540 | - | |
541 | - if (userInfo.LicenseInfo.IsTermAccepted) | |
542 | - { | |
543 | - $rootScope.userData = userInfo; | |
544 | - $rootScope.userModules = userInfo.Modules; | |
545 | - $rootScope.isVisibleLogin = false; | |
546 | - | |
547 | - | |
548 | - if ($rootScope.refreshcheck == null) { | |
549 | - $location.path('/'); | |
550 | - } | |
525 | + // $rootScope.haveRoleAdmin = true; | |
526 | + | |
527 | + // if ($rootScope.refreshcheck == null) { | |
528 | + | |
529 | + // if ($location.path() == "/lab-exercises-detail") { | |
530 | + | |
531 | + // $location.url('/'); | |
532 | + // } | |
533 | + // else { | |
534 | + | |
535 | + // $location.path('/'); | |
536 | + // } | |
537 | + // $rootScope.isVisibleLogin = false; | |
538 | + // } | |
539 | + | |
540 | + // } | |
551 | 541 | |
542 | + //else | |
543 | + //{ | |
544 | + // $rootScope.haveRoleAdmin = false; | |
545 | + | |
546 | + // if (userInfo.LicenseInfo.IsTermAccepted) | |
547 | + // { | |
548 | + // $rootScope.userData = userInfo; | |
549 | + // $rootScope.userModules = userInfo.Modules; | |
550 | + // $rootScope.isVisibleLogin = false; | |
551 | + | |
552 | + | |
553 | + // if ($rootScope.refreshcheck == null) { | |
554 | + // $location.path('/'); | |
555 | + // } | |
556 | + | |
557 | + // } | |
558 | + // else { | |
559 | + // if ($('#dvTerms').length > 0) { | |
560 | + // $('#dvTerms').html(userInfo.TermsAndConditionsText); | |
561 | + // } | |
562 | + // $rootScope.isVisibleLogin = true; | |
563 | + // $('#dvTermCondition').fadeIn(); | |
564 | + // $rootScope.userData = userInfo; | |
565 | + // $rootScope.userModules = userInfo.Modules; | |
566 | + // //$rootScope.haveRoleAdmin = true; | |
567 | + // $location.path('/'); | |
568 | + // } | |
569 | + if ($rootScope.refreshcheck == null) { | |
570 | + | |
571 | + if ($location.path() == "/lab-exercises-detail") { | |
572 | + | |
573 | + $location.url('/'); | |
552 | 574 | } |
553 | 575 | else { |
554 | - if ($('#dvTerms').length > 0) { | |
555 | - $('#dvTerms').html(userInfo.TermsAndConditionsText); | |
556 | - } | |
557 | - $rootScope.isVisibleLogin = true; | |
558 | - $('#dvTermCondition').fadeIn(); | |
559 | - $rootScope.userData = userInfo; | |
560 | - $rootScope.userModules = userInfo.Modules; | |
561 | - //$rootScope.haveRoleAdmin = true; | |
576 | + | |
562 | 577 | $location.path('/'); |
563 | 578 | } |
579 | + $rootScope.isVisibleLogin = false; | |
564 | 580 | } |
565 | 581 | } |
566 | - | |
567 | - } | |
582 | + | |
583 | + | |
584 | + } | |
568 | 585 | catch (e) { |
569 | 586 | localStorage.removeItem('loggedInUserDetails'); |
570 | 587 | } | ... | ... |