diff --git a/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs b/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs index f256911..429572e 100644 --- a/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs +++ b/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs @@ -33,6 +33,6 @@ namespace AIAHTML5.API.Constants public const string GET_LICENSE_BY_SITE_ID = "GetLicenseBySiteId"; public const string GET_LICENSE_EDITIONS_FOR_MODESTY = "GetLicenseEditionsForModesty"; public const string GET_PRODUCT_FEATURES = "GetProductFeatures"; - + public const string GET_MODESTY_FOR_THIS_LICENSE = "usp_GetModestyForThisLicense"; } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs index 2ceb681..2bb6536 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs @@ -11,7 +11,8 @@ using AIAHTML5.API.Constants; using AIAHTML5.API.Models; using System.Collections; -using System.Data.SqlClient;namespace AIAHTML5.API.Controllers +using System.Data.SqlClient; +namespace AIAHTML5.API.Controllers { public class AuthenticateController : ApiController { @@ -139,12 +140,12 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers userInfo.IsBlocked = true; userInfo.LoginFailureCauseId = ErrorHelper.E_USER_ID_BLOCKED_24_HRS; } - + } - + authenticationRepsonse = JsonConvert.SerializeObject(userInfo); - + } else @@ -153,7 +154,8 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers } return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(authenticationRepsonse) }; } - catch(SqlException e){ + catch (SqlException e) + { logger.Fatal("SqlException occured for loginId =" + credentials["username"].ToString() + " and password= " + credentials["password"].ToString() + "Exception= " + e.Message + ", STACKTRACE: " + e.StackTrace); @@ -162,7 +164,7 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace; UserUtility.SendEmail(credentials, supportMailList, "", mailSubject, mailBody); - return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.SQL_CONNECTION_ERROR) }; + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.SQL_CONNECTION_ERROR) }; } catch (Exception e) { @@ -173,9 +175,9 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers string mailSubject = AIAConstants.EXCEPTION_IN_AIAHTML5_MAIL_SUBJECT; string mailBody = "MESSAGE: " + e.Message + ", STACKTRACE: " + e.StackTrace; UserUtility.SendEmail(credentials, supportMailList, "", mailSubject, mailBody); - - return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) }; - + + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.EXCEPTION_OCCURED) }; + } } @@ -191,7 +193,7 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers userInfo.EditionId = editionId; //if (userInfo.UserType == AIAHTML5.API.Models.User.SUPER_ADMIN) - if(userInfo.LicenseId == 0) + if (userInfo.LicenseId == 0) { userInfo.Modules = AIAHTML5.API.Models.Users.getAllModulesList(); @@ -202,8 +204,9 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers { CheckLicenseStatus(userInfo); - if(!userInfo.IsSubscriptionExpired){ - GetModulesBasedOnLicense(userInfo,false); + if (!userInfo.IsSubscriptionExpired) + { + GetModulesBasedOnLicense(userInfo, false); } } } @@ -235,50 +238,58 @@ using System.Data.SqlClient;namespace AIAHTML5.API.Controllers isLicenseExpired = AIAHTML5.API.Models.Users.checkIfLicenseExpired(userInfo.LicenseSubscriptions, out expirationDate); } - if (isLicenseExpired) + if (isLicenseExpired) { userInfo.IsSubscriptionExpired = isLicenseExpired; userInfo.SubscriptionExpirationDate = expirationDate; } + else + { + //check Modesty settings for this license + + userInfo.IsModestyOn = AIAHTML5.API.Models.Users.IsModestyActiveForThisLicense(userInfo.LicenseId); + + + } } - + else { - ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); - logger.Debug("userInfo.LicenseInfo is null for userInfo.LicenseId= "+userInfo.LicenseId); + ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); + logger.Debug("userInfo.LicenseInfo is null for userInfo.LicenseId= " + userInfo.LicenseId); } } private static void GetModulesBasedOnLicense(User userInfo, bool isLicenseExpired) { - - //05.6.1 - if (userInfo.LicenseInfo.IsActive) + + //05.6.1 + if (userInfo.LicenseInfo.IsActive) + { + if (!userInfo.LicenseInfo.IsTermAccepted) { - if (!userInfo.LicenseInfo.IsTermAccepted) + ArrayList termsList = AIAHTML5.API.Models.Users.getTermsAndConditions(); + foreach (Hashtable item in termsList) { - ArrayList termsList = AIAHTML5.API.Models.Users.getTermsAndConditions(); - foreach (Hashtable item in termsList) - { - userInfo.TermsAndConditionsTitle = item[AIAConstants.KEY_TITLE].ToString(); - userInfo.TermsAndConditionsText = item[AIAConstants.KEY_CONTENT].ToString(); - } - } - else - { - userInfo.Modules = AIAHTML5.API.Models.Users.getModuleListByLicenseId(userInfo.LicenseId); - - //Insert user login detail - AIAHTML5.API.Models.Users.insertLoginDetails(userInfo.Id); + userInfo.TermsAndConditionsTitle = item[AIAConstants.KEY_TITLE].ToString(); + userInfo.TermsAndConditionsText = item[AIAConstants.KEY_CONTENT].ToString(); } } else { - userInfo.LoginFailureCauseId = ErrorHelper.E_LICENCE_IS_INACTIVE; + userInfo.Modules = AIAHTML5.API.Models.Users.getModuleListByLicenseId(userInfo.LicenseId); + //Insert user login detail + AIAHTML5.API.Models.Users.insertLoginDetails(userInfo.Id); } - } - + } + else + { + userInfo.LoginFailureCauseId = ErrorHelper.E_LICENCE_IS_INACTIVE; + + } + } + // PUT api/authenticate/5 diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index 11be152..6417794 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -1126,5 +1126,42 @@ namespace AIAHTML5.API.Models return objFeatures; } + + internal Boolean GetModestyInfo(int LicenseId) + { + logger.Debug(" inside GetModestyInfo for licenseId= " + LicenseId); + + Boolean isModestyOn = false; + + DataTable dt = null; + + SqlConnection conn = new SqlConnection(dbConnectionString); + SqlCommand cmd = new SqlCommand(); + cmd.Connection = conn; + cmd.CommandText = DBConstants.GET_MODESTY_FOR_THIS_LICENSE; + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.AddWithValue("@licenseId", LicenseId); + SqlDataAdapter da = new SqlDataAdapter(); + da.SelectCommand = cmd; + dt = new DataTable(); + da.Fill(dt); + + if (dt != null && dt.Rows.Count > 0) + { + string IsModesty = dt.Rows[0]["IsModesty"].ToString(); + if (IsModesty == "True") + { + isModestyOn = true; + } + else + { + isModestyOn = false; + } + } + + + return isModestyOn; + } + } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/Models/User.cs b/400-SOURCECODE/AIAHTML5.API/Models/User.cs index a6898d8..dd3a3d7 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/User.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/User.cs @@ -35,7 +35,7 @@ namespace AIAHTML5.API.Models public int LicenseId { get; set; } public int EditionId { get; set; } public Int16 LoginFailureCauseId { get; set; } - + public bool IsModestyOn { get; set; } public ArrayList Modules { get; set; } public License LicenseInfo { get; set; } diff --git a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs index 1883ca1..b4b4fc4 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs @@ -598,5 +598,12 @@ namespace AIAHTML5.API.Models //return intUserId; return userInfo; } + + internal static Boolean IsModestyActiveForThisLicense(int LicenseId) + { + DBModel objModel = new DBModel(); + bool IsModestyOn = objModel.GetModestyInfo(LicenseId); + return IsModestyOn; + } } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj index 9bb9c3a..62f3f86 100644 --- a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj +++ b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj @@ -39,6 +39,7 @@ 4 + diff --git a/400-SOURCECODE/AIAHTML5.Web/AdobePlayerDownloadLink.html b/400-SOURCECODE/AIAHTML5.Web/AdobePlayerDownloadLink.html new file mode 100644 index 0000000..0e28ab9 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.Web/AdobePlayerDownloadLink.html @@ -0,0 +1,76 @@ + + + + + + + Ebix + + + +
+
+
+

