From 3ae973087cebbba6d7f9bedfce5630a6cdca1d43 Mon Sep 17 00:00:00 2001 From: nikita Date: Thu, 11 Oct 2018 17:04:15 +0530 Subject: [PATCH] integrated anatomy test added code for site url if site url user goes to Flex CB/anatomyTest via AIAHTML5 --- 400-SOURCECODE/AIAHTML5.API/Controllers/ClientController.cs | 3 +++ 400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js | 51 ++++++++++++++++++++++++++++++++++++++++++++------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 11 ++++++++--- 400-SOURCECODE/AIAHTML5.Web/app/views/AnatTest/AnatTest-view.html | 4 +++- 5 files changed, 108 insertions(+), 11 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/ClientController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/ClientController.cs index 4209f1e..6a250da 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/ClientController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/ClientController.cs @@ -46,7 +46,10 @@ namespace AIAHTML5.API.Controllers { dynamic uerinfo = AIAHTML5.API.Models.Users.ValidateSiteLogin(siteUrl["siteIP"].ToString(), siteUrl["accountNumber"].ToString(), siteUrl["urlReferer"].ToString(), siteUrl["edition"].ToString(), siteId); if (uerinfo != null) + { + uerinfo.siteId = siteId; response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(JsonConvert.SerializeObject(uerinfo)) }; + } else { //ser user = new User(); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js index f6ef555..9c577d4 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js @@ -11,7 +11,57 @@ function ($scope, $rootScope, pages, log, $location) { $("html,body").scrollTop(0); //alert("scroll"); } + $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"); + + 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=8'); + + } + 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); + + + + //window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + 'mod=8'); + + } + } + else { + 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=8'); + + } + } $scope.$on('$viewContentLoaded', function (event) { // code that will be executed ... diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 1b3231f..0a47ccc 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -19,18 +19,55 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location) { } $scope.openAIAFlexCB = function () { - var userInfo = ($rootScope.userData); + 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) { - var encryptedUserName = CryptoJS.AES.encrypt(userInfo.LoginId, key, { iv: iv }); - var encryptedPassword = CryptoJS.AES.encrypt(userInfo.Password, key, { iv: iv }); + 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('/'); + $location.url('/'); - window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword); + 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 { + 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'); + + } + + + + } //load json data diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index bd78b97..827400d 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -447,11 +447,16 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $scope.ValidateClientSiteUrl = function () { - debugger + $rootScope.isCallFromSite = true; + var siteInfo = params.split('&'); for (var i = 0; i < siteInfo.length; i++) { - debugger; + + if (isCalsCredantialForSIte) { + $rootScope.IsCalsCred = true; + } + if (isCalsCredantialForSIte == "True") { var paramInfo = siteInfo[i].split('='); if (paramInfo[0] == 'calsCredantial') { @@ -596,7 +601,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A //code for modesty setting - + $rootscope.siteId = result.siteId; //LicenseId would be zero for admin that is why we set the haveRoleAdmin = true if (result.LicenseId == 0) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/AnatTest/AnatTest-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/AnatTest/AnatTest-view.html index 0d3d86a..d78c8dd 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/AnatTest/AnatTest-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/AnatTest/AnatTest-view.html @@ -1,4 +1,4 @@ -
+ +
\ No newline at end of file -- libgit2 0.21.4