|
|
|
@ -91,18 +91,21 @@ class Redirect |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// If the user is a platform admin, redirect to the main admin page |
|
|
|
|
if (api_is_multiple_url_enabled()) { |
|
|
|
|
// if multiple URLs are enabled, make sure he's admin of the |
|
|
|
|
// current URL before redirecting |
|
|
|
|
$url = api_get_current_access_url_id(); |
|
|
|
|
if (api_is_platform_admin_by_id($user_id, $url)) { |
|
|
|
|
self::navigate(api_get_path(WEB_CODE_PATH).'admin/index.php'); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// if no multiple URL, then it's enough to be platform admin |
|
|
|
|
if (api_is_platform_admin_by_id($user_id)) { |
|
|
|
|
self::navigate(api_get_path(WEB_CODE_PATH).'admin/index.php'); |
|
|
|
|
global $_configuration; |
|
|
|
|
if (empty($_configuration['redirect_admin_to_courses_list']) or $_configuration['redirect_admin_to_courses_list'] === 'false') { |
|
|
|
|
// If the user is a platform admin, redirect to the main admin page |
|
|
|
|
if (api_is_multiple_url_enabled()) { |
|
|
|
|
// if multiple URLs are enabled, make sure he's admin of the |
|
|
|
|
// current URL before redirecting |
|
|
|
|
$url = api_get_current_access_url_id(); |
|
|
|
|
if (api_is_platform_admin_by_id($user_id, $url)) { |
|
|
|
|
self::navigate(api_get_path(WEB_CODE_PATH).'admin/index.php'); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// if no multiple URL, then it's enough to be platform admin |
|
|
|
|
if (api_is_platform_admin_by_id($user_id)) { |
|
|
|
|
self::navigate(api_get_path(WEB_CODE_PATH).'admin/index.php'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$page_after_login = api_get_setting('page_after_login'); |
|
|
|
|