Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<div class="modal-body">
<h1 class="text-center">Important Message</h1>
<p>Please read and acknowledge this important message before proceeding.</p>
<p>
Your access will be revoked if you don't log in for 30 days!
</p>
<div class="text-center" style="margin-top: 20px;">
<button id="acknowledge_btn" class="btn btn-primary" onclick="return closeDialog();">Acknowledge</button>
</div>
</div>
</g:ui_form>
<script>
(function() {
function closeDialogAndRedirect() {
try {
GlideDialogWindow.get().destroy();
} catch (e) {}

// Set user preference
if (typeof setPreference === 'function') {
setPreference('login.consent1', 'true');
}
// Redirect to home.do
window.top.location.href = 'home.do';
}
document.getElementById('acknowledge_btn').addEventListener('click', closeDialogAndRedirect);
})();
</script>

</j:jelly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
addLoadEvent(function() {
try {
// Skip contexts where GlideDialogWindow isn't available (e.g., Service Portal)
if (typeof GlideDialogWindow === 'undefined' || (window.NOW && NOW.sp))
return;
var prefName = 'login.consent1';
// Only show the dialog when the pref is explicitly 'false'
var val = (typeof getPreference === 'function') ? getPreference(prefName) : null;
var shouldShow = String(val || '').toLowerCase() === 'false';
//alert("val"+" "+val+" "+"shouldShow"+" "+shouldShow);
if (!shouldShow)
return;
var dialog = new GlideDialogWindow('acknowledgement_dialog'); // UI Page name
dialog.setTitle('Acknowledge Message');
dialog.setSize(500, 300);
dialog.render();
} catch (e) {
if (console && console.warn) console.warn('ack loader error', e);
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
**Create a user preference as follows:**
<img width="1675" height="420" alt="image" src="https://github.com/user-attachments/assets/efcd19dd-f1ad-440a-ae59-10cc63832cad" />
**Create a UI script:**
<img width="1646" height="808" alt="image" src="https://github.com/user-attachments/assets/207f9dfa-4c6c-4686-84ac-3ff5294a0771" />
This script runs during login and checks the user preference.
If the preference is set to false, it displays the acknowledgement popup by calling UI page

**UI Page details:**
<img width="1511" height="897" alt="image" src="https://github.com/user-attachments/assets/74d4be0f-9401-4733-81df-fca8f52b644e" />
Set the user preference to true so that the popup will not appear for every login.

**Output**:
**On user login:**
<img width="1896" height="748" alt="image" src="https://github.com/user-attachments/assets/1af1b7ec-4647-4bb4-a786-8070817b21f8" />

Loading