Implements hook_menu().
function user_menu() {
$items['user/autocomplete'] = array(
'title' => 'User autocomplete',
'page callback' => 'user_autocomplete',
'access callback' => 'user_access',
'access arguments' => array(
'access user profiles',
),
'type' => MENU_CALLBACK,
'file' => 'user.pages.inc',
);
// Registration and login pages.
$items['user'] = array(
'title' => 'User account',
'title callback' => 'user_menu_title',
'page callback' => 'user_page',
'access callback' => TRUE,
'file' => 'user.pages.inc',
'weight' => -10,
'menu_name' => 'account',
);
$items['user/login'] = array(
'title' => 'Log in',
'access callback' => 'user_is_anonymous',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
// Other authentication methods may add pages below user/login/.
$items['user/login/default'] = array(
'title' => 'Username and password',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['user/register'] = array(
'title' => 'Create new account',
'type' => MENU_LOCAL_TASK,
// @todo This route is now declared in user.routing.yml, so the below are
// only needed for drupal_valid_path(). Without a non-empty (but not
// necessarily valid) page callback, _menu_router_build() overrides the
// access callback to 0. Remove once drupal_valid_path works with the new
// routing system: http://drupal.org/node/1793520.
'page callback' => 'NOT_USED',
'access callback' => 'user_register_access',
);
$items['user/password'] = array(
'title' => 'Request new password',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'user_pass',
),
'access callback' => TRUE,
'type' => MENU_LOCAL_TASK,
'file' => 'user.pages.inc',
);
$items['user/reset/%/%/%'] = array(
'title' => 'Reset password',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'user_pass_reset',
2,
3,
4,
),
'access callback' => TRUE,
'type' => MENU_CALLBACK,
'file' => 'user.pages.inc',
);
$items['user/logout'] = array(
'title' => 'Log out',
'access callback' => 'user_is_logged_in',
'page callback' => 'user_logout',
'weight' => 10,
'menu_name' => 'account',
'file' => 'user.pages.inc',
);
// User listing pages.
$items['admin/people'] = array(
'title' => 'People',
'description' => 'Manage user accounts, roles, and permissions.',
'page callback' => 'user_admin',
'page arguments' => array(
'list',
),
'access arguments' => array(
'administer users',
),
'position' => 'left',
'weight' => -4,
'file' => 'user.admin.inc',
);
$items['admin/people/people'] = array(
'title' => 'List',
'description' => 'Find and manage people interacting with your site.',
'access arguments' => array(
'administer users',
),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
'file' => 'user.admin.inc',
);
// Permissions and role forms.
$items['admin/people/permissions'] = array(
'title' => 'Permissions',
'description' => 'Determine access to features by selecting permissions for roles.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'user_admin_permissions',
),
'access arguments' => array(
'administer permissions',
),
'file' => 'user.admin.inc',
'type' => MENU_LOCAL_TASK,
);
$items['admin/people/roles'] = array(
'title' => 'Roles',
'description' => 'List, edit, or add user roles.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'user_admin_roles',
),
'access arguments' => array(
'administer permissions',
),
'file' => 'user.admin.inc',
'type' => MENU_LOCAL_TASK,
);
$items['admin/people/roles/edit/%user_role'] = array(
'title' => 'Edit role',
'page arguments' => array(
'user_admin_role',
4,
),
'access arguments' => array(
'administer permissions',
),
);
$items['admin/people/roles/delete/%user_role'] = array(
'title' => 'Delete role',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'user_admin_role_delete_confirm',
4,
),
'access callback' => 'user_role_delete_access',
'access arguments' => array(
4,
),
'file' => 'user.admin.inc',
);
$items['admin/people/create'] = array(
'title' => 'Add user',
'page arguments' => array(
'create',
),
'access arguments' => array(
'administer users',
),
'type' => MENU_LOCAL_ACTION,
);
// Administration pages.
$items['admin/config/people'] = array(
'title' => 'People',
'description' => 'Configure user accounts.',
'position' => 'left',
'weight' => -20,
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array(
'access administration pages',
),
'file' => 'system.admin.inc',
'file path' => drupal_get_path('module', 'system'),
);
$items['admin/config/people/accounts'] = array(
'title' => 'Account settings',
'description' => 'Configure default behavior of users, including registration requirements, e-mails, and fields.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'user_admin_settings',
),
'access arguments' => array(
'administer users',
),
'file' => 'user.admin.inc',
'weight' => -10,
);
$items['admin/config/people/accounts/settings'] = array(
'title' => 'Settings',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['user/%user'] = array(
'title' => 'My account',
'title callback' => 'user_page_title',
'title arguments' => array(
1,
),
'page callback' => 'user_view_page',
'page arguments' => array(
1,
),
'access callback' => 'user_view_access',
'access arguments' => array(
1,
),
);
$items['user/%user/view'] = array(
'title' => 'View',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['user/%user/cancel'] = array(
'title' => 'Cancel account',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'user_cancel_confirm_form',
1,
),
'access callback' => 'user_cancel_access',
'access arguments' => array(
1,
),
'file' => 'user.pages.inc',
);
$items['user/%user/cancel/confirm/%/%'] = array(
'title' => 'Confirm account cancellation',
'page callback' => 'user_cancel_confirm',
'page arguments' => array(
1,
4,
5,
),
'access callback' => 'user_cancel_access',
'access arguments' => array(
1,
),
'file' => 'user.pages.inc',
);
$items['user/%user/edit'] = array(
'title' => 'Edit',
'page callback' => 'entity_get_form',
'page arguments' => array(
1,
'profile',
),
'access callback' => 'user_edit_access',
'access arguments' => array(
1,
),
'type' => MENU_LOCAL_TASK,
'file' => 'user.pages.inc',
);
return $items;
}