CURRICULUM BUILDER

+
+
+
+
+ Adobe Flash will still be needed to access Curriculum Builder module for now. + In order to utilize this aspect of AIA you will need to enable Adobe Flash Player to be used within your browser. + Below please find the appropriate browser that you are using and follow the + instructions to enable Flash Player and return back to + the Curriculum Builder module to access the module. +
+
+
Chrome –
+
https://support.google.com/chrome/answer/6258784
+
FireFox –
+
https://support.mozilla.org/en-US/kb/set-adobe-flash-click-play-firefox
+
Safari –
+
https://helpx.adobe.com/flash-player/kb/enabling-flash-player-safari.html
+
Edge –
+
https://helpx.adobe.com/flash-player/kb/flash-player-issues-windows-10-edge.html
+
Internet Explorer –
+
https://helpx.adobe.com/flash-player/kb/flash-player-issues-windows-10-ie.html
+
+
+
+ + \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index ebd1e1b..e35382e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -227,6 +227,41 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A } else { + //code for modesty setting + if (result.LicenseInfo != null) { + if (result.IsModestyOn) { + $rootScope.isModestyOn = true; + $rootScope.isModestyOff = false; + localStorage.setItem("globalModesty", "Y"); + $rootScope.formsetting = { + ethnicity: null, + modesty: "Y" + } + $rootScope.UpdateAndCloseSetting($rootScope.formsetting) + } + else { + $rootScope.isModestyOn = false; + $rootScope.isModestyOff = true; + localStorage.setItem("globalModesty", "N"); + $rootScope.formsetting = { + ethnicity: null, + modesty: "N" + } + $rootScope.UpdateAndCloseSetting($rootScope.formsetting) + } + } + else { + $rootScope.isModestyOn = true; + $rootScope.isModestyOff = false; + localStorage.setItem("globalModesty", "Y"); + $rootScope.formsetting = { + ethnicity: null, + modesty: "Y" + } + $rootScope.UpdateAndCloseSetting($rootScope.formsetting) + } + //code for modesty setting + if (typeof result.LoginId != undefined || result.LoginId != "" || result.LoginId != null) { if ($("#messageModal").length > 0) { diff --git a/500-DBDump/AIA-StoredProcedures/usp_GetModestyForThisLicense.sql b/500-DBDump/AIA-StoredProcedures/usp_GetModestyForThisLicense.sql new file mode 100644 index 0000000..897e973 --- /dev/null +++ b/500-DBDump/AIA-StoredProcedures/usp_GetModestyForThisLicense.sql