From d83d2d0471cb29d78f35c5c7eaf09bcc99b07466 Mon Sep 17 00:00:00 2001 From: Rich Lott / Artful Robot Date: Tue, 5 Dec 2023 14:15:19 +0000 Subject: [PATCH] standalone: fix test, cleanup unnecessary javascript --- .../CRM/Standaloneusers/Page/Login.php | 3 +++ .../CRM/Standaloneusers/Page/Login.tpl | 23 ++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ext/standaloneusers/CRM/Standaloneusers/Page/Login.php b/ext/standaloneusers/CRM/Standaloneusers/Page/Login.php index 6fec79f817..d9017529dc 100644 --- a/ext/standaloneusers/CRM/Standaloneusers/Page/Login.php +++ b/ext/standaloneusers/CRM/Standaloneusers/Page/Login.php @@ -17,6 +17,9 @@ class CRM_Standaloneusers_Page_Login extends CRM_Core_Page { // Remove breadcrumb for login page. $this->assign('breadcrumb', NULL); + $this->assign('anonAccessDenied', isset($_GET['anonAccessDenied'])); + $this->assign('justLoggedOut', isset($_GET['justLoggedOut'])); + parent::run(); } diff --git a/ext/standaloneusers/templates/CRM/Standaloneusers/Page/Login.tpl b/ext/standaloneusers/templates/CRM/Standaloneusers/Page/Login.tpl index b6a3dcfa86..573bc4a776 100644 --- a/ext/standaloneusers/templates/CRM/Standaloneusers/Page/Login.tpl +++ b/ext/standaloneusers/templates/CRM/Standaloneusers/Page/Login.tpl @@ -2,7 +2,13 @@
-
+ {if $justLoggedOut} +
{ts}You have been logged out.{/ts}
+ {/if} + {if $anonAccessDenied} +
{ts}You do not have permission to access that, you may need to login.{/ts}
+ {/if} +
@@ -12,8 +18,8 @@
{include file='CRM/Standaloneusers/Page/_contentFoot.tpl'} @@ -23,17 +29,8 @@ document.addEventListener('DOMContentLoaded', () => { const submitBtn = document.getElementById('loginSubmit'), username = document.getElementById('usernameInput'), - password = document.getElementById('passwordInput'), - loggedOutNotice = document.getElementById('loggedOutNotice'); + password = document.getElementById('passwordInput'); - // Special messages. - if (window.location.search === '?justLoggedOut') { - loggedOutNotice.style.display = ''; - console.log("successful logout"); - } - else if (window.location.search === '?anonAccessDenied') { - anonAccessDenied.style.display = ''; - } submitBtn.addEventListener('click', async e => { e.preventDefault(); -- 2.25.1