From 6e4a2c2ad0d8cd51c4e96838281aedc408ecf328 Mon Sep 17 00:00:00 2001 From: nikita Date: Fri, 23 Nov 2018 13:28:37 +0530 Subject: [PATCH] now client site url users can access CB and Anatomy test of old AIA from new AIA --- 400-SOURCECODE/AIAHTML5.API/Controllers/ClientController.cs | 5 +++-- 400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs | 1 + 400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js | 47 ++++++++++++++++++++++++++++------------------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------- 4 files changed, 137 insertions(+), 40 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/ClientController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/ClientController.cs index 6a250da..aa23a95 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/ClientController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/ClientController.cs @@ -56,13 +56,14 @@ namespace AIAHTML5.API.Controllers //user.LoginFailureCauseId = AIAConstants.INVALID_CLIENT; //dynamic userinfo = user; //response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userInfo) }; - + logger.Debug("IVALID CLIENT"); response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.INVALID_CLIENT) }; } } else { + logger.Debug("NOT AUTHORIZED"); response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.MSG_NOT_AUTHORIZE_SITE_USER) }; } @@ -73,7 +74,7 @@ namespace AIAHTML5.API.Controllers response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = null }; } - + logger.Debug("response = " + response); return response; } catch (SqlException e) diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index ace28ee..82bcac7 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -302,6 +302,7 @@ namespace AIAHTML5.API.Models objUser.UserTypeId = Convert.ToInt32(dr["UserTypeId"]); objUser.UserType = objModel.GetUserTypeStringById(Convert.ToInt32(dr["UserTypeId"])); objUser.IsActive = Convert.ToBoolean(dr["IsActive"]); + logger.Debug("objUser.Id= " + objUser.Id + ",objUser.FirstName= " + objUser.FirstName + ",objUser.LoginId= " + objUser.LoginId + ",objUser.Password= " + objUser.Password + ",objUser.SecurityQuestionId= " + objUser.SecurityQuestionId); } } } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js index 41f0974..3b71e9d 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js @@ -12,14 +12,19 @@ function ($scope, $rootScope, pages, log, $location) { //alert("scroll"); } //open flex - $scope.openAIAFlexAnatomyTest = function () { + + + + + + $scope.openAIAFlexAnatomyTest = function () { var userInfo; var encryptedUserName; var encryptedPassword var urlPrams; - var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OAXUD"); - var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHwXUD"); + var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OA"); + var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHw"); if ($rootScope.isCallFromSite) { @@ -34,21 +39,25 @@ function ($scope, $rootScope, pages, log, $location) { } else { - $location.url('/'); - - var encryptedSiteIP = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.siteIP, key, { iv: iv }); - var encryptedAccountNumber = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.accountNumber, key, { iv: iv }); - var encryptedEdition = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.edition, key, { iv: iv }); - var encryptedUrlReferer = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.urlReferer, key, { iv: iv }); - var encryptedRemoteIPAddress = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.remoteIPAddress, key, { iv: iv }); - var encryptedSiteId = CryptoJS.AES.encrypt($rootscope.siteId, key, { iv: iv }); - - - window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + '&mod=7' + '&s=' + encryptedSiteId); - + var siteUrlInfo = JSON.parse(localStorage.getItem("siteUrlInfo")); + var encryptedSiteIP = CryptoJS.AES.encrypt(siteUrlInfo.siteIP, key, { iv: iv }); + var encryptedAccountNumber = CryptoJS.AES.encrypt(siteUrlInfo.accountNumber, key, { iv: iv }); + var encryptedEdition = siteUrlInfo.edition; + var encryptedUrlReferer = CryptoJS.AES.encrypt(siteUrlInfo.urlReferer, key, { iv: iv }); + var encryptedSiteId = $rootScope.siteId; + var encryptedRemoteIPAddress = CryptoJS.AES.encrypt(siteUrlInfo.remoteIPAddress, key, { iv: iv }); + + console.log("encryptedSiteIP = " + encryptedSiteIP + ",encryptedAccountNumber= " + encryptedAccountNumber + ",encryptedEdition= " + encryptedEdition + ",encryptedUrlReferer= " + encryptedUrlReferer + ", encryptedSiteId= " + encryptedSiteId + ", encryptedRemoteIPAddress=" + encryptedRemoteIPAddress); + /* var encryptedSiteIP = CryptoJS.AES.encrypt(siteIp, key, { iv: iv }); + var encryptedAccountNumber = CryptoJS.AES.encrypt(accountNo, key, { iv: iv }); + var encryptedEdition = editionId;//CryptoJS.AES.encrypt($rootScope.siteUrlInfo.edition, key, { iv: iv }); + var encryptedUrlReferer = urlRef ; + var encryptedRemoteIPAddress = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.remoteIPAddress, key, { iv: iv }); + var encryptedSiteId = $rootscope.siteId;*/ + $location.url('/'); - //window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + 'mod=8'); + window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + '&mod=8' + '&s=' + encryptedSiteId); } } @@ -59,12 +68,12 @@ function ($scope, $rootScope, pages, log, $location) { $location.url('/'); - window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + 'mod=8'); + window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=8'); } } $scope.$on('$viewContentLoaded', function (event) { - + // code that will be executed ... // every time this view is loaded @@ -80,7 +89,7 @@ function ($scope, $rootScope, pages, log, $location) { }) }) - // $rootScope.currentActiveModuleTitle = pages[7].name; + // $rootScope.currentActiveModuleTitle = pages[7].name; }] ); \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index df3e77e..6f3eee8 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -1,7 +1,7 @@ AIA.controller("CurrBuildController", ["$scope", "$rootScope", "pages", "$log", "Modules", "$http", "$compile", "$location", function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location) { - - // $rootScope.currentActiveModuleTitle = pages[6].name; + + // $rootScope.currentActiveModuleTitle = pages[6].name; $scope.showTabButton = false; $scope.listCurriculumBuilder = null; $scope.dataPopup = null; @@ -18,14 +18,95 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location) { //alert("scroll"); } + /* $scope.openAIAFlexCB = function () { + var userInfo; + var encryptedUserName; + var encryptedPassword + var urlPrams; + + var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OA"); + + var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHw"); + + + userInfo = ($rootScope.userData); + console.log("userInfo.LoginId= "+userInfo.LoginId+" and userInfo.Password = " +userInfo.pwd ); + var encryptedUserName = CryptoJS.AES.encrypt(userInfo.LoginId, key, { iv: iv }); + var encryptedPassword = CryptoJS.AES.encrypt(userInfo.pwd, key, { iv: iv }); + console.log("encryptedUserName= "+encryptedUserName+" and encryptedPassword= "+encryptedPassword); + + + var decryptedUserName = (CryptoJS.AES.decrypt(encryptedUserName, key, { iv: iv })).toString(CryptoJS.enc.Utf8); + var decryptedPassword = (CryptoJS.AES.decrypt(encryptedPassword, key, { iv: iv })).toString(CryptoJS.enc.Utf8); + console.log("decryptedUserName="+decryptedUserName+",decryptedPassword="+decryptedPassword); + + $location.url('/'); + + window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword+'&mod=7'); + + + /* if ($rootScope.isCallFromSite) { + + if ($rootScope.IsCalsCred) { + encryptedUserName = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.username, key, { iv: iv }); + encryptedPassword = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.password, key, { iv: iv }); + + $location.url('/'); + + window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=7'); + + } + else { + + $location.url('/'); + + var encryptedSiteIP = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.siteIP, key, { iv: iv }); + var encryptedAccountNumber = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.accountNumber, key, { iv: iv }); + var encryptedEdition = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.edition, key, { iv: iv }); + var encryptedUrlReferer = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.urlReferer, key, { iv: iv }); + var encryptedRemoteIPAddress = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.remoteIPAddress, key, { iv: iv }); + var encryptedSiteId = CryptoJS.AES.encrypt($rootscope.siteId, key, { iv: iv }); + + + window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + '&mod=7' + '&s=' + encryptedSiteId); + + } + } + else { + + // var userInfo = ($rootScope.userData); + + + // var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OA"); + // var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHw"); + + // var encryptedUserName = CryptoJS.AES.encrypt(userInfo.LoginId, key, { iv: iv }); + // var encryptedPassword = CryptoJS.AES.encrypt(userInfo.Password, key, { iv: iv }); + + + userInfo = ($rootScope.userData); + var encryptedUserName = CryptoJS.AES.encrypt(userInfo.LoginId, key, { iv: iv }); + var encryptedPassword = CryptoJS.AES.encrypt(userInfo.Password, key, { iv: iv }); + + $location.url('/'); + + window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword+'&mod=7'); + + }*/ + + + + + + //}*/ $scope.openAIAFlexCB = function () { var userInfo; var encryptedUserName; var encryptedPassword var urlPrams; - var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OAXUD"); - var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHwXUD"); + var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OA"); + var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHw"); if ($rootScope.isCallFromSite) { @@ -40,15 +121,23 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location) { } else { - $location.url('/'); + var siteUrlInfo = JSON.parse(localStorage.getItem("siteUrlInfo")); + var encryptedSiteIP = CryptoJS.AES.encrypt(siteUrlInfo.siteIP, key, { iv: iv }); + var encryptedAccountNumber = CryptoJS.AES.encrypt(siteUrlInfo.accountNumber, key, { iv: iv }); + var encryptedEdition = siteUrlInfo.edition; + var encryptedUrlReferer = CryptoJS.AES.encrypt(siteUrlInfo.urlReferer, key, { iv: iv }); + var encryptedSiteId = $rootScope.siteId; + var encryptedRemoteIPAddress = CryptoJS.AES.encrypt(siteUrlInfo.remoteIPAddress, key, { iv: iv }); + + console.log("encryptedSiteIP = " + encryptedSiteIP + ",encryptedAccountNumber= " + encryptedAccountNumber + ",encryptedEdition= " + encryptedEdition + ",encryptedUrlReferer= " + encryptedUrlReferer + ", encryptedSiteId= " + encryptedSiteId + ", encryptedRemoteIPAddress=" + encryptedRemoteIPAddress); + /* var encryptedSiteIP = CryptoJS.AES.encrypt(siteIp, key, { iv: iv }); + var encryptedAccountNumber = CryptoJS.AES.encrypt(accountNo, key, { iv: iv }); + var encryptedEdition = editionId;//CryptoJS.AES.encrypt($rootScope.siteUrlInfo.edition, key, { iv: iv }); + var encryptedUrlReferer = urlRef ; + var encryptedRemoteIPAddress = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.remoteIPAddress, key, { iv: iv }); + var encryptedSiteId = $rootscope.siteId;*/ - var encryptedSiteIP = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.siteIP, key, { iv: iv }); - var encryptedAccountNumber = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.accountNumber, key, { iv: iv }); - var encryptedEdition = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.edition, key, { iv: iv }); - var encryptedUrlReferer = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.urlReferer, key, { iv: iv }); - var encryptedRemoteIPAddress = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.remoteIPAddress, key, { iv: iv }); - var encryptedSiteId = CryptoJS.AES.encrypt($rootscope.siteId, key, { iv: iv }); - + $location.url('/'); window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + '&mod=7' + '&s=' + encryptedSiteId); @@ -61,15 +150,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location) { $location.url('/'); - window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword+'mod=7'); + window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=7'); } - - - - - } + //load json data $scope.loadCurriculumBuiderData = function () { @@ -126,7 +211,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location) { $scope.loadSlideShowXmldata = function (e) { - // alert(e); + // alert(e); $http({ method: 'GET', url: 'content/data/json/cb/SlideShow/AIA_Curriculum_Builder_Guide.sldshw' }).success(function (data) { $scope.dataPopup = data; @@ -136,6 +221,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location) { console.log(data); }); } + }] -- libgit2 0.21.4