Commit 8ebc345b authored by Dries's avatar Dries

- Patch #191914 by chx: you cannot add user/register to a menu. Also removed some whitespace.

parent 6bb15d29
......@@ -27,6 +27,7 @@ function menu_overview_page() {
* relevant operations.
*/
function menu_overview_form(&$form_state, $menu) {
global $menu_admin;
$sql ="
SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, ml.*
FROM {menu_links} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path
......@@ -37,7 +38,10 @@ function menu_overview_form(&$form_state, $menu) {
$tree = menu_tree_data($result);
$node_links = array();
menu_tree_collect_node_links($tree, $node_links);
// We indicate that a menu admintrator is running the menu access check.
$menu_admin = TRUE;
menu_tree_check_access($tree, $node_links);
$menu_admin = FALSE;
$form = _menu_overview_tree_form($tree);
if (element_children($form)) {
......
......@@ -450,8 +450,11 @@ function menu_get_menus($all = TRUE) {
* FALSE otherwise.
*/
function menu_valid_path($form_item) {
global $menu_admin;
$item = array();
$path = $form_item['link_path'];
// We indicate that a menu administrator is running the menu access check.
$menu_admin = TRUE;
if ($path == '<front>' || menu_path_is_external($path)) {
$item = array('access' => TRUE);
}
......@@ -468,5 +471,6 @@ function menu_valid_path($form_item) {
else {
$item = menu_get_item($path);
}
$menu_admin = FALSE;
return $item && $item['access'];
}
......@@ -817,7 +817,8 @@ function theme_user_list($users, $title = NULL) {
}
function user_is_anonymous() {
return !$GLOBALS['user']->uid;
// Menu administrators can see items for anonymous when administering.
return !$GLOBALS['user']->uid || !empty($GLOBALS['menu_admin']);
}
function user_is_logged_in() {
......
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