Commit 3ae973087cebbba6d7f9bedfce5630a6cdca1d43

Authored by Nikita Kulshreshtha
1 parent a1712725

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
... ... @@ -46,7 +46,10 @@ namespace AIAHTML5.API.Controllers
46 46 {
47 47 dynamic uerinfo = AIAHTML5.API.Models.Users.ValidateSiteLogin(siteUrl["siteIP"].ToString(), siteUrl["accountNumber"].ToString(), siteUrl["urlReferer"].ToString(), siteUrl["edition"].ToString(), siteId);
48 48 if (uerinfo != null)
  49 + {
  50 + uerinfo.siteId = siteId;
49 51 response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(JsonConvert.SerializeObject(uerinfo)) };
  52 + }
50 53 else
51 54 {
52 55 //ser user = new User();
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js
... ... @@ -11,7 +11,57 @@ function ($scope, $rootScope, pages, log, $location) {
11 11 $("html,body").scrollTop(0);
12 12 //alert("scroll");
13 13 }
  14 + $scope.openAIAFlexAnatomyTest = function () {
  15 + var userInfo;
  16 + var encryptedUserName;
  17 + var encryptedPassword
  18 + var urlPrams;
14 19  
  20 + var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OAXUD");
  21 + var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHwXUD");
  22 +
  23 + if ($rootScope.isCallFromSite) {
  24 +
  25 + if ($rootScope.IsCalsCred) {
  26 + encryptedUserName = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.username, key, { iv: iv });
  27 + encryptedPassword = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.password, key, { iv: iv });
  28 +
  29 + $location.url('/');
  30 +
  31 + window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + 'mod=8');
  32 +
  33 + }
  34 + else {
  35 +
  36 + $location.url('/');
  37 +
  38 + var encryptedSiteIP = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.siteIP, key, { iv: iv });
  39 + var encryptedAccountNumber = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.accountNumber, key, { iv: iv });
  40 + var encryptedEdition = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.edition, key, { iv: iv });
  41 + var encryptedUrlReferer = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.urlReferer, key, { iv: iv });
  42 + var encryptedRemoteIPAddress = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.remoteIPAddress, key, { iv: iv });
  43 + var encryptedSiteId = CryptoJS.AES.encrypt($rootscope.siteId, key, { iv: iv });
  44 +
  45 +
  46 + window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + 'mod=7' + '&s=' + encryptedSiteId);
  47 +
  48 +
  49 +
  50 + //window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + 'mod=8');
  51 +
  52 + }
  53 + }
  54 + else {
  55 + userInfo = ($rootScope.userData);
  56 + var encryptedUserName = CryptoJS.AES.encrypt(userInfo.LoginId, key, { iv: iv });
  57 + var encryptedPassword = CryptoJS.AES.encrypt(userInfo.Password, key, { iv: iv });
  58 +
  59 + $location.url('/');
  60 +
  61 + window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + 'mod=8');
  62 +
  63 + }
  64 + }
15 65 $scope.$on('$viewContentLoaded', function (event) {
16 66  
17 67 // code that will be executed ...
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
... ... @@ -19,18 +19,55 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location) {
19 19 }
20 20  
21 21 $scope.openAIAFlexCB = function () {
22   - var userInfo = ($rootScope.userData);
  22 + var userInfo;
  23 + var encryptedUserName;
  24 + var encryptedPassword
  25 + var urlPrams;
23 26  
  27 + var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OAXUD");
  28 + var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHwXUD");
24 29  
25   - var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OA");
26   - var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHw");
  30 + if ($rootScope.isCallFromSite) {
27 31  
28   - var encryptedUserName = CryptoJS.AES.encrypt(userInfo.LoginId, key, { iv: iv });
29   - var encryptedPassword = CryptoJS.AES.encrypt(userInfo.Password, key, { iv: iv });
  32 + if ($rootScope.IsCalsCred) {
  33 + encryptedUserName = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.username, key, { iv: iv });
  34 + encryptedPassword = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.password, key, { iv: iv });
30 35  
31   - $location.url('/');
  36 + $location.url('/');
32 37  
33   - window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword);
  38 + window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + 'mod=7');
  39 +
  40 + }
  41 + else {
  42 +
  43 + $location.url('/');
  44 +
  45 + var encryptedSiteIP = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.siteIP, key, { iv: iv });
  46 + var encryptedAccountNumber = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.accountNumber, key, { iv: iv });
  47 + var encryptedEdition = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.edition, key, { iv: iv });
  48 + var encryptedUrlReferer = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.urlReferer, key, { iv: iv });
  49 + var encryptedRemoteIPAddress = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.remoteIPAddress, key, { iv: iv });
  50 + var encryptedSiteId = CryptoJS.AES.encrypt($rootscope.siteId, key, { iv: iv });
  51 +
  52 +
  53 + window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + 'mod=7' + '&s=' + encryptedSiteId);
  54 +
  55 + }
  56 + }
  57 + else {
  58 + userInfo = ($rootScope.userData);
  59 + var encryptedUserName = CryptoJS.AES.encrypt(userInfo.LoginId, key, { iv: iv });
  60 + var encryptedPassword = CryptoJS.AES.encrypt(userInfo.Password, key, { iv: iv });
  61 +
  62 + $location.url('/');
  63 +
  64 + window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword+'mod=7');
  65 +
  66 + }
  67 +
  68 +
  69 +
  70 +
34 71  
35 72 }
36 73 //load json data
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -447,11 +447,16 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A
447 447  
448 448 $scope.ValidateClientSiteUrl = function () {
449 449  
450   - debugger
  450 + $rootScope.isCallFromSite = true;
  451 +
451 452 var siteInfo = params.split('&');
452 453  
453 454 for (var i = 0; i < siteInfo.length; i++) {
454   - debugger;
  455 +
  456 + if (isCalsCredantialForSIte) {
  457 + $rootScope.IsCalsCred = true;
  458 + }
  459 +
455 460 if (isCalsCredantialForSIte == "True") {
456 461 var paramInfo = siteInfo[i].split('=');
457 462 if (paramInfo[0] == 'calsCredantial') {
... ... @@ -596,7 +601,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A
596 601 //code for modesty setting
597 602  
598 603  
599   -
  604 + $rootscope.siteId = result.siteId;
600 605  
601 606 //LicenseId would be zero for admin that is why we set the haveRoleAdmin = true
602 607 if (result.LicenseId == 0) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/AnatTest/AnatTest-view.html
1   -<div class="bodyWrap row ">
  1 +<!--<div class="bodyWrap row ">
2 2 <div ng-include="'app/widget/MainMenu.html'" />
3 3 <div class="main mCustomScrollbar _mCS_1 mCS-autoHide">
4 4  
... ... @@ -81,3 +81,5 @@
81 81 </div>
82 82 </div>
83 83  
  84 + -->
  85 +<div id="anatTest" ng-init="openAIAFlexAnatomyTest()" />
84 86 \ No newline at end of file
... ...