From 10e0ef91af1062e5268bc41e24b177e5b5ac6d80 Mon Sep 17 00:00:00 2001 From: Rich Lott / Artful Robot Date: Sat, 2 Dec 2023 15:54:38 +0000 Subject: [PATCH] Redirect to /civicrm when /civicrm/login accessed and already logged in --- .../CRM/Standaloneusers/Page/Login.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ext/standaloneusers/CRM/Standaloneusers/Page/Login.php b/ext/standaloneusers/CRM/Standaloneusers/Page/Login.php index b3a40144e9..d43779d95b 100644 --- a/ext/standaloneusers/CRM/Standaloneusers/Page/Login.php +++ b/ext/standaloneusers/CRM/Standaloneusers/Page/Login.php @@ -5,11 +5,12 @@ use Civi\Standalone\Security; class CRM_Standaloneusers_Page_Login extends CRM_Core_Page { public function run() { - // // Example: Set the page-title dynamically; alternatively, declare a static title in xml/Menu/*.xml - // CRM_Utils_System::setTitle(E::ts('Login')); - // - // // Example: Assign a variable for use in a template - // $this->assign('currentTime', date('Y-m-d H:i:s')); + Security::singleton()->getLoggedInUfID(); + if (CRM_Core_Session::singleton()->get('ufID')) { + // Already logged in. + CRM_Utils_System::redirect('/civicrm'); + } + $this->assign('logoUrl', E::url('images/civicrm-logo.png')); // Remove breadcrumb for login page. $this->assign('breadcrumb', NULL); -- 2.25.1