Add option to disable admin redirect to admin page - refs #7414

1.9.x
Yannick Warnier 10 years ago
parent 53433eb72a
commit 88a3a48db7
  1. 27
      main/inc/lib/redirect.class.php
  2. 2
      main/install/configuration.dist.php

@ -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');

@ -259,3 +259,5 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE;
//$_configuration['aspell_bin'] = '/usr/bin/hunspell';
//$_configuration['aspell_opts'] = '-a -d en_GB -H -i utf-8';
//$_configuration['aspell_temp_dir'] = './';
// Prevent redirecting admin to admin page
//$_configuration['redirect_admin_to_courses_list'] = true;

Loading…
Cancel
Save