Commit a3f0825d877d83f47a713081fef2e780c2d2c693

Authored by Nikita Kulshreshtha
1 parent 6245080e

merged ModestyAdminRefletion

400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs
... ... @@ -33,6 +33,6 @@ namespace AIAHTML5.API.Constants
33 33 public const string GET_LICENSE_BY_SITE_ID = "GetLicenseBySiteId";
34 34 public const string GET_LICENSE_EDITIONS_FOR_MODESTY = "GetLicenseEditionsForModesty";
35 35 public const string GET_PRODUCT_FEATURES = "GetProductFeatures";
36   -
  36 + public const string GET_MODESTY_FOR_THIS_LICENSE = "usp_GetModestyForThisLicense";
37 37 }
38 38 }
39 39 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
... ... @@ -11,7 +11,8 @@ using AIAHTML5.API.Constants;
11 11 using AIAHTML5.API.Models;
12 12 using System.Collections;
13 13  
14   -using System.Data.SqlClient;namespace AIAHTML5.API.Controllers
  14 +using System.Data.SqlClient;
  15 +namespace AIAHTML5.API.Controllers
15 16 {
16 17 public class AuthenticateController : ApiController
17 18 {
... ... @@ -139,12 +140,12 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers
139 140 userInfo.IsBlocked = true;
140 141 userInfo.LoginFailureCauseId = ErrorHelper.E_USER_ID_BLOCKED_24_HRS;
141 142 }
142   -
  143 +
143 144  
144 145 }
145   -
  146 +
146 147 authenticationRepsonse = JsonConvert.SerializeObject(userInfo);
147   -
  148 +
148 149 }
149 150  
150 151 else
... ... @@ -153,7 +154,8 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers
153 154 }
154 155 return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(authenticationRepsonse) };
155 156 }
156   - catch(SqlException e){
  157 + catch (SqlException e)
  158 + {
157 159  
158 160 logger.Fatal("SqlException occured for loginId =" + credentials["username"].ToString() + " and password= " + credentials["password"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace);
159 161  
... ... @@ -162,7 +164,7 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers
162 164 string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
163 165 UserUtility.SendEmail(credentials, supportMailList, "", mailSubject, mailBody);
164 166  
165   - return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.SQL_CONNECTION_ERROR) };
  167 + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.SQL_CONNECTION_ERROR) };
166 168 }
167 169 catch (Exception e)
168 170 {
... ... @@ -173,9 +175,9 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers
173 175 string mailSubject = AIAConstants.EXCEPTION_IN_AIAHTML5_MAIL_SUBJECT;
174 176 string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace;
175 177 UserUtility.SendEmail(credentials, supportMailList, "", mailSubject, mailBody);
176   -
177   - return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) };
178   -
  178 +
  179 + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) };
  180 +
179 181 }
180 182  
181 183 }
... ... @@ -191,7 +193,7 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers
191 193 userInfo.EditionId = editionId;
192 194  
193 195 //if (userInfo.UserType == AIAHTML5.API.Models.User.SUPER_ADMIN)
194   - if(userInfo.LicenseId == 0)
  196 + if (userInfo.LicenseId == 0)
195 197 {
196 198 userInfo.Modules = AIAHTML5.API.Models.Users.getAllModulesList();
197 199  
... ... @@ -202,8 +204,9 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers
202 204 {
203 205 CheckLicenseStatus(userInfo);
204 206  
205   - if(!userInfo.IsSubscriptionExpired){
206   - GetModulesBasedOnLicense(userInfo,false);
  207 + if (!userInfo.IsSubscriptionExpired)
  208 + {
  209 + GetModulesBasedOnLicense(userInfo, false);
207 210 }
208 211 }
209 212 }
... ... @@ -235,50 +238,58 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers
235 238 isLicenseExpired = AIAHTML5.API.Models.Users.checkIfLicenseExpired(userInfo.LicenseSubscriptions, out expirationDate);
236 239 }
237 240  
238   - if (isLicenseExpired)
  241 + if (isLicenseExpired)
239 242 {
240 243 userInfo.IsSubscriptionExpired = isLicenseExpired;
241 244 userInfo.SubscriptionExpirationDate = expirationDate;
242 245 }
  246 + else
  247 + {
  248 + //check Modesty settings for this license
  249 +
  250 + userInfo.IsModestyOn = AIAHTML5.API.Models.Users.IsModestyActiveForThisLicense(userInfo.LicenseId);
  251 +
  252 +
  253 + }
243 254 }
244   -
  255 +
245 256 else
246 257 {
247   - ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType));
248   - logger.Debug("userInfo.LicenseInfo is null for userInfo.LicenseId= "+userInfo.LicenseId);
  258 + ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType));
  259 + logger.Debug("userInfo.LicenseInfo is null for userInfo.LicenseId= " + userInfo.LicenseId);
