function masquerade_menu in Masquerade 7
Same name and namespace in other branches
- 5 masquerade.module \masquerade_menu()
- 6 masquerade.module \masquerade_menu()
Implements hook_menu().
File
- ./
masquerade.module, line 93 - The masquerade module allows administrators to masquerade as other user.
Code
function masquerade_menu() {
$items = array();
$default_test_user = _masquerade_user_load(variable_get('masquerade_test_user', ''));
if ($default_test_user && ($default_test_user->uid || $default_test_user->name == variable_get('anonymous', t('Anonymous')))) {
$items['masquerade/switch/' . $default_test_user->uid] = array(
'title' => 'Masquerade as @testuser',
'title arguments' => array(
'@testuser' => $default_test_user->name,
),
'page callback' => 'masquerade_switch_user_page',
'page arguments' => array(
2,
),
'access callback' => 'masquerade_menu_access',
'access arguments' => array(
'switch',
),
'type' => MENU_NORMAL_ITEM,
);
}
$items['masquerade/switch/%'] = array(
'title' => 'Masquerading',
'page callback' => 'masquerade_switch_user_page',
'page arguments' => array(
2,
),
'access callback' => 'masquerade_menu_access',
'access arguments' => array(
'switch',
2,
),
'type' => MENU_NORMAL_ITEM,
);
$items['masquerade/unswitch'] = array(
'title' => 'Switch back',
'page callback' => 'masquerade_switch_back_page',
'access callback' => 'masquerade_menu_access',
'access arguments' => array(
'unswitch',
),
'type' => MENU_NORMAL_ITEM,
);
$items['masquerade/autocomplete'] = array(
'title' => '',
'page callback' => 'masquerade_autocomplete',
'access callback' => 'masquerade_menu_access',
'access arguments' => array(
'autocomplete',
),
'type' => MENU_CALLBACK,
);
$items['masquerade/autocomplete-users'] = array(
'title' => '',
'page callback' => 'masquerade_autocomplete_multiple',
'access callback' => 'masquerade_menu_access',
'access arguments' => array(
'autocomplete',
),
'type' => MENU_CALLBACK,
);
$items['masquerade/autocomplete-user'] = array(
'title' => 'Masquerade autocomplete',
'page callback' => 'masquerade_autocomplete_multiple',
'page arguments' => array(
2,
FALSE,
),
'access arguments' => array(
'access user profiles',
),
'type' => MENU_CALLBACK,
);
$items['admin/config/people/masquerade'] = array(
'title' => 'Masquerade',
'description' => 'Masquerade module allows administrators to masquerade as other users.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'masquerade_admin_settings',
),
'access callback' => 'user_access',
'access arguments' => array(
'administer masquerade',
),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}