Commit a60041989b5211ef052e80e8c2e86b2ae335d8b1
1 parent
337e0b66
Committed
Showing
7 changed files
with
272 additions
and
6 deletions
400-SOURCECODE/AIAHTML5.API/AIAHTML5.API.csproj
@@ -97,6 +97,7 @@ | @@ -97,6 +97,7 @@ | ||
97 | <Content Include="Global.asax" /> | 97 | <Content Include="Global.asax" /> |
98 | <Content Include="content\images\logo.png" /> | 98 | <Content Include="content\images\logo.png" /> |
99 | <Content Include="index.html" /> | 99 | <Content Include="index.html" /> |
100 | + <Content Include="Templates\admin-Request.html" /> | ||
100 | <Content Include="Templates\forgot-Password.html" /> | 101 | <Content Include="Templates\forgot-Password.html" /> |
101 | <Content Include="Templates\forgot-UserId.html" /> | 102 | <Content Include="Templates\forgot-UserId.html" /> |
102 | <Content Include="Web.config"> | 103 | <Content Include="Web.config"> |
400-SOURCECODE/AIAHTML5.API/Controllers/ForgotUserController.cs
@@ -49,13 +49,13 @@ namespace AIAHTML5.API.Controllers | @@ -49,13 +49,13 @@ namespace AIAHTML5.API.Controllers | ||
49 | { | 49 | { |
50 | logger.Debug("2. isPassword= " + Convert.ToBoolean(userInfo["isPassword"])); | 50 | logger.Debug("2. isPassword= " + Convert.ToBoolean(userInfo["isPassword"])); |
51 | 51 | ||
52 | - isMailSent = AIAHTML5.API.Models.ResetUser.SendEmail(userData, true); | 52 | + isMailSent = AIAHTML5.API.Models.UserUtility.SendEmail(userData, true); |
53 | } | 53 | } |
54 | else | 54 | else |
55 | { | 55 | { |
56 | logger.Debug("3. isPassword= " + Convert.ToBoolean(userInfo["isPassword"])); | 56 | logger.Debug("3. isPassword= " + Convert.ToBoolean(userInfo["isPassword"])); |
57 | 57 | ||
58 | - isMailSent = AIAHTML5.API.Models.ResetUser.SendEmail(userData, false); | 58 | + isMailSent = AIAHTML5.API.Models.UserUtility.SendEmail(userData, false); |
59 | } | 59 | } |
60 | logger.Debug("isMailSent= " + isMailSent); | 60 | logger.Debug("isMailSent= " + isMailSent); |
61 | if (isMailSent) | 61 | if (isMailSent) |
400-SOURCECODE/AIAHTML5.API/Models/ResetUser.cs
@@ -16,7 +16,7 @@ using System.Configuration; | @@ -16,7 +16,7 @@ using System.Configuration; | ||
16 | 16 | ||
17 | namespace AIAHTML5.API.Models | 17 | namespace AIAHTML5.API.Models |
18 | { | 18 | { |
19 | - public class ResetUser | 19 | + public class UserUtility |
20 | { | 20 | { |
21 | public static bool SendEmail(dynamic UserDetails, bool isPassword) | 21 | public static bool SendEmail(dynamic UserDetails, bool isPassword) |
22 | { | 22 | { |
@@ -36,7 +36,8 @@ namespace AIAHTML5.API.Models | @@ -36,7 +36,8 @@ namespace AIAHTML5.API.Models | ||
36 | string userName = string.Empty; | 36 | string userName = string.Empty; |
37 | string fName = string.Empty; | 37 | string fName = string.Empty; |
38 | string lName = string.Empty; | 38 | string lName = string.Empty; |
39 | - string site_url = Convert.ToString(ConfigurationManager.AppSettings["Site_URL"]); | 39 | + string site_url = Convert.ToString(ConfigurationManager.AppSettings["Site_URL"]); |
40 | + bool isAdminRequest = false; | ||
40 | 41 | ||
41 | foreach (KeyValuePair<string, object> kvp in UserDetails) | 42 | foreach (KeyValuePair<string, object> kvp in UserDetails) |
42 | { | 43 | { |
@@ -51,6 +52,9 @@ namespace AIAHTML5.API.Models | @@ -51,6 +52,9 @@ namespace AIAHTML5.API.Models | ||
51 | 52 | ||
52 | if (kvp.Key == "lastName") | 53 | if (kvp.Key == "lastName") |
53 | lName = kvp.Value.ToString(); | 54 | lName = kvp.Value.ToString(); |
55 | + | ||
56 | + if(kvp.Key == "admin") | ||
57 | + isAdminRequest = true; | ||
54 | } | 58 | } |
55 | 59 | ||
56 | string fullName = fName + " " + lName; | 60 | string fullName = fName + " " + lName; |
@@ -68,8 +72,11 @@ namespace AIAHTML5.API.Models | @@ -68,8 +72,11 @@ namespace AIAHTML5.API.Models | ||
68 | else | 72 | else |
69 | templatePath = "~/Templates/forgot-UserId.html"; | 73 | templatePath = "~/Templates/forgot-UserId.html"; |
70 | 74 | ||
75 | + if(isAdminRequest) | ||
76 | + templatePath = "~/Templates/admin-Request.html"; | ||
77 | + | ||
71 | logger.Debug("inside SendEmail for templatePath= " + templatePath + ", userId= " + userId + ", userMail= " + userMail + ",fullName= " + fullName + ",resetPasswordLink= " + resetPasswordLink); | 78 | logger.Debug("inside SendEmail for templatePath= " + templatePath + ", userId= " + userId + ", userMail= " + userMail + ",fullName= " + fullName + ",resetPasswordLink= " + resetPasswordLink); |
72 | - string mailBody = ResetUser.GetMailBodyTextFromTemplate(templatePath, userId, userMail, fullName, resetPasswordLink); | 79 | + string mailBody = UserUtility.GetMailBodyTextFromTemplate(templatePath, userId, userMail, fullName, resetPasswordLink); |
73 | 80 | ||
74 | lstToAddress.Add(userMail); | 81 | lstToAddress.Add(userMail); |
75 | 82 | ||
@@ -98,6 +105,9 @@ namespace AIAHTML5.API.Models | @@ -98,6 +105,9 @@ namespace AIAHTML5.API.Models | ||
98 | else | 105 | else |
99 | mailSubject = "Password recovery mail for: "; | 106 | mailSubject = "Password recovery mail for: "; |
100 | 107 | ||
108 | + if (isAdminRequest) | ||
109 | + mailSubject = "Administrator request for: "; | ||
110 | + | ||
101 | emailUtility.sHostName = Convert.ToString(ConfigurationManager.AppSettings["HostAddress"]); | 111 | emailUtility.sHostName = Convert.ToString(ConfigurationManager.AppSettings["HostAddress"]); |
102 | emailUtility.sFromAddress = Convert.ToString(ConfigurationManager.AppSettings["SenderEmailAddress"]); | 112 | emailUtility.sFromAddress = Convert.ToString(ConfigurationManager.AppSettings["SenderEmailAddress"]); |
103 | emailUtility.bIsBodyHtml = true; | 113 | emailUtility.bIsBodyHtml = true; |
400-SOURCECODE/AIAHTML5.API/Templates/admin-Request.html
0 โ 100644
1 | +๏ปฟ<style type='text/css'> | ||
2 | + strong { | ||
3 | + font-size: 18px; | ||
4 | + color: #ffff00; | ||
5 | + } | ||
6 | +</style> | ||
7 | +<table width='500' border='0' align='center' cellpadding='0' cellspacing='0'> | ||
8 | + <tbody> | ||
9 | + <tr> | ||
10 | + <td align='center' valign='middle' bgcolor='#393939' style='padding:30px 0 20px 0;'> | ||
11 | + <a href='#'><img src='{logoPath}' alt='AIA' title='AIA' /></a> | ||
12 | + </td> | ||
13 | + </tr> | ||
14 | + <tr> | ||
15 | + <td align='center' valign='top' bgcolor='#808d43' style='padding:20px;'> | ||
16 | + <table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'> | ||
17 | + <tbody> | ||
18 | + <tr> | ||
19 | + <td colspan='2' style=' font-size:32px; font-weight:bold; color:#fff; font-family:Gotham, Helvetica, Arial, sans-serif'>Admin Access Request</td> | ||
20 | + </tr> | ||
21 | + <tr> | ||
22 | + <td colspan='2'> </td> | ||
23 | + </tr> | ||
24 | + <tr> | ||
25 | + <td colspan='2' style='font-size:20px; font-weight:bold; color:#fff; font-family:Gotham, Helvetica, Arial, sans-serif'>Hello {userFullName}</td> | ||
26 | + </tr> | ||
27 | + <tr> | ||
28 | + <td colspan='2'> </td> | ||
29 | + </tr> | ||
30 | + <tr> | ||
31 | + <td colspan='2' style=' font-size:16px; font-weight:bold; color:#fff; font-family:Gotham, Helvetica, Arial, sans-serif'>You have requested 'admin' access for following account: {emailId}</td> | ||
32 | + </tr> | ||
33 | + <tr> | ||
34 | + <td colspan='2'> </td> | ||
35 | + </tr> | ||
36 | + <tr> | ||
37 | + <td colspan='2' style=' font-size:18px; font-family:Gotham, Helvetica, Arial, sans-serif; color:#fff;'>Your request has been registered and intimated to referenced authority. </td> | ||
38 | + </tr> | ||
39 | + <tr> | ||
40 | + <td colspan='2'> </td> | ||
41 | + </tr> | ||
42 | + <tr> | ||
43 | + <td colspan='2'> </td> | ||
44 | + </tr> | ||
45 | + <tr> | ||
46 | + <td colspan='2'> </td> | ||
47 | + </tr> | ||
48 | + </tbody> | ||
49 | + </table> | ||
50 | + </td> | ||
51 | + </tr> | ||
52 | + <tr> | ||
53 | + <td bgcolor='#f9f2e7' style='padding:20px;'> | ||
54 | + <table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'> | ||
55 | + <tbody> | ||
56 | + <tr> | ||
57 | + <td style=' font-size:12px; font-family:Gotham, Helvetica, Arial, sans-serif; color:#000000;'>A.D.A.M. โ the company that pioneered online health content โ is dedicated to creating and offering the most effective and innovative educational solutions possible for teaching medical science and improving health literacy.</td> | ||
58 | + </tr> | ||
59 | + <tr> | ||
60 | + <td style=' font-size:12px; font-family:Gotham, Helvetica, Arial, sans-serif; color:#000000;'> </td> | ||
61 | + </tr> | ||
62 | + <tr> | ||
63 | + <td style=' font-size:12px; font-family:Gotham, Helvetica, Arial, sans-serif; color:#000000;'>Give us a <b>call toll-free at 1-888-278-9614</b> or <em>send us an email</em> if you have any questions or if you need help. It will be our pleasure to help you.</td> | ||
64 | + </tr> | ||
65 | + <tr><td style=' font-size:12px; font-family:Gotham, Helvetica, Arial, sans-serif; color:#000000;'> </td></tr> | ||
66 | + <tr><td style=' font-size:12px; font-family:Gotham, Helvetica, Arial, sans-serif; color:#000000;'> </td></tr> | ||
67 | + <tr> | ||
68 | + <td style=' font-size:12px; font-family:Gotham, Helvetica, Arial, sans-serif; color:#000000;'><em>© 2017 Ebix, Inc. All Rights Reserved. </em></td> | ||
69 | + </tr> | ||
70 | + </tbody> | ||
71 | + </table> | ||
72 | + </td> | ||
73 | + </tr> | ||
74 | + </tbody> | ||
75 | +</table> | ||
0 | \ No newline at end of file | 76 | \ No newline at end of file |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -3309,5 +3309,145 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | @@ -3309,5 +3309,145 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | ||
3309 | 3309 | ||
3310 | } | 3310 | } |
3311 | 3311 | ||
3312 | + $rootScope.OpenAdminForm = function (userInfo) { | ||
3313 | + getUserDetails(); | ||
3314 | + if ($rootScope.userData) { | ||
3315 | + $('#fName').val(userInfo.firstName); | ||
3316 | + $('#lName').val(userInfo.lastName); | ||
3317 | + $('#email').val(userInfo.emailId); | ||
3318 | + } | ||
3319 | + /*$('#testFormAdmin').attr('display', 'block'); | ||
3320 | + $('#testFormAdmin').toggle();*/ | ||
3321 | + userInfo.firstName = 'Utkarsh'; | ||
3322 | + userInfo.lastName = 'Singh'; | ||
3323 | + userInfo.emailId = 'utkarsh.singh@ebix.com'; | ||
3324 | + | ||
3325 | + if ((userInfo.emailId != null) && (userInfo.emailId != '')) { | ||
3326 | + if (validateEmail(userInfo.emailId)) { | ||
3327 | + isMailForPassword = 'admin'; | ||
3328 | + | ||
3329 | + AuthenticationService.SendMailToUser(userInfo) | ||
3330 | + .then(function (result) { | ||
3331 | + if (result == LoginConstants.USER_NOT_FOUND) { | ||
3332 | + $rootScope.errorMassage = LoginMessageConstants.INCORRECT_EMAIL_ID; | ||
3333 | + $("#messageModal").modal('show'); | ||
3334 | + } | ||
3335 | + else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { | ||
3336 | + $rootScope.errorMassage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; | ||
3337 | + $("#messageModal").modal('show'); | ||
3338 | + } | ||
3339 | + else if (result == LoginConstants.MAIL_NOT_SENT) { | ||
3340 | + $rootScope.errorMassage = LoginMessageConstants.MAIL_NOT_SENT; | ||
3341 | + $("#messageModal").modal('show'); | ||
3342 | + } | ||
3343 | + else { | ||
3344 | + if (result.loginId != undefined || result.loginId != "" || result.loginId != null) { | ||
3345 | + var message; | ||
3346 | + if ($('.forgot-sm').length > 0) { | ||
3347 | + $('.forgot-sm').fadeOut(); | ||
3348 | + $('.forgot-sm').modal('hide'); | ||
3349 | + } | ||
3350 | + if ($('.forgot-sm1').length > 0) { | ||
3351 | + $('.forgot-sm1').fadeOut(); | ||
3352 | + $('.forgot-sm1').modal('hide'); | ||
3353 | + } | ||
3354 | + if (isMailForPassword) | ||
3355 | + message = LoginMessageConstants.RESET_PASSWORD; | ||
3356 | + else | ||
3357 | + message = LoginMessageConstants.USERID_SENT_IN_EMAIL | ||
3358 | + //alert(message); | ||
3359 | + $rootScope.errorMassage = message; | ||
3360 | + $("#messageModal").modal('show'); | ||
3361 | + | ||
3362 | + | ||
3363 | + } | ||
3364 | + } | ||
3365 | + | ||
3366 | + }, | ||
3367 | + function (error) { | ||
3368 | + console.log(' Error in authentication = ' + error.statusText); | ||
3369 | + // alert(LoginConstants.ERROR_IN_FECTHING_DETAILS); | ||
3370 | + $rootScope.errorMassage = LoginConstants.ERROR_IN_FECTHING_DETAILS; | ||
3371 | + $("#messageModal").modal('show'); | ||
3372 | + }); | ||
3373 | + } | ||
3374 | + else { | ||
3375 | + // alert(LoginMessageConstants.INCORRECT_EMAIL_ID); | ||
3376 | + $rootScope.errorMassage = LoginMessageConstants.INCORRECT_EMAIL_ID; | ||
3377 | + $("#messageModal").modal('show'); | ||
3378 | + } | ||
3379 | + } | ||
3380 | + else { | ||
3381 | + //alert(LoginMessageConstants.BLANK_EMAIL_ID); | ||
3382 | + $rootScope.errorMassage = LoginMessageConstants.BLANK_EMAIL_ID; | ||
3383 | + $("#messageModal").modal('show'); | ||
3384 | + | ||
3385 | + } | ||
3386 | + }; | ||
3387 | + | ||
3388 | + /*function SendMailFromAdmin(userInfo, isMailForPassword) { | ||
3389 | + if ((userInfo.emailId != null) && (userInfo.emailId != '')) { | ||
3390 | + if (validateEmail(userInfo.emailId)) { | ||
3391 | + isMailForPassword = 'admin'; | ||
3392 | + | ||
3393 | + AuthenticationService.SendMailToUser(userInfo) | ||
3394 | + .then(function (result) { | ||
3395 | + if (result == LoginConstants.USER_NOT_FOUND) { | ||
3396 | + $rootScope.errorMassage = LoginMessageConstants.INCORRECT_EMAIL_ID; | ||
3397 | + $("#messageModal").modal('show'); | ||
3398 | + } | ||
3399 | + else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { | ||
3400 | + $rootScope.errorMassage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; | ||
3401 | + $("#messageModal").modal('show'); | ||
3402 | + } | ||
3403 | + else if (result == LoginConstants.MAIL_NOT_SENT) { | ||
3404 | + $rootScope.errorMassage = LoginMessageConstants.MAIL_NOT_SENT; | ||
3405 | + $("#messageModal").modal('show'); | ||
3406 | + } | ||
3407 | + else { | ||
3408 | + if (result.loginId != undefined || result.loginId != "" || result.loginId != null) { | ||
3409 | + var message; | ||
3410 | + if ($('.forgot-sm').length > 0) { | ||
3411 | + $('.forgot-sm').fadeOut(); | ||
3412 | + $('.forgot-sm').modal('hide'); | ||
3413 | + } | ||
3414 | + if ($('.forgot-sm1').length > 0) { | ||
3415 | + $('.forgot-sm1').fadeOut(); | ||
3416 | + $('.forgot-sm1').modal('hide'); | ||
3417 | + } | ||
3418 | + if (isMailForPassword) | ||
3419 | + message = LoginMessageConstants.RESET_PASSWORD; | ||
3420 | + else | ||
3421 | + message = LoginMessageConstants.USERID_SENT_IN_EMAIL | ||
3422 | + //alert(message); | ||
3423 | + $rootScope.errorMassage = message; | ||
3424 | + $("#messageModal").modal('show'); | ||
3425 | + | ||
3426 | + | ||
3427 | + } | ||
3428 | + } | ||
3429 | + | ||
3430 | + }, | ||
3431 | + function (error) { | ||
3432 | + console.log(' Error in authentication = ' + error.statusText); | ||
3433 | + // alert(LoginConstants.ERROR_IN_FECTHING_DETAILS); | ||
3434 | + $rootScope.errorMassage = LoginConstants.ERROR_IN_FECTHING_DETAILS; | ||
3435 | + $("#messageModal").modal('show'); | ||
3436 | + }); | ||
3437 | + } | ||
3438 | + else { | ||
3439 | + // alert(LoginMessageConstants.INCORRECT_EMAIL_ID); | ||
3440 | + $rootScope.errorMassage = LoginMessageConstants.INCORRECT_EMAIL_ID; | ||
3441 | + $("#messageModal").modal('show'); | ||
3442 | + } | ||
3443 | + } | ||
3444 | + else { | ||
3445 | + //alert(LoginMessageConstants.BLANK_EMAIL_ID); | ||
3446 | + $rootScope.errorMassage = LoginMessageConstants.BLANK_EMAIL_ID; | ||
3447 | + $("#messageModal").modal('show'); | ||
3448 | + | ||
3449 | + } | ||
3450 | + };*/ | ||
3451 | + | ||
3312 | }] | 3452 | }] |
3313 | ); | 3453 | ); |
3314 | \ No newline at end of file | 3454 | \ No newline at end of file |
400-SOURCECODE/AIAHTML5.Web/app/widget/TopMenu.html
@@ -49,7 +49,7 @@ | @@ -49,7 +49,7 @@ | ||
49 | <li><a href="#">About A.D.A.M.</a></li> | 49 | <li><a href="#">About A.D.A.M.</a></li> |
50 | </ul> | 50 | </ul> |
51 | </li> | 51 | </li> |
52 | - <li><a href="#">Admin</a></li> | 52 | + <li><a ng-click="OpenAdminForm()" role="button" data-toggle="modal" class="btn" data-target="#adminModal">Admin</a></li><!--href="#" class=""btn-primary btn-lg"--> |
53 | </ul> | 53 | </ul> |
54 | <ul class="nav navbar-nav navbar-right"> | 54 | <ul class="nav navbar-nav navbar-right"> |
55 | <li class="visible-xs"><a href="" ng-click="LogoutUser()">Logout</a></li> | 55 | <li class="visible-xs"><a href="" ng-click="LogoutUser()">Logout</a></li> |
400-SOURCECODE/AIAHTML5.Web/index.html
@@ -1162,6 +1162,46 @@ | @@ -1162,6 +1162,46 @@ | ||
1162 | </div> | 1162 | </div> |
1163 | </div> | 1163 | </div> |
1164 | 1164 | ||
1165 | + <!--ADMIN Form Under Process--> | ||
1166 | + <div class="modal fade in" role="dialog" id="adminModal" tabindex="-1" aria-labelledby="myModalLabel" ng-controller="HomeController"> | ||
1167 | + <div class="modal-dialog" role="document"> | ||
1168 | + <div class="modal-content"> | ||
1169 | + <div class="modal-header"> | ||
1170 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | ||
1171 | + <h4 class="modal-title" id="myModalLabel">Admin module is under process.</h4> | ||
1172 | + </div> | ||
1173 | + <div class="modal-body"> | ||
1174 | + <h5>This module is not yet available to use, please fill in the form with complete details, a support request will be submitted to ADAM Education Sales and Support team. If needed someone from ADAM team will contact you ASAP.</h5> | ||
1175 | + <br /><br /> | ||
1176 | + <form> | ||
1177 | + <div class="form-group"> | ||
1178 | + <div class="input-group"> | ||
1179 | + <span class="input-group-addon"><i class="fa fa-user"></i></span> | ||
1180 | + <input id="fName" class="form-control" placeholder="" type="text" ng-bind="userInfo.firstName" ng-readonly="true"> | ||
1181 | + </div> | ||
1182 | + <div class="input-group"> | ||
1183 | + <span class="input-group-addon"><i class="fa fa-user"></i></span> | ||
1184 | + <input id="lName" class="form-control" placeholder="" type="text" ng-bind="userInfo.lastName" ng-readonly="true"> | ||
1185 | + </div> | ||
1186 | + <div class="input-group"> | ||
1187 | + <span class="input-group-addon"><i class="fa fa-envelope"></i></span> | ||
1188 | + <input id="fName" class="form-control" placeholder="" type="text" ng-bind="userInfo.emailId" ng-readonly="true"> | ||
1189 | + </div> | ||
1190 | + <div class="input-group"> | ||
1191 | + <span class="input-group-addon"><i class="fa fa-envelope"></i></span> | ||
1192 | + <input id="message" class="form-control" type="text"> | ||
1193 | + </div> | ||
1194 | + </div> | ||
1195 | + </form> | ||
1196 | + </div> | ||
1197 | + <div class="modal-footer"> | ||
1198 | + <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | ||
1199 | + <button type="button" class="btn btn-primary">Save changes</button> | ||
1200 | + </div> | ||
1201 | + </div> | ||
1202 | + </div> | ||
1203 | + </div> | ||
1204 | + | ||
1165 | <script> | 1205 | <script> |
1166 | 1206 | ||
1167 | function enableDisableFillOption() { | 1207 | function enableDisableFillOption() { |