Commit 6245080eac5c28fd2c9aa6bc987f5ce55c16ddf2

Authored by Nikita Kulshreshtha
1 parent ada01f0b

commit

400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
1 -using Newtonsoft.Json;  
2 -using Newtonsoft.Json.Linq;  
3 -using System;  
4 -using System.Collections.Generic;  
5 -using System.Linq;  
6 -using System.Net;  
7 -using System.Net.Http;  
8 -using System.Web.Http;  
9 -using log4net;  
10 -using AIAHTML5.API.Constants;  
11 -using AIAHTML5.API.Models;  
12 -using System.Collections;  
13 -  
14 -using System.Data.SqlClient;namespace AIAHTML5.API.Controllers  
15 -{  
16 - public class AuthenticateController : ApiController  
17 - {  
18 - // GET api/authenticate  
19 - public IEnumerable<string> Get()  
20 - {  
21 - return new string[] { "value1", "value2" };  
22 - }  
23 -  
24 - // GET api/authenticate/5  
25 - public string Get(int id)  
26 - {  
27 - return "value";  
28 - }  
29 -  
30 - // POST api/authenticate  
31 - public HttpResponseMessage Post([FromBody]JObject credentials)  
32 - {  
33 - ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType));  
34 - logger.Debug("inside POST");  
35 -  
36 - dynamic authenticationRepsonse;  
37 - DateTime blockTime;  
38 - bool isUserBlocked;  
39 -  
40 - try  
41 - {  
42 -  
43 - //01.get the user detail to autheticate the user  
44 - User userInfo = AIAHTML5.API.Models.Users.getUserDetails(credentials);  
45 -  
46 - if (userInfo != null)  
47 - {  
48 - // 02 Check user is authenticated or not by login credential match  
49 - bool isUserAuthenticated = AIAHTML5.API.Models.Users.checkUserAuthenticity(credentials, userInfo);  
50 -  
51 - if (isUserAuthenticated)  
52 - {  
53 - if (userInfo.IsActive)  
54 - {  
55 - //03. check if user is blocked  
56 - isUserBlocked = AIAHTML5.API.Models.Users.checkUserBlockStatus(userInfo.Id, out blockTime);  
57 -  
58 - if (!isUserBlocked)  
59 - {  
60 - //04.delete past wrong login attempts of user  
61 - int wrongAttemptDeteledCount = AIAHTML5.API.Models.Users.deletePastWrongAttempts(userInfo.Id);  
62 - if (wrongAttemptDeteledCount < 0)  
63 - {  
64 - logger.Fatal("Unable to delete past wrong login attempts for userId= " + userInfo.Id);  
65 - }  
66 - //05.  
67 - GetModulesBasedOnUserType(userInfo);  
68 -  
69 - // authenticationRepsonse = JsonConvert.SerializeObject(userInfo);  
70 - }  
71 -  
72 - else  
73 - {  
74 -  
75 - //compare block time of user with current time if user is blocked  
76 - DateTime blockDuration = blockTime.AddDays(1);  
77 - var difference = DateTime.Compare(DateTime.Now, blockDuration);  
78 -  
79 - //check if credentials are valid credentials  
80 - //bool isCorrectLoginId, isCorrectPassword;  
81 - //AIAHTML5.API.Models.Users.isCredentialCorrect(credentials, userInfo, out isCorrectLoginId, out isCorrectPassword);  
82 -  
83 - if (difference >= 0)  
84 - {  
85 - //means 24 hours block time is finished  
86 - userInfo.IsBlocked = false;  
87 -  
88 - int wrongAttemptDeteledCount = AIAHTML5.API.Models.Users.deletePastWrongAttempts(userInfo.Id);  
89 - if (wrongAttemptDeteledCount < 0)  
90 - {  
91 - logger.Fatal("Unable to delete past wrong login attempts for userId= " + userInfo.Id);  
92 - }  
93 -  
94 - //05. Now get the module list- for ADMIN (superadmin/ general admin) by default all module loads  
95 - GetModulesBasedOnUserType(userInfo);  
96 -  
97 - }  
98 - else  
99 - {  
100 - userInfo.LoginFailureCauseId = ErrorHelper.E_USER_ID_BLOCKED_24_HRS;  
101 - }  
102 - }  
103 - }  
104 - else  
105 - {  
106 - //CODE REVIW: validate that is this tarnslated by UI because we need to show message to user if he is inactive  
107 - userInfo.LoginFailureCauseId = ErrorHelper.E_USER_NOT_ACTIVE;  
108 -  
109 - //05.4 check the License expiration irespective of either user is active  
110 - //or not because on AIA, we shows the License expiration message  
111 - //for inactive users too  
112 -  
113 - CheckLicenseStatus(userInfo);  
114 -  
115 - }  
116 - }  
117 -  
118 - else  
119 - {  
120 - //this come in picture when user input wrong passowrd  
121 -  
122 - //get wrong attempt count of user  
123 - int previousIncorrectLoginAttempts = AIAHTML5.API.Models.Users.checkNoOfWrongAttempts(userInfo.Id);  
124 - userInfo.IncorrectLoginAttemptCount = previousIncorrectLoginAttempts + 1;  
125 - userInfo.LoginFailureCauseId = ErrorHelper.E_PASSWORD_NOT_MATCH;  
126 -  
127 - //01. insert wrong attempt in dtabase  
128 - int updateCount = AIAHTML5.API.Models.Users.saveWrongAttemptOfUser(userInfo.Id, previousIncorrectLoginAttempts);  
129 -  
130 - if (updateCount < 0)  
131 - {  
132 - //Put the log in log file  
133 - logger.Fatal("Unable to Update past wrong login attempts for userId= " + userInfo.Id);  
134 - }  
135 - //else  
136 - //{  
137 - if (userInfo.IncorrectLoginAttemptCount > 4)  
138 - {  
139 - userInfo.IsBlocked = true;  
140 - userInfo.LoginFailureCauseId = ErrorHelper.E_USER_ID_BLOCKED_24_HRS;  
141 - }  
142 -  
143 -  
144 - }  
145 -  
146 - authenticationRepsonse = JsonConvert.SerializeObject(userInfo);  
147 -  
148 - }  
149 -  
150 - else  
151 - {  
152 - authenticationRepsonse = AIAConstants.USER_NOT_FOUND;  
153 - }  
154 - return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(authenticationRepsonse) };  
155 - }  
156 - catch(SqlException e){  
157 -  
158 - logger.Fatal("SqlException occured for loginId =" + credentials["username"].ToString() + " and password= " + credentials["password"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace);  
159 -  
160 - ArrayList supportMailList = UserUtility.GetSupportMailList();  
161 - string mailSubject = AIAConstants.SQL_CONNECTION_ERROR_MAIL_SUBJECT;  
162 - string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;  
163 - UserUtility.SendEmail(credentials, supportMailList, "", mailSubject, mailBody);  
164 -  
165 - return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.SQL_CONNECTION_ERROR) };  
166 - }  
167 - catch (Exception e)  
168 - {  
169 -  
170 - logger.Fatal("Exception occured for loginId =" + credentials["username"].ToString() + " and password= " + credentials["password"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace);  
171 -  
172 - ArrayList supportMailList = UserUtility.GetSupportMailList();  
173 - string mailSubject = AIAConstants.EXCEPTION_IN_AIAHTML5_MAIL_SUBJECT;  
174 - string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;  
175 - UserUtility.SendEmail(credentials, supportMailList, "", mailSubject, mailBody);  
176 -  
177 - return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) };  
178 -  
179 - }  
180 -  
181 - }  
182 -  
183 - private static void GetModulesBasedOnUserType(User userInfo)  
184 - {  
185 - //based on old .net code(AIA flex), we get modules based on licenseId if licenseid>0.  
186 - //we verified in database that only superadmin has no licenseid so getting all modules for supeadmin  
187 - int licenseId, editionId;  
188 - AIAHTML5.API.Models.Users.getLicenseIdForThisUser(userInfo.Id, out licenseId, out editionId);  
189 -  
190 - userInfo.LicenseId = licenseId;  
191 - userInfo.EditionId = editionId;  
192 -  
193 - //if (userInfo.UserType == AIAHTML5.API.Models.User.SUPER_ADMIN)  
194 - if(userInfo.LicenseId == 0)  
195 - {  
196 - userInfo.Modules = AIAHTML5.API.Models.Users.getAllModulesList();  
197 -  
198 - //Insert user login detail  
199 - AIAHTML5.API.Models.Users.insertLoginDetails(userInfo.Id);  
200 - }  
201 - else  
202 - {  
203 - CheckLicenseStatus(userInfo);  
204 -  
205 - if(!userInfo.IsSubscriptionExpired){  
206 - GetModulesBasedOnLicense(userInfo,false);  
207 - }  
208 - }  
209 - }  
210 -  
211 - private static void CheckLicenseStatus(User userInfo)  
212 - {  
213 - //05.1 For normal user need to get the license details, get the license id for authenticated user  
214 - //int licenseId, editionId;  
215 - //AIAHTML5.API.Models.Users.getLicenseIdForThisUser(userInfo.Id, out licenseId, out editionId);  
216 -  
217 - //userInfo.LicenseId = licenseId;  
218 - //userInfo.EditionId = editionId;  
219 -  
220 - //05.2 get license details  
221 - userInfo.LicenseInfo = AIAHTML5.API.Models.Users.getLicenseDetails(userInfo.LicenseId);  
222 -  
223 - if (userInfo.LicenseInfo != null)  
224 - {  
225 - //05.3 get licenseSubscription details  
226 - userInfo.LicenseSubscriptions = AIAHTML5.API.Models.Users.getLicenseSubscriptionDetails(userInfo.LicenseId);  
227 -  
228 - //05.4 check the License expiration irespective of either user is active or not because on AIA  
229 - //we shows the License expiration message for inactive users too  
230 - string expirationDate = null;  
231 - bool isLicenseExpired = false;  
232 -  
233 - if (userInfo.LicenseSubscriptions != null)  
234 - {  
235 - isLicenseExpired = AIAHTML5.API.Models.Users.checkIfLicenseExpired(userInfo.LicenseSubscriptions, out expirationDate);  
236 - }  
237 -  
238 - if (isLicenseExpired)  
239 - {  
240 - userInfo.IsSubscriptionExpired = isLicenseExpired;  
241 - userInfo.SubscriptionExpirationDate = expirationDate;  
242 - }  
243 - }  
244 -  
245 - else  
246 - {  
247 - ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType));  
248 - logger.Debug("userInfo.LicenseInfo is null for userInfo.LicenseId= "+userInfo.LicenseId);  
249 - }  
250 - }  
251 -  
252 - private static void GetModulesBasedOnLicense(User userInfo, bool isLicenseExpired)  
253 - {  
254 -  
255 - //05.6.1  
256 - if (userInfo.LicenseInfo.IsActive)  
257 - {  
258 - if (!userInfo.LicenseInfo.IsTermAccepted)  
259 - {  
260 - ArrayList termsList = AIAHTML5.API.Models.Users.getTermsAndConditions();  
261 - foreach (Hashtable item in termsList)  
262 - {  
263 - userInfo.TermsAndConditionsTitle = item[AIAConstants.KEY_TITLE].ToString();  
264 - userInfo.TermsAndConditionsText = item[AIAConstants.KEY_CONTENT].ToString();  
265 - }  
266 - }  
267 - else  
268 - {  
269 - userInfo.Modules = AIAHTML5.API.Models.Users.getModuleListByLicenseId(userInfo.LicenseId);  
270 -  
271 - //Insert user login detail  
272 - AIAHTML5.API.Models.Users.insertLoginDetails(userInfo.Id);  
273 - }  
274 - }  
275 - else  
276 - {  
277 - userInfo.LoginFailureCauseId = ErrorHelper.E_LICENCE_IS_INACTIVE;  
278 -  
279 - }  
280 - }  
281 -  
282 -  
283 -  
284 - // PUT api/authenticate/5  
285 - public void Put(int id, [FromBody]string value)  
286 - {  
287 - }  
288 -  
289 - // DELETE api/authenticate/5  
290 - public void Delete(int id)  
291 - {  
292 - }  
293 - } 1 +using Newtonsoft.Json;
  2 +using Newtonsoft.Json.Linq;
  3 +using System;
  4 +using System.Collections.Generic;
  5 +using System.Linq;
  6 +using System.Net;
  7 +using System.Net.Http;
  8 +using System.Web.Http;
  9 +using log4net;
  10 +using AIAHTML5.API.Constants;
  11 +using AIAHTML5.API.Models;
  12 +using System.Collections;
  13 +
  14 +using System.Data.SqlClient;namespace AIAHTML5.API.Controllers
  15 +{
  16 + public class AuthenticateController : ApiController
  17 + {
  18 + // GET api/authenticate
  19 + public IEnumerable<string> Get()
  20 + {
  21 + return new string[] { "value1", "value2" };
  22 + }
  23 +
  24 + // GET api/authenticate/5
  25 + public string Get(int id)
  26 + {
  27 + return "value";
  28 + }
  29 +
  30 + // POST api/authenticate
  31 + public HttpResponseMessage Post([FromBody]JObject credentials)
  32 + {
  33 + ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType));
  34 + logger.Debug("inside POST");
  35 +
  36 + dynamic authenticationRepsonse;
  37 + DateTime blockTime;
  38 + bool isUserBlocked;
  39 +
  40 + try
  41 + {
  42 +
  43 + //01.get the user detail to autheticate the user
  44 + User userInfo = AIAHTML5.API.Models.Users.getUserDetails(credentials);
  45 +
  46 + if (userInfo != null)
  47 + {
  48 + // 02 Check user is authenticated or not by login credential match
  49 + bool isUserAuthenticated = AIAHTML5.API.Models.Users.checkUserAuthenticity(credentials, userInfo);
  50 +
  51 + if (isUserAuthenticated)
  52 + {
  53 + if (userInfo.IsActive)
  54 + {
  55 + //03. check if user is blocked
  56 + isUserBlocked = AIAHTML5.API.Models.Users.checkUserBlockStatus(userInfo.Id, out blockTime);
  57 +
  58 + if (!isUserBlocked)
  59 + {
  60 + //04.delete past wrong login attempts of user
  61 + int wrongAttemptDeteledCount = AIAHTML5.API.Models.Users.deletePastWrongAttempts(userInfo.Id);
  62 + if (wrongAttemptDeteledCount < 0)
  63 + {
  64 + logger.Fatal("Unable to delete past wrong login attempts for userId= " + userInfo.Id);
  65 + }
  66 + //05.
  67 + GetModulesBasedOnUserType(userInfo);
  68 +
  69 + // authenticationRepsonse = JsonConvert.SerializeObject(userInfo);
  70 + }
  71 +
  72 + else
  73 + {
  74 +
  75 + //compare block time of user with current time if user is blocked
  76 + DateTime blockDuration = blockTime.AddDays(1);
  77 + var difference = DateTime.Compare(DateTime.Now, blockDuration);
  78 +
  79 + //check if credentials are valid credentials
  80 + //bool isCorrectLoginId, isCorrectPassword;
  81 + //AIAHTML5.API.Models.Users.isCredentialCorrect(credentials, userInfo, out isCorrectLoginId, out isCorrectPassword);
  82 +
  83 + if (difference >= 0)
  84 + {
  85 + //means 24 hours block time is finished
  86 + userInfo.IsBlocked = false;
  87 +
  88 + int wrongAttemptDeteledCount = AIAHTML5.API.Models.Users.deletePastWrongAttempts(userInfo.Id);
  89 + if (wrongAttemptDeteledCount < 0)
  90 + {
  91 + logger.Fatal("Unable to delete past wrong login attempts for userId= " + userInfo.Id);
  92 + }
  93 +
  94 + //05. Now get the module list- for ADMIN (superadmin/ general admin) by default all module loads
  95 + GetModulesBasedOnUserType(userInfo);
  96 +
  97 + }
  98 + else
  99 + {
  100 + userInfo.LoginFailureCauseId = ErrorHelper.E_USER_ID_BLOCKED_24_HRS;
  101 + }
  102 + }
  103 + }
  104 + else
  105 + {
  106 + //CODE REVIW: validate that is this tarnslated by UI because we need to show message to user if he is inactive
  107 + userInfo.LoginFailureCauseId = ErrorHelper.E_USER_NOT_ACTIVE;
  108 +
  109 + //05.4 check the License expiration irespective of either user is active
  110 + //or not because on AIA, we shows the License expiration message
  111 + //for inactive users too
  112 +
  113 + CheckLicenseStatus(userInfo);
  114 +
  115 + }
  116 + }
  117 +
  118 + else
  119 + {
  120 + //this come in picture when user input wrong passowrd
  121 +
  122 + //get wrong attempt count of user
  123 + int previousIncorrectLoginAttempts = AIAHTML5.API.Models.Users.checkNoOfWrongAttempts(userInfo.Id);
  124 + userInfo.IncorrectLoginAttemptCount = previousIncorrectLoginAttempts + 1;
  125 + userInfo.LoginFailureCauseId = ErrorHelper.E_PASSWORD_NOT_MATCH;
  126 +
  127 + //01. insert wrong attempt in dtabase
  128 + int updateCount = AIAHTML5.API.Models.Users.saveWrongAttemptOfUser(userInfo.Id, previousIncorrectLoginAttempts);
  129 +
  130 + if (updateCount < 0)
  131 + {
  132 + //Put the log in log file
  133 + logger.Fatal("Unable to Update past wrong login attempts for userId= " + userInfo.Id);
  134 + }
  135 + //else
  136 + //{
  137 + if (userInfo.IncorrectLoginAttemptCount > 4)
  138 + {
  139 + userInfo.IsBlocked = true;
  140 + userInfo.LoginFailureCauseId = ErrorHelper.E_USER_ID_BLOCKED_24_HRS;
  141 + }
  142 +
  143 +
  144 + }
  145 +
  146 + authenticationRepsonse = JsonConvert.SerializeObject(userInfo);
  147 +
  148 + }
  149 +
  150 + else
  151 + {
  152 + authenticationRepsonse = AIAConstants.USER_NOT_FOUND;
  153 + }
  154 + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(authenticationRepsonse) };
  155 + }
  156 + catch(SqlException e){
  157 +
  158 + logger.Fatal("SqlException occured for loginId =" + credentials["username"].ToString() + " and password= " + credentials["password"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace);
  159 +
  160 + ArrayList supportMailList = UserUtility.GetSupportMailList();
  161 + string mailSubject = AIAConstants.SQL_CONNECTION_ERROR_MAIL_SUBJECT;
  162 + string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
  163 + UserUtility.SendEmail(credentials, supportMailList, "", mailSubject, mailBody);
  164 +
  165 + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.SQL_CONNECTION_ERROR) };
  166 + }
  167 + catch (Exception e)
  168 + {
  169 +
  170 + logger.Fatal("Exception occured for loginId =" + credentials["username"].ToString() + " and password= " + credentials["password"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace);
  171 +
  172 + ArrayList supportMailList = UserUtility.GetSupportMailList();
  173 + string mailSubject = AIAConstants.EXCEPTION_IN_AIAHTML5_MAIL_SUBJECT;
  174 + string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
  175 + UserUtility.SendEmail(credentials, supportMailList, "", mailSubject, mailBody);
  176 +
  177 + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) };
  178 +
  179 + }
  180 +
  181 + }
  182 +
  183 + private static void GetModulesBasedOnUserType(User userInfo)
  184 + {
  185 + //based on old .net code(AIA flex), we get modules based on licenseId if licenseid>0.
  186 + //we verified in database that only superadmin has no licenseid so getting all modules for supeadmin
  187 + int licenseId, editionId;
  188 + AIAHTML5.API.Models.Users.getLicenseIdForThisUser(userInfo.Id, out licenseId, out editionId);
  189 +
  190 + userInfo.LicenseId = licenseId;
  191 + userInfo.EditionId = editionId;
  192 +
  193 + //if (userInfo.UserType == AIAHTML5.API.Models.User.SUPER_ADMIN)
  194 + if(userInfo.LicenseId == 0)
  195 + {
  196 + userInfo.Modules = AIAHTML5.API.Models.Users.getAllModulesList();
  197 +
  198 + //Insert user login detail
  199 + AIAHTML5.API.Models.Users.insertLoginDetails(userInfo.Id);
  200 + }
  201 + else
  202 + {
  203 + CheckLicenseStatus(userInfo);
  204 +
  205 + if(!userInfo.IsSubscriptionExpired){
  206 + GetModulesBasedOnLicense(userInfo,false);
  207 + }
  208 + }
  209 + }
  210 +
  211 + private static void CheckLicenseStatus(User userInfo)
  212 + {
  213 + //05.1 For normal user need to get the license details, get the license id for authenticated user
  214 + //int licenseId, editionId;
  215 + //AIAHTML5.API.Models.Users.getLicenseIdForThisUser(userInfo.Id, out licenseId, out editionId);
  216 +
  217 + //userInfo.LicenseId = licenseId;
  218 + //userInfo.EditionId = editionId;
  219 +
  220 + //05.2 get license details
  221 + userInfo.LicenseInfo = AIAHTML5.API.Models.Users.getLicenseDetails(userInfo.LicenseId);
  222 +
  223 + if (userInfo.LicenseInfo != null)
  224 + {
  225 + //05.3 get licenseSubscription details
  226 + userInfo.LicenseSubscriptions = AIAHTML5.API.Models.Users.getLicenseSubscriptionDetails(userInfo.LicenseId);
  227 +
  228 + //05.4 check the License expiration irespective of either user is active or not because on AIA
  229 + //we shows the License expiration message for inactive users too
  230 + string expirationDate = null;
  231 + bool isLicenseExpired = false;
  232 +
  233 + if (userInfo.LicenseSubscriptions != null)
  234 + {
  235 + isLicenseExpired = AIAHTML5.API.Models.Users.checkIfLicenseExpired(userInfo.LicenseSubscriptions, out expirationDate);
  236 + }
  237 +
  238 + if (isLicenseExpired)
  239 + {
  240 + userInfo.IsSubscriptionExpired = isLicenseExpired;
  241 + userInfo.SubscriptionExpirationDate = expirationDate;
  242 + }
  243 + }
  244 +
  245 + else
  246 + {
  247 + ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType));
  248 + logger.Debug("userInfo.LicenseInfo is null for userInfo.LicenseId= "+userInfo.LicenseId);
  249 + }
  250 + }
  251 +
  252 + private static void GetModulesBasedOnLicense(User userInfo, bool isLicenseExpired)
  253 + {
  254 +
  255 + //05.6.1
  256 + if (userInfo.LicenseInfo.IsActive)
  257 + {
  258 + if (!userInfo.LicenseInfo.IsTermAccepted)
  259 + {
  260 + ArrayList termsList = AIAHTML5.API.Models.Users.getTermsAndConditions();
  261 + foreach (Hashtable item in termsList)
  262 + {
  263 + userInfo.TermsAndConditionsTitle = item[AIAConstants.KEY_TITLE].ToString();
  264 + userInfo.TermsAndConditionsText = item[AIAConstants.KEY_CONTENT].ToString();
  265 + }
  266 + }
  267 + else
  268 + {
  269 + userInfo.Modules = AIAHTML5.API.Models.Users.getModuleListByLicenseId(userInfo.LicenseId);
  270 +
  271 + //Insert user login detail
  272 + AIAHTML5.API.Models.Users.insertLoginDetails(userInfo.Id);
  273 + }
  274 + }
  275 + else
  276 + {
  277 + userInfo.LoginFailureCauseId = ErrorHelper.E_LICENCE_IS_INACTIVE;
  278 +
  279 + }
  280 + }
  281 +
  282 +
  283 +
  284 + // PUT api/authenticate/5
  285 + public void Put(int id, [FromBody]string value)
  286 + {
  287 + }
  288 +
  289 + // DELETE api/authenticate/5
  290 + public void Delete(int id)
  291 + {
  292 + }
  293 + }
294 } 294 }
295 \ No newline at end of file 295 \ No newline at end of file