CRM_Core_Error::statusBounce(ts("Access denied"), CRM_Utils_System::url('civicrm'));
}
else {
- CRM_Utils_System::redirect('/civicrm/login?anonAccessDenied');
- }
+ http_response_code(403);
+
+ // render a login page
+ if (class_exists('CRM_Standaloneusers_Page_Login')) {
+ $loginPage = new CRM_Standaloneusers_Page_Login();
+ $loginPage->assign('anonAccessDenied', TRUE);
+ return $loginPage->run();
+ }
- // TODO: Prettier error page
+ throw new CRM_Core_Exception('Access denied. Standaloneusers extension not found');
+ }
}
}
// Remove breadcrumb for login page.
$this->assign('breadcrumb', NULL);
- $this->assign('anonAccessDenied', isset($_GET['anonAccessDenied']));
$this->assign('justLoggedOut', isset($_GET['justLoggedOut']));
parent::run();