249 260 }
250 261 }
251 262  
252 263 private static void GetModulesBasedOnLicense(User userInfo, bool isLicenseExpired)
253 264 {
254   -
255   - //05.6.1
256   - if (userInfo.LicenseInfo.IsActive)
  265 +
  266 + //05.6.1
  267 + if (userInfo.LicenseInfo.IsActive)
  268 + {
  269 + if (!userInfo.LicenseInfo.IsTermAccepted)
257 270 {
258   - if (!userInfo.LicenseInfo.IsTermAccepted)
  271 + ArrayList termsList = AIAHTML5.API.Models.Users.getTermsAndConditions();
  272 + foreach (Hashtable item in termsList)
259 273 {
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);
  274 + userInfo.TermsAndConditionsTitle = item[AIAConstants.KEY_TITLE].ToString();
  275 + userInfo.TermsAndConditionsText = item[AIAConstants.KEY_CONTENT].ToString();
273 276 }
274 277 }
275 278 else
276 279 {
277   - userInfo.LoginFailureCauseId = ErrorHelper.E_LICENCE_IS_INACTIVE;
  280 + userInfo.Modules = AIAHTML5.API.Models.Users.getModuleListByLicenseId(userInfo.LicenseId);
278 281  
  282 + //Insert user login detail
  283 + AIAHTML5.API.Models.Users.insertLoginDetails(userInfo.Id);
279 284 }
280   - }
281   -
  285 + }
  286 + else
  287 + {
  288 + userInfo.LoginFailureCauseId = ErrorHelper.E_LICENCE_IS_INACTIVE;
  289 +
  290 + }
  291 + }
  292 +
282 293  
283 294  
284 295 // PUT api/authenticate/5
... ...
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
... ... @@ -1126,5 +1126,42 @@ namespace AIAHTML5.API.Models
1126 1126  
1127 1127 return objFeatures;
1128 1128 }
  1129 +
  1130 + internal Boolean GetModestyInfo(int LicenseId)
  1131 + {
  1132 + logger.Debug(" inside GetModestyInfo for licenseId= " + LicenseId);
  1133 +
  1134 + Boolean isModestyOn = false;
  1135 +
  1136 + DataTable dt = null;
  1137 +
  1138 + SqlConnection conn = new SqlConnection(dbConnectionString);
  1139 + SqlCommand cmd = new SqlCommand();
  1140 + cmd.Connection = conn;
  1141 + cmd.CommandText = DBConstants.GET_MODESTY_FOR_THIS_LICENSE;
  1142 + cmd.CommandType = CommandType.StoredProcedure;
  1143 + cmd.Parameters.AddWithValue("@licenseId", LicenseId);
  1144 + SqlDataAdapter da = new SqlDataAdapter();
  1145 + da.SelectCommand = cmd;
  1146 + dt = new DataTable();
  1147 + da.Fill(dt);
  1148 +
  1149 + if (dt != null && dt.Rows.Count > 0)
  1150 + {
  1151 + string IsModesty = dt.Rows[0]["IsModesty"].ToString();
  1152 + if (IsModesty == "True")
  1153 + {
  1154 + isModestyOn = true;
  1155 + }
  1156 + else
  1157 + {
  1158 + isModestyOn = false;
  1159 + }
  1160 + }
  1161 +
  1162 +
  1163 + return isModestyOn;
  1164 + }
  1165 +
1129 1166 }
1130 1167 }
1131 1168 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.API/Models/User.cs
... ... @@ -35,7 +35,7 @@ namespace AIAHTML5.API.Models
35 35 public int LicenseId { get; set; }
36 36 public int EditionId { get; set; }
37 37 public Int16 LoginFailureCauseId { get; set; }
38   -
  38 + public bool IsModestyOn { get; set; }
39 39 public ArrayList Modules { get; set; }
40 40  
41 41 public License LicenseInfo { get; set; }
... ...
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
... ... @@ -598,5 +598,12 @@ namespace AIAHTML5.API.Models
598 598 //return intUserId;
599 599 return userInfo;
600 600 }
  601 +
  602 + internal static Boolean IsModestyActiveForThisLicense(int LicenseId)
  603 + {
  604 + DBModel objModel = new DBModel();
  605 + bool IsModestyOn = objModel.GetModestyInfo(LicenseId);
  606 + return IsModestyOn;
  607 + }
601 608 }
602 609 }
603 610 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj
... ... @@ -39,6 +39,7 @@
39 39 <WarningLevel>4</WarningLevel>
40 40 </PropertyGroup>
41 41 <ItemGroup>
  42 + <Content Include="AdobePlayerDownloadLink.html" />
