|
|
|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Send a redirect to the user agent and exist |
|
|
|
* Send a redirect to the user agent and exist |
|
|
|
* |
|
|
|
* |
|
|
|
* @license see /license.txt |
|
|
|
* @license see /license.txt |
|
|
|
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Geneva |
|
|
|
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Geneva |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -29,7 +29,7 @@ class Redirect { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Redirect to the session "request uri" if it exists. |
|
|
|
* Redirect to the session "request uri" if it exists. |
|
|
|
* @param bool Whether the user just logged in (in this case, use page_after_login rules) |
|
|
|
* @param bool Whether the user just logged in (in this case, use page_after_login rules) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
static function session_request_uri($logging_in = false, $user_id = null) { |
|
|
|
static function session_request_uri($logging_in = false, $user_id = null) { |
|
|
|
@ -47,7 +47,7 @@ class Redirect { |
|
|
|
self::navigate($url); |
|
|
|
self::navigate($url); |
|
|
|
} elseif ($logging_in || (isset($_REQUEST['sso_referer']) && !empty($_REQUEST['sso_referer']))) { |
|
|
|
} elseif ($logging_in || (isset($_REQUEST['sso_referer']) && !empty($_REQUEST['sso_referer']))) { |
|
|
|
if (isset($user_id)) { |
|
|
|
if (isset($user_id)) { |
|
|
|
// Make sure we use the appropriate role redirection in case one has been defined |
|
|
|
// Make sure we use the appropriate role redirection in case one has been defined |
|
|
|
$user_status = api_get_user_status($user_id); |
|
|
|
$user_status = api_get_user_status($user_id); |
|
|
|
switch ($user_status) { |
|
|
|
switch ($user_status) { |
|
|
|
case COURSEMANAGER: |
|
|
|
case COURSEMANAGER: |
|
|
|
@ -95,9 +95,11 @@ class Redirect { |
|
|
|
self::navigate("$www/user_portal.php"); |
|
|
|
self::navigate("$www/user_portal.php"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected static function navigate($url) { |
|
|
|
protected static function navigate($url) |
|
|
|
session_write_close(); //should not be neeeded |
|
|
|
{ |
|
|
|
|
|
|
|
$url = Security::remove_XSS($url); |
|
|
|
|
|
|
|
session_write_close(); //should not be neeeded |
|
|
|
header("Location: $url"); |
|
|
|
header("Location: $url"); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|