Commit 3e67cc40a178ef66086517ceb16543227de54210
1 parent
24f9a93e
add CA url login to AIA
Showing
16 changed files
with
675 additions
and
142 deletions
400-SOURCECODE/AIAHTML5.API/AIAHTML5.API.csproj
... | ... | @@ -128,6 +128,7 @@ |
128 | 128 | <Compile Include="Controllers\PixelLocationsController.cs" /> |
129 | 129 | <Compile Include="Controllers\ResetPasswordController.cs" /> |
130 | 130 | <Compile Include="Controllers\UnblockUserController.cs" /> |
131 | + <Compile Include="Controllers\UrlLoginController.cs" /> | |
131 | 132 | <Compile Include="Global.asax.cs"> |
132 | 133 | <DependentUpon>Global.asax</DependentUpon> |
133 | 134 | </Compile> | ... | ... |
400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs
... | ... | @@ -51,6 +51,8 @@ namespace AIAHTML5.API.Constants |
51 | 51 | public const string INVALID_CLIENT = "InValid Client."; |
52 | 52 | public const string MSG_NOT_AUTHORIZE_SITE_USER = "User is not authorized."; |
53 | 53 | public const string SETTINGS_SAVE_FAILURE = "We are unable to save your Settings. Please try again."; |
54 | + public const string INVALID_URL = "InValid URL. Please try again."; | |
55 | + public const string INVALID_LOGIN = "InValid Login."; | |
54 | 56 | |
55 | 57 | public const string STATUS_OK = "ok"; |
56 | 58 | public const string STATUS_NOT_OK = "notok"; | ... | ... |
400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs
... | ... | @@ -45,5 +45,7 @@ namespace AIAHTML5.API.Constants |
45 | 45 | public const string GET_AOD_AUTHENTICATION_STATUS = "usp_AodAuthenticationStatus"; |
46 | 46 | public const string INSERT_SITE_LOGIN_LOG = "usp_InsertSiteLoginLog"; |
47 | 47 | public const string GET_AOD_COURSE_ITEMS = "GetSelectedCoursesToLicense"; |
48 | + public const string GET_LOGIN_BY_URL = "usp_GetLoginByUrl"; | |
49 | + public const string GET_STUDENT_EDITION = "usp_GetEditionByLicenseId"; | |
48 | 50 | } |
49 | 51 | } |
50 | 52 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
... | ... | @@ -335,12 +335,12 @@ namespace AIAHTML5.API.Controllers |
335 | 335 | else |
336 | 336 | { |
337 | 337 | //check Modesty settings for this license |
338 | - | |
339 | 338 | userInfo.IsModestyOn = AIAHTML5.API.Models.Users.IsModestyActiveForThisLicense(userInfo.LicenseId, Convert.ToInt16(userInfo.EditionId)); |
340 | - | |
341 | 339 | } |
342 | - } | |
343 | 340 | |
341 | + // add editon number for provide CA link | |
342 | + userInfo.StudentEdition = AIAHTML5.API.Models.Users.GetStudentEdition(userInfo.LicenseId); | |
343 | + } | |
344 | 344 | else |
345 | 345 | { |
346 | 346 | ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); |
... | ... | @@ -497,6 +497,7 @@ namespace AIAHTML5.API.Controllers |
497 | 497 | [Route("api/ByPassLoginToOpenModule")] |
498 | 498 | public HttpResponseMessage ByPassLoginToOpenModule([FromBody]JObject sitedetail) |
499 | 499 | { |
500 | + // note:created new UrlLoginController for bypass login | |
500 | 501 | dynamic responseData; |
501 | 502 | BypassLogin objUser = null; |
502 | 503 | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/UrlLoginController.cs
0 → 100644
1 | +using AIAHTML5.API.Constants; | |
2 | +using System; | |
3 | +using System.Collections.Generic; | |
4 | +using System.Linq; | |
5 | +using System.Net; | |
6 | +using System.Net.Http; | |
7 | +using System.Web.Http; | |
8 | +using AIAHTML5.API.Models; | |
9 | +using Newtonsoft.Json.Linq; | |
10 | +using System.Data.SqlClient; | |
11 | +using System.Collections; | |
12 | +using log4net; | |
13 | +using Newtonsoft.Json; | |
14 | +using System.Data; | |
15 | + | |
16 | +namespace AIAHTML5.API.Controllers | |
17 | +{ | |
18 | + public class UrlLoginController : ApiController | |
19 | + { | |
20 | + // POST api/UrlLogin | |
21 | + public HttpResponseMessage Post([FromBody]JObject loginUrl) | |
22 | + { | |
23 | + ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); | |
24 | + logger.Debug("inside POST in UrlLoginController"); | |
25 | + try{ | |
26 | + HttpResponseMessage response = null; | |
27 | + if (loginUrl != null) | |
28 | + { | |
29 | + if (!string.IsNullOrEmpty(loginUrl["accountNumber"].ToString()) && !string.IsNullOrEmpty(loginUrl["edition"].ToString())) | |
30 | + { | |
31 | + var EditionId = Convert.ToInt32(loginUrl["edition"].ToString()); | |
32 | + var accountNumber = loginUrl["accountNumber"].ToString(); | |
33 | + var mType= loginUrl["mType"].ToString(); | |
34 | + string slug = string.Empty; | |
35 | + | |
36 | + int licId = AIAHTML5.API.Models.Users.ValidateLicenseByLoginUrl(accountNumber, EditionId); | |
37 | + | |
38 | + if (licId>0) | |
39 | + { | |
40 | + if(mType.ToUpper()=="CA") | |
41 | + { | |
42 | + slug = "clinical-animations"; | |
43 | + } | |
44 | + else if(mType.ToUpper() == "DA") | |
45 | + { | |
46 | + slug = "da-view-list"; | |
47 | + } | |
48 | + | |
49 | + dynamic uerinfo = AIAHTML5.API.Models.Users.ValidateLoginByUrl(accountNumber, EditionId, licId, slug); | |
50 | + if (uerinfo != null) | |
51 | + { | |
52 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(JsonConvert.SerializeObject(uerinfo)) }; | |
53 | + } | |
54 | + else | |
55 | + { | |
56 | + logger.Debug("INVALID_LOGIN"); | |
57 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.INVALID_LOGIN) }; | |
58 | + } | |
59 | + } | |
60 | + else | |
61 | + { | |
62 | + logger.Debug("NOT AUTHORIZED"); | |
63 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.MSG_NOT_AUTHORIZE_SITE_USER) }; | |
64 | + | |
65 | + } | |
66 | + } | |
67 | + else | |
68 | + { | |
69 | + logger.Debug("INVALID URL"); | |
70 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.INVALID_URL) }; | |
71 | + | |
72 | + } | |
73 | + } | |
74 | + else | |
75 | + { | |
76 | + response = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = null }; | |
77 | + | |
78 | + } | |
79 | + return response; | |
80 | + } | |
81 | + catch (SqlException e) | |
82 | + { | |
83 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.SQL_CONNECTION_ERROR) }; | |
84 | + } | |
85 | + catch (Exception e) | |
86 | + { | |
87 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) }; | |
88 | + | |
89 | + } | |
90 | + } | |
91 | + | |
92 | + } | |
93 | +} | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
... | ... | @@ -165,6 +165,57 @@ namespace AIAHTML5.API.Models |
165 | 165 | return hash; |
166 | 166 | } |
167 | 167 | |
168 | + internal ArrayList GetUserModulesBySlug(int licenseId,string slug) | |
169 | + { | |
170 | + logger.Debug(" Inside GetUserModulesByLicenseId for LicenseId = " + licenseId); | |
171 | + | |
172 | + ArrayList userModulelist = new ArrayList(); | |
173 | + | |
174 | + Hashtable modulesHash; | |
175 | + DataSet ds = new DataSet(); | |
176 | + | |
177 | + SqlConnection conn = new SqlConnection(dbConnectionString); | |
178 | + SqlCommand cmd = new SqlCommand(); | |
179 | + SqlDataAdapter adapter; | |
180 | + SqlParameter param; | |
181 | + | |
182 | + cmd.Connection = conn; | |
183 | + cmd.CommandText = DBConstants.GET_USER_MODULES_BY_LICENSE_ID; | |
184 | + cmd.CommandType = CommandType.StoredProcedure; | |
185 | + | |
186 | + param = new SqlParameter("@iLicenseId", licenseId); | |
187 | + param.Direction = ParameterDirection.Input; | |
188 | + param.DbType = DbType.Int32; | |
189 | + cmd.Parameters.Add(param); | |
190 | + | |
191 | + adapter = new SqlDataAdapter(cmd); | |
192 | + adapter.Fill(ds); | |
193 | + | |
194 | + | |
195 | + if (ds != null && ds.Tables.Count > 0) | |
196 | + { | |
197 | + DataTable dt = ds.Tables[0]; | |
198 | + | |
199 | + if (dt.Rows.Count > 0) | |
200 | + { | |
201 | + foreach (DataRow dr in dt.Rows) | |
202 | + { | |
203 | + if(dr["Slug"].ToString()== slug) | |
204 | + { | |
205 | + modulesHash = new Hashtable(); | |
206 | + modulesHash.Add(AIAConstants.KEY_ID, dr["Id"]); | |
207 | + modulesHash.Add(AIAConstants.KEY_NAME, dr["Title"]); | |
208 | + modulesHash.Add(AIAConstants.KEY_SLUG, dr["Slug"]); | |
209 | + userModulelist.Add(modulesHash); | |
210 | + } | |
211 | + | |
212 | + } | |
213 | + } | |
214 | + } | |
215 | + | |
216 | + | |
217 | + return userModulelist; | |
218 | + } | |
168 | 219 | internal ArrayList GetUserModulesByLicenseId(int licenseId) |
169 | 220 | { |
170 | 221 | logger.Debug(" Inside GetUserModulesByLicenseId for LicenseId = " + licenseId); |
... | ... | @@ -1309,6 +1360,27 @@ namespace AIAHTML5.API.Models |
1309 | 1360 | // return 1; |
1310 | 1361 | |
1311 | 1362 | //} |
1363 | + internal DataTable GetLoginbyUrl(string licenceAccount, int editionId) | |
1364 | + { | |
1365 | + logger.Debug(" inside GetLicenseIdBySiteUrl for UserId= " + editionId + ",licenceAccount = " + licenceAccount); | |
1366 | + | |
1367 | + // SiteUrl siteUrl = null; | |
1368 | + DataTable dt = null; | |
1369 | + | |
1370 | + SqlConnection conn = new SqlConnection(dbConnectionString); | |
1371 | + SqlCommand cmd = new SqlCommand(); | |
1372 | + cmd.Connection = conn; | |
1373 | + cmd.CommandText = DBConstants.GET_LOGIN_BY_URL; | |
1374 | + cmd.CommandType = CommandType.StoredProcedure; | |
1375 | + cmd.Parameters.AddWithValue("@sLicenseAccount", licenceAccount); | |
1376 | + cmd.Parameters.AddWithValue("@iEditionId", editionId); | |
1377 | + SqlDataAdapter da = new SqlDataAdapter(); | |
1378 | + da.SelectCommand = cmd; | |
1379 | + dt = new DataTable(); | |
1380 | + da.Fill(dt); | |
1381 | + | |
1382 | + return dt; | |
1383 | + } | |
1312 | 1384 | |
1313 | 1385 | internal DataTable GetLicenseInfoBySiteUrl(string licenceAccount, int editionId) |
1314 | 1386 | { |
... | ... | @@ -1495,5 +1567,37 @@ namespace AIAHTML5.API.Models |
1495 | 1567 | return isModestyOn; |
1496 | 1568 | } |
1497 | 1569 | |
1570 | + internal List<string> GetStudentEditionByLicenseId(int LicenseId) | |
1571 | + { | |
1572 | + List<string> arrayEditionList = new List<string>(); | |
1573 | + | |
1574 | + DataTable dt = null; | |
1575 | + | |
1576 | + SqlConnection conn = new SqlConnection(dbConnectionString); | |
1577 | + SqlCommand cmd = new SqlCommand(); | |
1578 | + cmd.Connection = conn; | |
1579 | + cmd.CommandText = DBConstants.GET_STUDENT_EDITION; | |
1580 | + cmd.CommandType = CommandType.StoredProcedure; | |
1581 | + cmd.Parameters.AddWithValue("@iLicenseId", LicenseId); | |
1582 | + | |
1583 | + SqlDataAdapter da = new SqlDataAdapter(); | |
1584 | + da.SelectCommand = cmd; | |
1585 | + dt = new DataTable(); | |
1586 | + da.Fill(dt); | |
1587 | + | |
1588 | + if (dt != null && dt.Rows.Count > 0) | |
1589 | + { | |
1590 | + if(arrayEditionList.Count<1) | |
1591 | + { | |
1592 | + // geting only first editon 3 or 4 | |
1593 | + string edition = dt.Rows[0]["EditionId"].ToString(); | |
1594 | + arrayEditionList.Add(edition); | |
1595 | + } | |
1596 | + | |
1597 | + } | |
1598 | + | |
1599 | + return arrayEditionList; | |
1600 | + } | |
1601 | + | |
1498 | 1602 | } |
1499 | 1603 | } |
1500 | 1604 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/User.cs
... | ... | @@ -58,6 +58,8 @@ namespace AIAHTML5.API.Models |
58 | 58 | public string TermsAndConditionsTitle { get; set; } |
59 | 59 | public string TermsAndConditionsText { get; set; } |
60 | 60 | |
61 | + public List<string> StudentEdition { get; set; } | |
62 | + | |
61 | 63 | public const string SUPER_ADMIN = "Super Admin"; |
62 | 64 | public const string GENERAL_ADMIN = "General Admin"; |
63 | 65 | public const string DISTRICT_ADMIN = "District Admin"; | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
... | ... | @@ -205,6 +205,20 @@ namespace AIAHTML5.API.Models |
205 | 205 | return isLicenseExpired; |
206 | 206 | } |
207 | 207 | |
208 | + internal static ArrayList getModuleListBySlug(int licenseId,string slug) | |
209 | + { | |
210 | + logger.Debug("inside getModuleListByLicenseId for LicenseId =" + licenseId); | |
211 | + | |
212 | + ArrayList licensedModulesList = new ArrayList(); | |
213 | + | |
214 | + | |
215 | + | |
216 | + DBModel objModel = new DBModel(); | |
217 | + licensedModulesList = objModel.GetUserModulesBySlug(licenseId,slug); | |
218 | + | |
219 | + | |
220 | + return licensedModulesList; | |
221 | + } | |
208 | 222 | internal static ArrayList getModuleListByLicenseId(int licenseId) |
209 | 223 | { |
210 | 224 | logger.Debug("inside getModuleListByLicenseId for LicenseId =" + licenseId); |
... | ... | @@ -698,5 +712,132 @@ namespace AIAHTML5.API.Models |
698 | 712 | bool IsModestyOn = objModel.GetModestyInfo(LicenseId,editionId); |
699 | 713 | return IsModestyOn; |
700 | 714 | } |
715 | + | |
716 | + internal static List<string> GetStudentEdition(int LicenseId) | |
717 | + { | |
718 | + DBModel objModel = new DBModel(); | |
719 | + List<string> arrayEditionList = objModel.GetStudentEditionByLicenseId(LicenseId); | |
720 | + | |
721 | + return arrayEditionList; | |
722 | + } | |
723 | + | |
724 | + public static int ValidateLicenseByLoginUrl(string strAccountNumber, int editionId) | |
725 | + { | |
726 | + int intReturn = 0; | |
727 | + DBModel objDBModel = new DBModel(); | |
728 | + DataTable dtLicense = objDBModel.GetLoginbyUrl(strAccountNumber, editionId); | |
729 | + | |
730 | + if (dtLicense.Rows.Count > 0) | |
731 | + { | |
732 | + foreach (DataRow objLicenseRow in dtLicense.Rows) | |
733 | + { | |
734 | + intReturn = Convert.ToInt32(objLicenseRow["Id"]); | |
735 | + } | |
736 | + | |
737 | + } | |
738 | + | |
739 | + return intReturn; | |
740 | + } | |
741 | + | |
742 | + public static User ValidateLoginByUrl(String strAcccountNumber, int intEditionId, int licId, string slug) | |
743 | + { | |
744 | + User userInfo = null; | |
745 | + | |
746 | + string expirationDate = null; | |
747 | + bool isLicenseExpired = false; | |
748 | + | |
749 | + // validate license start date | |
750 | + string startDate = null; | |
751 | + bool isSubscriptionNotStart = false; | |
752 | + | |
753 | + DateTime dtLogDate = DateTime.Now; | |
754 | + | |
755 | + if (string.IsNullOrEmpty(strAcccountNumber)) | |
756 | + { | |
757 | + userInfo.LoginFailureCauseId = ErrorHelper.E_ACCOUNT_NUMBER_NOT_NULL; | |
758 | + } | |
759 | + else if (intEditionId == 0) | |
760 | + { | |
761 | + userInfo.LoginFailureCauseId = ErrorHelper.E_EDITION_ID_NOT_NULL; | |
762 | + } | |
763 | + else | |
764 | + { | |
765 | + userInfo = new User(); | |
766 | + userInfo.LicenseInfo = AIAHTML5.API.Models.Users.getLicenseDetails(licId); | |
767 | + | |
768 | + if (userInfo.LicenseInfo != null) | |
769 | + { | |
770 | + //05.3 get licenseSubscription details | |
771 | + userInfo.LicenseSubscriptions = AIAHTML5.API.Models.Users.getLicenseSubscriptionDetails(userInfo.LicenseInfo.Id); | |
772 | + | |
773 | + //05.4 check the License expiration irespective of either user is active or not because on AIA | |
774 | + //we shows the License expiration message for inactive users too | |
775 | + | |
776 | + if (userInfo.LicenseSubscriptions != null) | |
777 | + { | |
778 | + isSubscriptionNotStart = AIAHTML5.API.Models.Users.checkIfLicenseNotStarted(userInfo.LicenseSubscriptions, out startDate); | |
779 | + | |
780 | + isLicenseExpired = AIAHTML5.API.Models.Users.checkIfLicenseExpired(userInfo.LicenseSubscriptions, out expirationDate); | |
781 | + } | |
782 | + | |
783 | + if (userInfo.LicenseInfo.IsActive != true) | |
784 | + { | |
785 | + userInfo.LoginFailureCauseId = ErrorHelper.LICENSE_INACTIVE; | |
786 | + } | |
787 | + else if (isLicenseExpired) | |
788 | + { | |
789 | + userInfo.LoginFailureCauseId = ErrorHelper.LICENSE_EXPIRED; | |
790 | + userInfo.SubscriptionExpirationDate = expirationDate; | |
791 | + } | |
792 | + else if (isSubscriptionNotStart) | |
793 | + { | |
794 | + userInfo.LoginFailureCauseId = ErrorHelper.LICENSE_NOTSTARTED; | |
795 | + userInfo.SubscriptionStartDate = startDate; | |
796 | + | |
797 | + } | |
798 | + else | |
799 | + { | |
800 | + //User objUserContext = new User(); | |
801 | + userInfo.Id = 0; | |
802 | + userInfo.siteId = 0; | |
803 | + userInfo.isSiteUser = true; //using as site user | |
804 | + userInfo.FirstName = userInfo.LicenseInfo.LicenseeFirstName; | |
805 | + userInfo.LastName = userInfo.LicenseInfo.LicenseeLastName; | |
806 | + userInfo.LicenseId = licId; | |
807 | + userInfo.UserTypeId = AIAConstants.SITE_USER; | |
808 | + | |
809 | + userInfo.AccountNumber = strAcccountNumber; | |
810 | + userInfo.EditionId = (Byte)intEditionId; | |
811 | + userInfo.LicenseTypeId = (Byte)userInfo.LicenseInfo.LicenseTypeId; | |
812 | + | |
813 | + // below detail not using | |
814 | + userInfo.LicenseEditionId = 0; | |
815 | + userInfo.LoginId = ""; | |
816 | + userInfo.Modesty = true; | |
817 | + userInfo.ModestyMode = true; | |
818 | + userInfo.userselectedModesty = null; | |
819 | + userInfo.userSelectedSkintone = null; | |
820 | + userInfo.userLexicon = null; | |
821 | + | |
822 | + // get only CA module | |
823 | + | |
824 | + userInfo.Modules = getModuleListBySlug(licId,slug); | |
825 | + | |
826 | + } | |
827 | + | |
828 | + | |
829 | + } | |
830 | + else | |
831 | + { | |
832 | + | |
833 | + userInfo.LoginFailureCauseId = ErrorHelper.E_EDITION_NOT_LINKED_WITH_SITE; | |
834 | + } | |
835 | + | |
836 | + | |
837 | + } | |
838 | + | |
839 | + return userInfo; | |
840 | + } | |
841 | + | |
701 | 842 | } |
702 | 843 | } |
703 | 844 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js
... | ... | @@ -162,9 +162,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
162 | 162 | //direct open CA module |
163 | 163 | var curtab = $rootScope.getLocalStorageValue("currentCATabView"); |
164 | 164 | $scope.setActiveTab(curtab) |
165 | - if($rootScope.siteUrlInfo.mtype!=null && $rootScope.siteUrlInfo.id!=null) | |
165 | + if($rootScope.siteUrlInfo.mType!=null && $rootScope.siteUrlInfo.id!=null) | |
166 | 166 | { |
167 | - if($rootScope.siteUrlInfo.mtype.toLowerCase()=='ca' && $rootScope.siteUrlInfo.id!="") | |
167 | + if($rootScope.siteUrlInfo.mType.toLowerCase()=='ca' && $rootScope.siteUrlInfo.id!="") | |
168 | 168 | { |
169 | 169 | $rootScope.isCallFromOtherModule = true; |
170 | 170 | $rootScope.linkToOpenCa=true; |
... | ... | @@ -184,43 +184,47 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
184 | 184 | .where('_id = ' + $rootScope.siteUrlInfo.id) |
185 | 185 | .select('_Title'); |
186 | 186 | |
187 | - if(AnimationTitle.length>0) | |
188 | - { | |
189 | - var CAlinkData = { | |
190 | - "id": $rootScope.siteUrlInfo.id, | |
191 | - "mType": 'CLINICAL_ANIMATIONS', | |
192 | - "textVisible": true, | |
193 | - "maximised": true, | |
194 | - "windowTitle": AnimationTitle[0]._Title, | |
195 | - | |
196 | - }; | |
197 | - | |
198 | - ModuleService.setModuleData(CAlinkData, 0); | |
199 | - // close/remove prev panel when in minimised mode | |
200 | - | |
201 | - if($rootScope.CAWindowData!=undefined) | |
187 | + if(AnimationTitle.length>0) | |
202 | 188 | { |
203 | - if($rootScope.CAWindowData.length>0) | |
189 | + var CAlinkData = { | |
190 | + "id": $rootScope.siteUrlInfo.id, | |
191 | + "mType": 'CLINICAL_ANIMATIONS', | |
192 | + "textVisible": true, | |
193 | + "maximised": true, | |
194 | + "windowTitle": AnimationTitle[0]._Title, | |
195 | + | |
196 | + }; | |
197 | + | |
198 | + ModuleService.setModuleData(CAlinkData, 0); | |
199 | + // close/remove prev panel when in minimised mode | |
200 | + | |
201 | + if($rootScope.CAWindowData!=undefined) | |
204 | 202 | { |
205 | - for(var x=0 ;x < $rootScope.CAWindowData.length;x++){ | |
206 | - var winid=$rootScope.CAWindowData[x].multiwinid; | |
207 | - if ($('#caImagePanel_' + winid).html() != undefined) { | |
208 | - $('#caImagePanel_' + winid).remove(); | |
209 | - } | |
203 | + if($rootScope.CAWindowData.length>0) | |
204 | + { | |
205 | + for(var x=0 ;x < $rootScope.CAWindowData.length;x++){ | |
206 | + var winid=$rootScope.CAWindowData[x].multiwinid; | |
207 | + if ($('#caImagePanel_' + winid).html() != undefined) { | |
208 | + $('#caImagePanel_' + winid).remove(); | |
209 | + } | |
210 | + } | |
211 | + $rootScope.CAWindowData=[]; | |
210 | 212 | } |
211 | - $rootScope.CAWindowData=[]; | |
212 | 213 | } |
214 | + | |
215 | + $location.url('/clinical-animations-detail'); | |
213 | 216 | } |
214 | - | |
215 | - $location.url('/clinical-animations-detail'); | |
216 | - } | |
217 | - else | |
218 | - { | |
219 | - $('#errorMessage').text("Animation course not found. Please try again!"); | |
220 | - $("#messageModal").modal('show'); | |
221 | - | |
222 | - } | |
223 | - | |
217 | + else | |
218 | + { | |
219 | + $("#messageModal div div .modal-header button").css('display','none'); | |
220 | + $('#errorMessage').text("Animation course not found. Please try again!"); | |
221 | + $("#messageModal").modal('show'); | |
222 | + | |
223 | + //logout if not course found | |
224 | + $("#messageModal div div .modal-footer button").on('click', function (event) { | |
225 | + $rootScope.LogoutUser(); | |
226 | + }); | |
227 | + } | |
224 | 228 | }, |
225 | 229 | function (error) { |
226 | 230 | $scope.EnableUI(); |
... | ... | @@ -309,7 +313,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
309 | 313 | //call time interval function until load Illustration data |
310 | 314 | var timeintval = null; |
311 | 315 | timeintval = $interval(function () { |
312 | - var AnimationData = $scope.GetCAwindowStoreData($rootScope.MULTI_VIEW_ID, 'AnimationData'); | |
316 | + var AnimationData = $scope.GetCAwindowStoreData($rootScope.MULTI_VIEW_ID, 'AnimationData'); | |
317 | + if(AnimationData==undefined){$scope.stopIntervalCA();} | |
313 | 318 | if (AnimationData.length>0) { |
314 | 319 | $scope.stopIntervalCA(); |
315 | 320 | if (curtab == 2) { |
... | ... | @@ -385,7 +390,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
385 | 390 | promise.then( |
386 | 391 | function (result) { |
387 | 392 | |
388 | - if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2) | |
393 | + if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) | |
389 | 394 | { |
390 | 395 | $scope.islinkActive = true; |
391 | 396 | var AnimationData = new jinqJs() |
... | ... | @@ -395,7 +400,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
395 | 400 | |
396 | 401 | angular.forEach(AnimationData, function (value, key) { |
397 | 402 | |
398 | - AnimationData[key].copyLink=$rootScope.homeURL+'?username='+$rootScope.userData.LoginId+'&accountNumber='+$rootScope.userData.LicenseInfo.AccountNumber.trim()+'&mtype=CA&id='+value._id; | |
403 | + AnimationData[key].copyLink=$rootScope.homeURL+'?accountNumber='+$rootScope.userData.LicenseInfo.AccountNumber.trim()+'&edition='+$rootScope.userData.StudentEdition[0]+'&referer=&mType=CA&id='+value._id; | |
399 | 404 | |
400 | 405 | }); |
401 | 406 | |
... | ... | @@ -430,7 +435,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
430 | 435 | angular.forEach($scope.selectedCAListViewData, function (value, key) { |
431 | 436 | var imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; |
432 | 437 | |
433 | - if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2) | |
438 | + if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) | |
434 | 439 | { |
435 | 440 | var $el = $('<div class="col-sm-3 col-lg-2">' |
436 | 441 | +'<div id="' + value._id + '" title = "'+ value._Title + '" data-ng-click="openView($event)">' |
... | ... | @@ -439,7 +444,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
439 | 444 | + '<div class="caption" style="padding:0px;height:42px"><p style="white-space:pre-wrap;height:40px">' + value._Title + '</p>' |
440 | 445 | +'</div></a></div></div>' |
441 | 446 | +'<div class="thumbnail tooltipbtn" style="height:23px; padding:0px !important">' |
442 | - +'<button id="copybtn_' + value._id + '" data-clipboard-text="'+value.copyLink+'" onclick="copygridbtnclick(event)" style="float:right;font-size:11px" >copy embed link</button>' | |
447 | + +'<button id="copybtn_' + value._id + '" data-clipboard-text="'+value.copyLink+'" onclick="copygridbtnclick(event)" style="float:right;font-size:11px" >Copy embed link</button>' | |
443 | 448 | +'<span id="spn_' + value._id + '" class="tooltiptext"></span></div>' |
444 | 449 | |
445 | 450 | +'</div>').appendTo('#grid-view'); |
... | ... | @@ -670,10 +675,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
670 | 675 | } |
671 | 676 | |
672 | 677 | if (selectimg === true && count >= filtercount) { |
673 | - | |
674 | - | |
675 | 678 | var imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; |
676 | - if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2) | |
679 | + if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) | |
677 | 680 | { |
678 | 681 | var $el = $('<div class="col-sm-3 col-lg-2">' |
679 | 682 | +'<div id="' + value._id + '" title = "'+ value._Title + '" data-ng-click="openView($event)">' |
... | ... | @@ -682,7 +685,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
682 | 685 | + '<div class="caption" style="padding:0px;height:42px"><p style="white-space:pre-wrap;height:40px">' + value._Title + '</p>' |
683 | 686 | +'</div></a></div></div>' |
684 | 687 | +'<div class="thumbnail tooltipbtn" style="height:23px; padding:0px !important">' |
685 | - +'<button id="copybtn_' + value._id + '" data-clipboard-text="'+value.copyLink+'" onclick="copygridbtnclick(event)" style="float:right;font-size:11px" >copy embed link</button>' | |
688 | + +'<button id="copybtn_' + value._id + '" data-clipboard-text="'+value.copyLink+'" onclick="copygridbtnclick(event)" style="float:right;font-size:11px" >Copy embed link</button>' | |
686 | 689 | +'<span id="spn_' + value._id + '" class="tooltiptext"></span></div>' |
687 | 690 | |
688 | 691 | +'</div>').appendTo('#grid-view'); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -655,6 +655,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
655 | 655 | emailId: null, |
656 | 656 | newPassword: null, |
657 | 657 | confirmPassword: null, |
658 | + accountNumber: null, | |
659 | + edition: null, | |
660 | + mType:null, | |
661 | + urlReferer: null, | |
658 | 662 | userMessage: null, |
659 | 663 | unblockUser: false, |
660 | 664 | isMailForForgotPassword: false, |
... | ... | @@ -671,7 +675,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
671 | 675 | calsCreds: null, |
672 | 676 | userId: null, |
673 | 677 | password: null, |
674 | - mtype:null, | |
678 | + mType:null, | |
675 | 679 | id:null, |
676 | 680 | SessionId:date.getTime() |
677 | 681 | } |
... | ... | @@ -726,11 +730,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
726 | 730 | |
727 | 731 | //licenseId would be zero for admin/gernal admin |
728 | 732 | var isadminType=loggedInUser.LicenseId==0?true:false; |
729 | - if(loggedInUser.mtype!=undefined) | |
733 | + if(loggedInUser.mType!=undefined) | |
730 | 734 | { |
731 | 735 | $scope.checkuserstatus = { |
732 | 736 | userId: userId, |
733 | - tagName: loggedInUser.mtype.toLowerCase()=='ca'?'logout':'update', | |
737 | + tagName: loggedInUser.mType.toLowerCase()=='ca'?'logout':'update', | |
734 | 738 | SessionId:loggedInUser.SessionId, |
735 | 739 | isSiteUser:loggedInUser.isSiteUser, |
736 | 740 | isAdmin:isadminType |
... | ... | @@ -1032,13 +1036,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1032 | 1036 | result.aiaIdleTime=$rootScope.aiaIdleTime; |
1033 | 1037 | result.aiaIdleTimeOut=$rootScope.aiaIdleTimeOut; |
1034 | 1038 | result.aiaPingInterval=$rootScope.aiaPingInterval; |
1035 | - result.SessionId=userInfo.SessionId; | |
1036 | - if(userInfo.mtype!=undefined) | |
1037 | - { | |
1038 | - //for CA bypass login | |
1039 | - result.mtype=userInfo.mtype; | |
1040 | - } | |
1041 | - | |
1039 | + result.SessionId=userInfo.SessionId; | |
1042 | 1040 | //display user name |
1043 | 1041 | $rootScope.userName=result.FirstName+" "+result.LastName; |
1044 | 1042 | |
... | ... | @@ -1261,14 +1259,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1261 | 1259 | $rootScope.isVisibleLogin = false; |
1262 | 1260 | } |
1263 | 1261 | |
1264 | - | |
1265 | 1262 | $location.path('/'); |
1266 | - | |
1267 | - $timeout(function () { | |
1268 | - $rootScope.LoginEnableUI(); | |
1269 | - $scope.RedirectToModule(); | |
1270 | - }, 100); | |
1271 | - | |
1263 | + $rootScope.LoginEnableUI(); | |
1264 | + | |
1272 | 1265 | } |
1273 | 1266 | else |
1274 | 1267 | { |
... | ... | @@ -1350,13 +1343,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1350 | 1343 | $(".modal-backdrop").css("opacity", ".5"); |
1351 | 1344 | |
1352 | 1345 | } |
1353 | - else { | |
1346 | + else | |
1347 | + { | |
1354 | 1348 | $location.path('/'); |
1355 | - $timeout(function () { | |
1356 | - $rootScope.LoginEnableUI(); | |
1357 | - $scope.RedirectToModule(); | |
1358 | - | |
1359 | - }, 100); | |
1349 | + $rootScope.LoginEnableUI(); | |
1360 | 1350 | } |
1361 | 1351 | } |
1362 | 1352 | else { |
... | ... | @@ -1401,12 +1391,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1401 | 1391 | } |
1402 | 1392 | |
1403 | 1393 | $scope.RedirectToModule = function () { |
1404 | - if($rootScope.siteUrlInfo.mtype!=null && $rootScope.siteUrlInfo.id!=null) | |
1394 | + if($rootScope.siteUrlInfo.mType!=null && $rootScope.siteUrlInfo.id!=null) | |
1405 | 1395 | { |
1406 | - if($rootScope.siteUrlInfo.mtype.toLowerCase()=='ca' && $rootScope.siteUrlInfo.id!="") | |
1396 | + if($rootScope.siteUrlInfo.mType.toLowerCase()=='ca' && $rootScope.siteUrlInfo.id!="") | |
1407 | 1397 | { |
1408 | 1398 | $('#clinical-animations').trigger('click'); |
1409 | - $rootScope.isCAlink=true; | |
1410 | 1399 | } |
1411 | 1400 | |
1412 | 1401 | } |
... | ... | @@ -1419,7 +1408,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1419 | 1408 | $scope.ValidateClientSiteUrl = function () { |
1420 | 1409 | |
1421 | 1410 | $rootScope.isCallFromSite = true; |
1422 | - | |
1411 | + $rootScope.isCAlink=true; | |
1412 | + $rootScope.LoginDisableUI(); | |
1423 | 1413 | var siteInfo = params.split('&'); |
1424 | 1414 | |
1425 | 1415 | for (var i = 0; i < siteInfo.length; i++) { |
... | ... | @@ -1433,23 +1423,23 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1433 | 1423 | //added by birendra direct open CA module |
1434 | 1424 | if(paramInfo[0].toLowerCase() == 'mtype') |
1435 | 1425 | { |
1436 | - $rootScope.siteUrlInfo.mtype = paramInfo[1]; | |
1437 | - console.log("$rootScope.siteUrlInfo.mtype" + $rootScope.siteUrlInfo.mtype); | |
1426 | + $rootScope.siteUrlInfo.mType = paramInfo[1]; | |
1438 | 1427 | } |
1439 | 1428 | else if (paramInfo[0].toLowerCase() == 'id') { |
1440 | 1429 | |
1441 | 1430 | $rootScope.siteUrlInfo.id = paramInfo[1]; |
1442 | - console.log("$rootScope.siteUrlInfo.id" + $rootScope.siteUrlInfo.id); | |
1443 | 1431 | } |
1444 | 1432 | else if (paramInfo[0].toLowerCase() == 'username') { |
1445 | 1433 | |
1446 | 1434 | $rootScope.siteUrlInfo.userId = paramInfo[1]; |
1447 | - console.log("$rootScope.siteUrlInfo.username" + $rootScope.siteUrlInfo.userId); | |
1435 | + } | |
1436 | + else if (paramInfo[0].toLowerCase() == 'edition') { | |
1437 | + | |
1438 | + $rootScope.siteUrlInfo.edition = paramInfo[1]; | |
1448 | 1439 | } |
1449 | 1440 | else if (paramInfo[0].toLowerCase() == 'accountnumber') { |
1450 | 1441 | |
1451 | 1442 | $rootScope.siteUrlInfo.accountNumber = paramInfo[1]; |
1452 | - console.log("$rootScope.siteUrlInfo.accountNumber" + $rootScope.siteUrlInfo.accountNumber); | |
1453 | 1443 | } |
1454 | 1444 | |
1455 | 1445 | } |
... | ... | @@ -1485,58 +1475,91 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1485 | 1475 | } |
1486 | 1476 | } |
1487 | 1477 | if (isCalsCredantialForSIte == "True") { |
1488 | - if($rootScope.siteUrlInfo.mtype!=null && $rootScope.siteUrlInfo.mtype.toLowerCase()=='ca' && $rootScope.siteUrlInfo.id!=null && $rootScope.siteUrlInfo.id!="" && $rootScope.siteUrlInfo.userId!=null && $rootScope.siteUrlInfo.accountNumber!=null) | |
1478 | + if($rootScope.siteUrlInfo.mType!=null && $rootScope.siteUrlInfo.mType.toLowerCase()=='ca' && $rootScope.siteUrlInfo.id!=null && $rootScope.siteUrlInfo.id!="" && $rootScope.siteUrlInfo.edition!=null && $rootScope.siteUrlInfo.accountNumber!=null) | |
1489 | 1479 | { |
1490 | - $rootScope.LoginDisableUI(); | |
1480 | + $('.navbar-fixed-top').css('display','none'); | |
1491 | 1481 | var userInfo=$rootScope.userInfo;//also get session id |
1492 | - AuthenticationService.ByPassLoginToOpenModule($rootScope.siteUrlInfo) | |
1482 | + $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); | |
1483 | + ConfigurationService.getCofigValue() | |
1493 | 1484 | .then( |
1494 | - function (result) { | |
1495 | - if(result!=null) | |
1496 | - { | |
1497 | - $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); | |
1498 | - ConfigurationService.getCofigValue() | |
1499 | - .then( | |
1500 | - function (configresult) { | |
1501 | - $rootScope.current_year = configresult.current_year; | |
1502 | - $rootScope.aiaIdleTime = configresult.idleTime; | |
1503 | - $rootScope.aiaIdleTimeOut = configresult.idelTimeOut; | |
1504 | - $rootScope.aiaPingInterval = configresult.pingInterval; | |
1505 | - $rootScope.aiaAnimationPath = configresult.serverPath; | |
1506 | - $rootScope.MaxOneFileSize = configresult.fileSize; | |
1507 | - $rootScope.aodDomainName = configresult.aodSiteUrl; | |
1508 | - | |
1509 | - userInfo.username = result.LoginId; | |
1510 | - userInfo.password = result.Password; | |
1511 | - userInfo.mtype = $rootScope.siteUrlInfo.mtype; | |
1512 | - var loggedInUser = JSON.parse($scope.currentUserDetails); | |
1513 | - if(loggedInUser!==null && loggedInUser.LoginId==result.LoginId) | |
1514 | - { | |
1515 | - //using old session id | |
1516 | - userInfo.SessionId = loggedInUser.SessionId; | |
1517 | - $rootScope.AuthenticateUser(userInfo); | |
1518 | - } | |
1519 | - else | |
1520 | - { | |
1521 | - //using new sessionid | |
1522 | - $rootScope.AuthenticateUser(userInfo); | |
1523 | - } | |
1524 | - }); | |
1485 | + function (configresult) { | |
1486 | + $rootScope.current_year = configresult.current_year; | |
1487 | + $rootScope.aiaIdleTime = configresult.idleTime; | |
1488 | + $rootScope.aiaIdleTimeOut = configresult.idelTimeOut; | |
1489 | + $rootScope.aiaPingInterval = configresult.pingInterval; | |
1490 | + $rootScope.aiaAnimationPath = configresult.serverPath; | |
1491 | + $rootScope.MaxOneFileSize = configresult.fileSize; | |
1492 | + $rootScope.aodDomainName = configresult.aodSiteUrl; | |
1493 | + | |
1494 | + userInfo.accountNumber = $rootScope.siteUrlInfo.accountNumber; | |
1495 | + userInfo.edition = $rootScope.siteUrlInfo.edition; | |
1496 | + userInfo.mType = $rootScope.siteUrlInfo.mType; | |
1497 | + | |
1498 | + var loggedInUser = JSON.parse($scope.currentUserDetails); | |
1499 | + //check already login by account number bcz no login id for site login | |
1500 | + //maintain user session by licenseid of site login | |
1501 | + if(loggedInUser!==null && loggedInUser.AccountNumber== userInfo.accountNumber) | |
1502 | + { | |
1503 | + //using old session id | |
1504 | + userInfo.SessionId = loggedInUser.SessionId; | |
1505 | + $rootScope.AuthenticateUrlLogin(userInfo); | |
1506 | + } | |
1507 | + else | |
1508 | + { | |
1509 | + //using new sessionid | |
1510 | + $rootScope.AuthenticateUrlLogin(userInfo); | |
1511 | + } | |
1512 | + }); | |
1513 | + //comment below code | |
1514 | + // AuthenticationService.ByPassLoginToOpenModule($rootScope.siteUrlInfo) | |
1515 | + // .then( | |
1516 | + // function (result) { | |
1517 | + // if(result!=null) | |
1518 | + // { | |
1519 | + // $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); | |
1520 | + // ConfigurationService.getCofigValue() | |
1521 | + // .then( | |
1522 | + // function (configresult) { | |
1523 | + // $rootScope.current_year = configresult.current_year; | |
1524 | + // $rootScope.aiaIdleTime = configresult.idleTime; | |
1525 | + // $rootScope.aiaIdleTimeOut = configresult.idelTimeOut; | |
1526 | + // $rootScope.aiaPingInterval = configresult.pingInterval; | |
1527 | + // $rootScope.aiaAnimationPath = configresult.serverPath; | |
1528 | + // $rootScope.MaxOneFileSize = configresult.fileSize; | |
1529 | + // $rootScope.aodDomainName = configresult.aodSiteUrl; | |
1530 | + | |
1531 | + // userInfo.username = result.LoginId; | |
1532 | + // userInfo.password = result.Password; | |
1533 | + // userInfo.mtype = $rootScope.siteUrlInfo.mtype; | |
1534 | + // var loggedInUser = JSON.parse($scope.currentUserDetails); | |
1535 | + // if(loggedInUser!==null && loggedInUser.LoginId==result.LoginId) | |
1536 | + // { | |
1537 | + // //using old session id | |
1538 | + // userInfo.SessionId = loggedInUser.SessionId; | |
1539 | + // $rootScope.AuthenticateUser(userInfo); | |
1540 | + // } | |
1541 | + // else | |
1542 | + // { | |
1543 | + // //using new sessionid | |
1544 | + // $rootScope.AuthenticateUser(userInfo); | |
1545 | + // } | |
1546 | + // }); | |
1525 | 1547 | |
1526 | - } | |
1548 | + // } | |
1527 | 1549 | |
1528 | - }), | |
1529 | - function (error) { | |
1530 | - console.log(' Error in bypass login = ' + error.statusText); | |
1531 | - $rootScope.isVisibleLogin = true; | |
1532 | - $rootScope.LoginEnableUI(); | |
1533 | - $('#errorMessage').text(error); | |
1534 | - $("#messageModal").modal('show'); | |
1535 | - } | |
1550 | + // }), | |
1551 | + // function (error) { | |
1552 | + // console.log(' Error in bypass login = ' + error.statusText); | |
1553 | + // $rootScope.isVisibleLogin = true; | |
1554 | + // $rootScope.LoginEnableUI(); | |
1555 | + // $('#errorMessage').text(error); | |
1556 | + // $("#messageModal").modal('show'); | |
1557 | + // } | |
1536 | 1558 | |
1537 | 1559 | } |
1538 | 1560 | else |
1539 | 1561 | { |
1562 | + $rootScope.LoginEnableUI(); | |
1540 | 1563 | console.log(' invalid detail in bypass login'); |
1541 | 1564 | $rootScope.isVisibleLogin = true; |
1542 | 1565 | $('#errorMessage').text("authentication is not allowed due to invalid details format.\nPlease pass the correct details again!"); |
... | ... | @@ -1544,11 +1567,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1544 | 1567 | } |
1545 | 1568 | |
1546 | 1569 | } |
1547 | - else { | |
1548 | - | |
1549 | - console.log($rootScope.siteUrlInfo); | |
1550 | - | |
1551 | - $rootScope.LoginDisableUI(); | |
1570 | + else | |
1571 | + { | |
1552 | 1572 | $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); |
1553 | 1573 | var sitedetail=$rootScope.siteUrlInfo; |
1554 | 1574 | ConfigurationService.getCofigValue() |
... | ... | @@ -1862,7 +1882,145 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
1862 | 1882 | $rootScope.loadUserSession(); |
1863 | 1883 | $rootScope.LoginEnableUI(); |
1864 | 1884 | |
1885 | + } | |
1886 | + | |
1887 | + } | |
1888 | + } | |
1889 | + | |
1890 | + }, | |
1891 | + | |
1892 | + function (error) { | |
1893 | + | |
1894 | + console.log(' Error in authentication = ' + error.statusText); | |
1895 | + $rootScope.LoginEnableUI(); | |
1896 | + $rootScope.isVisibleLogin = true; | |
1897 | + $('#errorMessage').text(error); | |
1898 | + $("#messageModal").modal('show'); | |
1899 | + | |
1900 | + } | |
1901 | + ) | |
1902 | + | |
1903 | + } | |
1904 | + | |
1905 | + $rootScope.AuthenticateUrlLogin = function (urlInfo) { | |
1906 | + $rootScope.LoginDisableUI(); | |
1907 | + AuthenticationService.validateUrlLogin(urlInfo) | |
1908 | + .then( | |
1909 | + function (result) { | |
1910 | + if (result != null) | |
1911 | + { | |
1912 | + if (result == LoginConstants.INVALID_CLIENT) { | |
1913 | + $rootScope.isVisibleLogin = true; | |
1914 | + $rootScope.LoginEnableUI(); | |
1915 | + $('#errorMessage').text(LoginConstants.INVALID_CLIENT); | |
1916 | + $("#messageModal").modal('show'); | |
1917 | + } | |
1918 | + else if (result == LoginConstants.MSG_NOT_AUTHORIZE_SITE_USER) { | |
1919 | + $rootScope.isVisibleLogin = true; | |
1920 | + $rootScope.LoginEnableUI(); | |
1921 | + $('#errorMessage').text(LoginConstants.MSG_NOT_AUTHORIZE_SITE_USER); | |
1922 | + $("#messageModal").modal('show'); | |
1923 | + } | |
1924 | + else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_ACCOUNT_NUMBER_NOT_NULL) { | |
1925 | + $rootScope.isVisibleLogin = true; | |
1926 | + $rootScope.LoginEnableUI(); | |
1927 | + $('#errorMessage').text(LoginMessageConstants.E_ACCOUNT_NUMBER_NOT_NULL); | |
1928 | + $("#messageModal").modal('show'); | |
1929 | + } | |
1930 | + else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_EDITION_ID_NOT_NULL) { | |
1931 | + $rootScope.isVisibleLogin = true; | |
1932 | + $rootScope.LoginEnableUI(); | |
1933 | + $('#errorMessage').text(LoginMessageConstants.E_EDITION_ID_NOT_NULL); | |
1934 | + $("#messageModal").modal('show'); | |
1935 | + } | |
1936 | + else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_EDITION_NOT_LINKED_WITH_SITE) { | |
1937 | + $rootScope.isVisibleLogin = true; | |
1938 | + $rootScope.LoginEnableUI(); | |
1939 | + $('#errorMessage').text(LoginMessageConstants.E_EDITION_NOT_LINKED_WITH_SITE); | |
1940 | + $("#messageModal").modal('show'); | |
1941 | + } | |
1942 | + else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.LICENSE_INACTIVE) { | |
1943 | + $rootScope.isVisibleLogin = true; | |
1944 | + $rootScope.LoginEnableUI(); | |
1945 | + $('#errorMessage').text(LoginMessageConstants.LICENSE_INACTIVE_MESSAGE); | |
1946 | + $("#messageModal").modal('show'); | |
1947 | + } | |
1948 | + else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.SITELICENSE_EXPIRED) { | |
1949 | + $rootScope.isVisibleLogin = true; | |
1950 | + $rootScope.LoginEnableUI(); | |
1951 | + $('#errorMessage').text(LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'); | |
1952 | + $("#messageModal").modal('show'); | |
1953 | + } | |
1954 | + else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.SITELICENSE_NOTSTARTED) { | |
1955 | + $rootScope.isVisibleLogin = true; | |
1956 | + $rootScope.LoginEnableUI(); | |
1957 | + $('#errorMessage').text(LoginMessageConstants.SUBSCRIPTION_NOT_START_MESSAGE + result.SubscriptionStartDate + '.'); | |
1958 | + $("#messageModal").modal('show'); | |
1959 | + } | |
1960 | + else | |
1961 | + { | |
1962 | + // update result with session detail | |
1963 | + result.aiaIdleTime=$rootScope.aiaIdleTime; | |
1964 | + result.aiaIdleTimeOut=$rootScope.aiaIdleTimeOut; | |
1965 | + result.aiaPingInterval=$rootScope.aiaPingInterval; | |
1966 | + result.SessionId=urlInfo.SessionId; | |
1967 | + if(urlInfo.mType!=undefined) | |
1968 | + { | |
1969 | + //for CA bypass login | |
1970 | + result.mType=urlInfo.mType; | |
1971 | + } | |
1972 | + | |
1973 | + //display user name | |
1974 | + $rootScope.userName=result.FirstName+" "+result.LastName; | |
1975 | + if (typeof result.FirstName != undefined || result.FirstName != "" || result.FirstName != null) { | |
1976 | + | |
1977 | + // birendra// initialize exp img detail object | |
1978 | + $rootScope.initializeUserForExportImage(result.Id); | |
1979 | + | |
1980 | + if (result.LicenseInfo != null ) { | |
1981 | + $("#modestyDiv").css("pointer-events", "none"); | |
1982 | + $("#modestyDiv").css("opacity", 0.5); | |
1983 | + $("#modestyDiv").find("*").prop('disabled', true); | |
1984 | + | |
1985 | + $rootScope.userData = result; | |
1986 | + $rootScope.userModules = result.Modules; | |
1987 | + | |
1988 | + //1. set haveRoleAdmin = false because LicenseInfo is not null | |
1989 | + $rootScope.haveRoleAdmin = false; | |
1990 | + | |
1991 | + //2. | |
1992 | + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | |
1993 | + | |
1994 | + //5. | |
1995 | + sessionStorage.setItem("loginSession", "true"); | |
1996 | + $rootScope.isVisibleLogin = false; | |
1997 | + | |
1998 | + $location.path('/'); | |
1999 | + $timeout(function () { | |
2000 | + $rootScope.LoginEnableUI(); | |
2001 | + $scope.RedirectToModule(); | |
2002 | + | |
2003 | + }, 100); | |
2004 | + | |
2005 | + } | |
2006 | + else | |
2007 | + { | |
2008 | + if ($('#dvTerms').length > 0) { | |
2009 | + $('#dvTerms').html(result.TermsAndConditionsText); | |
2010 | + } | |
2011 | + $rootScope.isVisibleLogin = true; | |
2012 | + $rootScope.LoginEnableUI(); | |
2013 | + $('#dvTermCondition').fadeIn(); | |
2014 | + $rootScope.userData = result; | |
2015 | + $rootScope.haveRoleAdmin = false; | |
2016 | + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | |
2017 | + $location.path('/'); | |
1865 | 2018 | } |
2019 | + | |
2020 | + $rootScope.loadUserSession(); | |
2021 | + $rootScope.LoginEnableUI(); | |
2022 | + | |
2023 | + } | |
1866 | 2024 | |
1867 | 2025 | } |
1868 | 2026 | } |
... | ... | @@ -2067,11 +2225,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
2067 | 2225 | localStorage.removeItem('loggedInUserDetails'); |
2068 | 2226 | localStorage.clear(); |
2069 | 2227 | $rootScope.CheckUserSession('logout'); |
2070 | - $timeout(function(){ | |
2071 | - document.location = '/'; | |
2072 | - $rootScope.isVisibleLogin = true; | |
2073 | - },50); | |
2074 | - | |
2228 | + | |
2075 | 2229 | } |
2076 | 2230 | $rootScope.LogoutUserSession = function () { |
2077 | 2231 | $rootScope.isSessionTimeout=true; |
... | ... | @@ -2080,7 +2234,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
2080 | 2234 | sessionStorage.removeItem('ExitsCBFileDetail'); |
2081 | 2235 | localStorage.clear(); |
2082 | 2236 | document.location = '/'; |
2083 | - $rootScope.isVisibleLogin = true; | |
2084 | 2237 | } |
2085 | 2238 | |
2086 | 2239 | $rootScope.CheckUserSession = function (tagName) { |
... | ... | @@ -2088,6 +2241,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
2088 | 2241 | //console.log('user login activity tag: '+tagName); |
2089 | 2242 | if($rootScope.userData==undefined) return; |
2090 | 2243 | //incase site user login userid is 0 so then using license id |
2244 | + //use also URL login | |
2091 | 2245 | $rootScope.userStatus.userId=$rootScope.userData.Id==0?$rootScope.userData.LicenseId:$rootScope.userData.Id; |
2092 | 2246 | $rootScope.userStatus.tagName=tagName; |
2093 | 2247 | $rootScope.userStatus.SessionId=$rootScope.userData.SessionId; |
... | ... | @@ -3164,11 +3318,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
3164 | 3318 | var modulePanel = $(document).find("div[id*='ImagePanel']"); |
3165 | 3319 | if (modulePanel != undefined && modulePanel.length>0) { |
3166 | 3320 | //if only one module left |
3167 | - if(slug=='clinical-animations' && $rootScope.userData.mtype!=undefined) | |
3321 | + if(slug=='clinical-animations' && $rootScope.userData.mType!=undefined) | |
3168 | 3322 | { |
3169 | - if($rootScope.userData.mtype.toLowerCase()=='ca') | |
3323 | + if($rootScope.userData.mType.toLowerCase()=='ca') | |
3170 | 3324 | { |
3171 | - $rootScope.siteUrlInfo.mtype=null; | |
3325 | + $rootScope.siteUrlInfo.mType=null; | |
3172 | 3326 | $rootScope.siteUrlInfo.id=null; |
3173 | 3327 | $rootScope.LogoutUser(); |
3174 | 3328 | } | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js
... | ... | @@ -176,6 +176,28 @@ |
176 | 176 | return deferred.promise; |
177 | 177 | }, |
178 | 178 | |
179 | + validateUrlLogin: function (urlInfo) { | |
180 | + var deferred = $q.defer(); | |
181 | + | |
182 | + $http.post('/API/api/UrlLogin', JSON.stringify(urlInfo), { | |
183 | + headers: { | |
184 | + 'Content-Type': 'application/json' | |
185 | + } | |
186 | + }) | |
187 | + .success(function (data, status, headers, config) { | |
188 | + console.log('success') | |
189 | + deferred.resolve(data); | |
190 | + }).error(function (data, status, headers, config) { | |
191 | + console.log('error') | |
192 | + deferred.reject(data); | |
193 | + $rootScope.isVisibleLogin = true; | |
194 | + $rootScope.LoginEnableUI(); | |
195 | + $('#errorMessage').text(data); | |
196 | + $("#messageModal").modal('show'); | |
197 | + | |
198 | + }); | |
199 | + return deferred.promise; | |
200 | + }, | |
179 | 201 | |
180 | 202 | SendMailToUser: function (userInfo, havePassword) { |
181 | 203 | var deferred = $q.defer(); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html
... | ... | @@ -83,7 +83,7 @@ |
83 | 83 | </td> |
84 | 84 | <td ng-if="islinkActive" width="10%"> |
85 | 85 | <div class="tooltipbtn" style="padding:0px !important"> |
86 | - <button id="copylistbtn_{{item._id}}" data-clipboard-text="{{item.copyLink}}" onclick="copylistbtnclick(event)" style="float:right;font-size:11px" >copy embed link</button> | |
86 | + <button id="copylistbtn_{{item._id}}" data-clipboard-text="{{item.copyLink}}" onclick="copylistbtnclick(event)" style="float:right;font-size:11px" >Copy embed link</button> | |
87 | 87 | <span id="spnlist_{{item._id}}" class="tooltiptext"></span></div> |
88 | 88 | </td> |
89 | 89 | </tr> |
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | </td> |
105 | 105 | <td ng-if="islinkActive" width="10%"> |
106 | 106 | <div class="tooltipbtn" style="padding:0px !important"> |
107 | - <button id="copylistbtn_{{item._id}}" data-clipboard-text="{{item.copyLink}}" onclick="copylistbtnclick(event)" style="float:right;font-size:11px" >copy embed link</button> | |
107 | + <button id="copylistbtn_{{item._id}}" data-clipboard-text="{{item.copyLink}}" onclick="copylistbtnclick(event)" style="float:right;font-size:11px" >Copy embed link</button> | |
108 | 108 | <span id="spnlist_{{item._id}}" class="tooltiptext"></span></div> |
109 | 109 | </td> |
110 | 110 | </tr> | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html
1 | 1 | |
2 | 2 | <div class="bodyWrap row container-fluid" > |
3 | - <div class="col-sm-12 col-md-12 pageHeading"> | |
3 | + <div class="col-sm-12 col-md-12 pageHeading" ng-show="!isCAlink"> | |
4 | 4 | <!--<button type="button" class="btn btn-success pull-left toggleBar btn-sm" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"> <i class="fa fa-bars"></i> </button>--> |
5 | 5 | <div class=" pull-left toggleBar toggleHeadingButton tooltip-sidebar" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"> <i class="fa fa-bars"></i> </div> |
6 | 6 | <h4 class="pull-left" data-ng-bind="currentActiveModuleTitle" style="white-space: nowrap;"></h4> | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/widget/MainView.html
1 | 1 | <div class="bodyWrap row" ng-init="ClearIframe()"> |
2 | 2 | <div ng-include="'app/widget/MainMenu.html'" /> |
3 | - <div class="main"> | |
3 | + <div class="main" ng-if="!isCAlink"> | |
4 | 4 | <div class="col-sm-12" style="padding-left:25px; width:99%"> |
5 | 5 | <div align="center" id="MainImage"><img src="content/images/img1.png" alt="" title="" class="img-responsive"></div> |
6 | 6 | <!--<div ng-view></div>--> | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/widget/TopMenu.html
1 | -<div class="collapse navbar-collapse" id="topMenuBar" style="height:50px !important;margin-left:-15px;width:103%"> | |
2 | - <ul class="nav navbar-nav" style="float:left" id="topul1" ng-if="!isCAlink"> | |
1 | +<div class="collapse navbar-collapse" id="topMenuBar" ng-if="!isCAlink" style="height:50px !important;margin-left:-15px;width:103%"> | |
2 | + <ul class="nav navbar-nav" style="float:left" id="topul1"> | |
3 | 3 | <li class="dropdown navbarDropdownItem disableFileMenu" id="fileMenuAnchor" style="float:left"> |
4 | 4 | <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">File<span class="caret"></span></a> |
5 | 5 | <ul class="dropdown-menu"> | ... | ... |
400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js
... | ... | @@ -872,10 +872,18 @@ var jsPanel = { |
872 | 872 | } |
873 | 873 | else |
874 | 874 | { |
875 | + var pnltop=55; | |
875 | 876 | var ht=$(window).outerHeight()-10 - parseInt(panel.option.maximizedMargin.top) - parseInt(panel.option.maximizedMargin.bottom) - 43; |
877 | + if($('.navbar-fixed-top').css('display') == 'none') | |
878 | + { | |
879 | + //Change for CA link | |
880 | + pnltop=1; | |
881 | + var ht=$(window).outerHeight() - parseInt(panel.option.maximizedMargin.top) - parseInt(panel.option.maximizedMargin.bottom); | |
882 | + } | |
883 | + | |
876 | 884 | var wt=$(window).outerWidth() - parseInt(panel.option.maximizedMargin.left) - parseInt(panel.option.maximizedMargin.right)+1; |
877 | 885 | panel.css({ |
878 | - top: parseInt(55),//panel.option.maximizedMargin.top), | |
886 | + top: pnltop,//panel.option.maximizedMargin.top), | |
879 | 887 | left:parseInt(1),//panel.option.maximizedMargin.left |
880 | 888 | width: wt, |
881 | 889 | height: ht, | ... | ... |