Merged
Merge Request #928 · created by Nikita Kulshreshtha


AuthenticateAlreadyLoggedInUser was not having correct coe.

Need to test on serevr


From Bug#33895 into Develop

Merged by Nikita Kulshreshtha

1 participants

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -499,72 +499,33 @@ 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) {
508   -
509   - //0
510   - $rootScope.userData = userInfo;
511   - $rootScope.userModules = userInfo.Modules;
512   -
513   - //1.
514   - userInfo["username"] = userInfo.LoginId;
515   - userInfo["password"] = userInfo.Password;
  505 + if (userInfo.LoginId != undefined || userInfo.LoginId != "" || userInfo.LoginId != null) {
516 506  
517   - //2.
518   - $rootScope.AuthenticateUser(userInfo);
  507 + userInfo["username"] = userInfo.LoginId;
  508 + userInfo["password"] = userInfo.Password;
519 509  
520   - $rootScope.haveRoleAdmin = true;
521   -
522   - if ($rootScope.refreshcheck == null) {
523   -
524   - if ($location.path() == "/lab-exercises-detail") {
  510 +
  511 + $rootScope.AuthenticateUser(userInfo);
  512 +
  513 + if ($rootScope.refreshcheck == null) {
525 514  
526   - $location.url('/');
527   - }
528   - else {
529   -
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   - }
  515 + if ($location.path() == "/lab-exercises-detail") {
551 516  
  517 + $location.url('/');
552 518 }
553 519 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;
  520 +
562 521 $location.path('/');
563 522 }
  523 + $rootScope.isVisibleLogin = false;
564 524 }
565 525 }
566   -
567   - }
  526 +
  527 +
  528 + }
568 529 catch (e) {
569 530 localStorage.removeItem('loggedInUserDetails');
570 531 }
... ...