From: Rich Lott / Artful Robot Date: Sat, 2 Dec 2023 15:54:38 +0000 (+0000) Subject: Redirect to /civicrm when /civicrm/login accessed and already logged in X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=10e0ef91af1062e5268bc41e24b177e5b5ac6d80;p=civicrm-core.git Redirect to /civicrm when /civicrm/login accessed and already logged in --- 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);