Commit c93adecb authored by Nigel McNie's avatar Nigel McNie
Browse files

Take into account the install subdirectory when redirecting users because of...

Take into account the install subdirectory when redirecting users because of access denied. Fixes #2259.
parent cc99af6b
......@@ -765,7 +765,7 @@ class AccessDeniedException extends UserException {
public function render_exception() {
global $USER;
if (defined('PUBLIC') && !$USER->is_logged_in()) {
$loginurl = $_SERVER['REQUEST_URI'];
$loginurl = substr($_SERVER['REQUEST_URI'], strlen(get_mahara_install_subdirectory()) - 1);
$loginurl .= (false === strpos($loginurl, '?')) ? '?' : '&';
$loginurl .= 'login';
redirect($loginurl);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment