Commit df1bc647 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.
(cherry picked from commit c93adecb)
parent 95413593
......@@ -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);
......
Markdown is supported
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