42 43 <Content Include="app\controllers\3dAController.js" />
43 44 <Content Include="app\controllers\ADAMImgController.js" />
44 45 <Content Include="app\controllers\LinkController.js" />
... ...
400-SOURCECODE/AIAHTML5.Web/AdobePlayerDownloadLink.html 0 → 100644
  1 +<!doctype html>
  2 +<html lang="en">
  3 +<head>
  4 + <!-- Required meta tags -->
  5 + <meta charset="utf-8">
  6 + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7 + <title>Ebix</title>
  8 +</head>
  9 +<style>
  10 + .wrapper .container-fluid {
  11 + width: 100%;
  12 + background: #818d43;
  13 + }
  14 +
  15 + .wrapper .container {
  16 + width: 980px;
  17 + margin: 0 auto;
  18 + }
  19 +
  20 + .wrapper h3 {
  21 + background: #818d43;
  22 + margin: 0;
  23 + padding: 20px 0;
  24 + color: #fff;
  25 + font-size: 20px;
  26 + }
  27 +
  28 + dl dt {
  29 + font-size: 18px;
  30 + font-weight: bold;
  31 + padding: 10px 0 5px 0;
  32 + }
  33 +
  34 + dl dd {
  35 + font-size: 16px;
  36 + font-weight: 500;
  37 + line-height: 28px;
  38 + padding: 5px 0;
  39 + margin-left: 0;
  40 + }
  41 +
  42 + dl dd a {
  43 + color: #084d6c;
  44 + }
  45 +</style>
  46 +<body style="font-family:arial; margin:0;">
  47 + <div class="wrapper">
  48 + <div class="container-fluid">
  49 + <div class="container">
  50 + <h3>CURRICULUM BUILDER</h3>
  51 + </div>
  52 + </div>
  53 + <div class="container">
  54 + <div style="font-size:16px; margin-top:40px; margin-bottom:40px; line-height:26px;">
  55 + Adobe Flash will still be needed to access Curriculum Builder module for now.
  56 + In order to utilize this aspect of AIA you will need to enable Adobe Flash Player to be used within your browser.
  57 + Below please find the appropriate browser that you are using and follow the
  58 + instructions to enable Flash Player and return back to
  59 + the Curriculum Builder module to access the module.
  60 + </div>
  61 + <dl>
  62 + <dt>Chrome –</dt>
  63 + <dd><a href="https://support.google.com/chrome/answer/6258784">https://support.google.com/chrome/answer/6258784</a></dd>
  64 + <dt>FireFox –</dt>
  65 + <dd><a href="https://support.mozilla.org/en-US/kb/set-adobe-flash-click-play-firefox">https://support.mozilla.org/en-US/kb/set-adobe-flash-click-play-firefox</a></dd>
  66 + <dt>Safari –</dt>
  67 + <dd><a href="https://helpx.adobe.com/flash-player/kb/enabling-flash-player-safari.html">https://helpx.adobe.com/flash-player/kb/enabling-flash-player-safari.html</a></dd>
  68 + <dt>Edge –</dt>
  69 + <dd><a href="https://helpx.adobe.com/flash-player/kb/flash-player-issues-windows-10-edge.html">https://helpx.adobe.com/flash-player/kb/flash-player-issues-windows-10-edge.html</a></dd>
  70 + <dt>Internet Explorer –</dt>
  71 + <dd><a href="https://helpx.adobe.com/flash-player/kb/flash-player-issues-windows-10-ie.html">https://helpx.adobe.com/flash-player/kb/flash-player-issues-windows-10-ie.html</a></dd>
  72 + </dl>
  73 + </div>
  74 + </div>
  75 +</body>
  76 +</html>
0 77 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -227,6 +227,41 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A
227 227 }
228 228 else {
229 229  
  230 + //code for modesty setting
  231 + if (result.LicenseInfo != null) {
  232 + if (result.IsModestyOn) {
  233 + $rootScope.isModestyOn = true;
  234 + $rootScope.isModestyOff = false;
  235 + localStorage.setItem("globalModesty", "Y");
  236 + $rootScope.formsetting = {
  237 + ethnicity: null,
  238 + modesty: "Y"
  239 + }
  240 + $rootScope.UpdateAndCloseSetting($rootScope.formsetting)
  241 + }
  242 + else {
  243 + $rootScope.isModestyOn = false;
  244 + $rootScope.isModestyOff = true;
  245 + localStorage.setItem("globalModesty", "N");
  246 + $rootScope.formsetting = {
  247 + ethnicity: null,
  248 + modesty: "N"
  249 + }
  250 + $rootScope.UpdateAndCloseSetting($rootScope.formsetting)
  251 + }
  252 + }
  253 + else {
  254 + $rootScope.isModestyOn = true;
  255 + $rootScope.isModestyOff = false;
  256 + localStorage.setItem("globalModesty", "Y");
  257 + $rootScope.formsetting = {
  258 + ethnicity: null,
  259 + modesty: "Y"
  260 + }
  261 + $rootScope.UpdateAndCloseSetting($rootScope.formsetting)
  262 + }
  263 + //code for modesty setting
  264 +
230 265 if (typeof result.LoginId != undefined || result.LoginId != "" || result.LoginId != null) {
231 266  
232 267 if ($("#messageModal").length > 0) {
... ...
500-DBDump/AIA-StoredProcedures/usp_GetModestyForThisLicense.sql 0 → 100644
1 1 Binary files /dev/null and b/500-DBDump/AIA-StoredProcedures/usp_GetModestyForThisLicense.sql differ
... ...