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; break;
} }
} }
// If the user is a platform admin, redirect to the main admin page global $_configuration;
if (api_is_multiple_url_enabled()) { if (empty($_configuration['redirect_admin_to_courses_list']) or $_configuration['redirect_admin_to_courses_list'] === 'false') {
// if multiple URLs are enabled, make sure he's admin of the // If the user is a platform admin, redirect to the main admin page
// current URL before redirecting if (api_is_multiple_url_enabled()) {
$url = api_get_current_access_url_id(); // if multiple URLs are enabled, make sure he's admin of the
if (api_is_platform_admin_by_id($user_id, $url)) { // current URL before redirecting
self::navigate(api_get_path(WEB_CODE_PATH).'admin/index.php'); $url = api_get_current_access_url_id();
} if (api_is_platform_admin_by_id($user_id, $url)) {
} else { self::navigate(api_get_path(WEB_CODE_PATH).'admin/index.php');
// if no multiple URL, then it's enough to be platform admin }
if (api_is_platform_admin_by_id($user_id)) { } else {
self::navigate(api_get_path(WEB_CODE_PATH).'admin/index.php'); // 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'); $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_bin'] = '/usr/bin/hunspell';
//$_configuration['aspell_opts'] = '-a -d en_GB -H -i utf-8'; //$_configuration['aspell_opts'] = '-a -d en_GB -H -i utf-8';
//$_configuration['aspell_temp_dir'] = './'; //$_configuration['aspell_temp_dir'] = './';
// Prevent redirecting admin to admin page
//$_configuration['redirect_admin_to_courses_list'] = true;

Loading…
Cancel
Save