function user_menu

Implements hook_menu().

File

drupal/core/modules/user/user.module, line 853
Enables the user registration and login system.

Code

function user_menu() {

  // 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,
  );
  $items['user/register'] = array(
    'title' => 'Create new account',
    'type' => MENU_LOCAL_TASK,
    'route_name' => 'user_register',
  );
  $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',
    'route_name' => 'user_logout',
    'weight' => 10,
    'menu_name' => 'account',
  );

  // User listing pages.
  $items['admin/people'] = array(
    'title' => 'People',
    'description' => 'Manage user accounts, roles, and permissions.',
    'page callback' => 'user_admin_account',
    'access arguments' => array(
      'administer users',
    ),
    'position' => 'left',
    'weight' => -4,
    '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.',
    'route_name' => 'user_role_list',
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/people/roles/add'] = array(
    'title' => 'Add role',
    'route_name' => 'user_role_add',
    'type' => MENU_LOCAL_ACTION,
  );
  $items['admin/people/roles/manage/%user_role'] = array(
    'title' => 'Edit role',
    'route_name' => 'user_role_edit',
  );
  $items['admin/people/roles/manage/%user_role/edit'] = array(
    'title' => 'Edit',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/people/roles/manage/%user_role/delete'] = array(
    'title' => 'Delete role',
    'route_name' => 'user_role_delete',
    'weight' => 10,
    'context' => MENU_CONTEXT_INLINE,
  );
  $items['admin/people/create'] = array(
    'title' => 'Add user',
    'route_name' => 'user_admin_create',
    'type' => MENU_LOCAL_ACTION,
  );
  $items['admin/people/cancel'] = array(
    'title' => 'Cancel user',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_multiple_cancel_confirm',
    ),
    'access arguments' => array(
      'administer users',
    ),
    'file' => 'user.admin.inc',
    'type' => MENU_CALLBACK,
  );

  // 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.',
    'weight' => -10,
    'route_name' => 'user_account_settings',
  );
  $items['admin/config/people/accounts/settings'] = array(
    'title' => 'Settings',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $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' => 'entity_page_access',
    'access arguments' => array(
      1,
    ),
  );
  $items['user/%user/view'] = array(
    'title' => 'View',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['user/%user/cancel'] = array(
    'title' => 'Cancel account',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_cancel_confirm_form',
      1,
    ),
    'access callback' => 'entity_page_access',
    'access arguments' => array(
      1,
      'delete',
    ),
    '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' => 'entity_page_access',
    'access arguments' => array(
      1,
      'delete',
    ),
    'file' => 'user.pages.inc',
  );
  $items['user/%user/edit'] = array(
    'title' => 'Edit',
    'page callback' => 'entity_get_form',
    'page arguments' => array(
      1,
      'profile',
    ),
    'access callback' => 'entity_page_access',
    'access arguments' => array(
      1,
      'update',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'user.pages.inc',
  );
  return $items;
}