chart.umd.js
1 month ago
jquery-confirm.min.js
1 month ago
jspdf.umd.min.js
1 month ago
limit-login-attempts.js
1 month ago
mfa-disabled-message.js
1 month ago
mfa-disabled-message.js
46 lines
| 1 | /** |
| 2 | * Display MFA disabled message on login page |
| 3 | * Uses the same notification mechanism as other LLAR messages |
| 4 | */ |
| 5 | (function($) { |
| 6 | 'use strict'; |
| 7 | |
| 8 | // Use the same notification function as LLAR uses for other messages |
| 9 | // Check if notification_login_page is already defined globally (from LLAR's login_page_render_js) |
| 10 | if (typeof window.notification_login_page === 'undefined') { |
| 11 | window.notification_login_page = function(message) { |
| 12 | if (!message.length) { |
| 13 | return false; |
| 14 | } |
| 15 | const css = '.llar_notification_login_page { position: fixed; top: 50%; left: 50%; font-size: 120%; line-height: 1.5; width: 365px; z-index: 999999; background: #fffbe0; padding: 20px; color: rgb(121, 121, 121); text-align: center; border-radius: 10px; transform: translate(-50%, -50%); box-shadow: 10px 10px 14px 0 #72757B99;} .llar_notification_login_page h4 { color: rgb(255, 255, 255); margin-bottom: 1.5rem; } .llar_notification_login_page .close-button {position: absolute; top: 0; right: 5px; cursor: pointer; line-height: 1;}'; |
| 16 | const style = document.createElement('style'); |
| 17 | style.appendChild(document.createTextNode(css)); |
| 18 | document.head.appendChild(style); |
| 19 | |
| 20 | $('body').prepend('<div class="llar_notification_login_page"><div class="close-button">×</div>' + message + '</div>'); |
| 21 | |
| 22 | setTimeout(function() { |
| 23 | $('.llar_notification_login_page').hide(); |
| 24 | }, 10000); |
| 25 | |
| 26 | $('.llar_notification_login_page').on('click', '.close-button', function() { |
| 27 | $('.llar_notification_login_page').hide(); |
| 28 | }); |
| 29 | |
| 30 | $('body').on('click', function(event) { |
| 31 | if (!$(event.target).closest('.llar_notification_login_page').length) { |
| 32 | $('.llar_notification_login_page').hide(); |
| 33 | } |
| 34 | }); |
| 35 | }; |
| 36 | } |
| 37 | |
| 38 | // Show message when DOM is ready |
| 39 | $(document).ready(function() { |
| 40 | if (typeof llarMfaDisabled !== 'undefined' && llarMfaDisabled.showMessage && typeof window.notification_login_page === 'function') { |
| 41 | window.notification_login_page(llarMfaDisabled.message); |
| 42 | } |
| 43 | }); |
| 44 | |
| 45 | })(jQuery); |
| 46 |