1 user.module user_menu()

Implements hook_menu().

File

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

Code

function user_menu() {
  $items['user/autocomplete'] = array(
    'title' => 'User autocomplete',
    'page callback' => 'user_autocomplete',
    'delivery callback' => 'backdrop_json_deliver',
    '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' => 'user-menu',
  );

  $items['user/login'] = array(
    'title' => 'Log in',
    'page callback' => 'backdrop_get_form',
    'page arguments' => array('user_login'),
    'access callback' => 'user_is_anonymous',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );

  $items['user/register'] = array(
    'title' => 'Create new account',
    'page callback' => 'backdrop_get_form',
    'page arguments' => array('user_register_form'),
    'access callback' => 'user_register_access',
    'type' => MENU_LOCAL_TASK,
  );

  $items['user/password'] = array(
    'title' => 'Reset password',
    'page callback' => 'backdrop_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' => 'user_pass_reset',
    'page arguments' => array(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' => 'user-menu',
    'file' => 'user.pages.inc',
  );

  $items['admin/people/create'] = array(
    'title' => 'Add user account',
    'page callback' => 'backdrop_get_form',
    'page arguments' => array('user_register_form'),
    'access arguments' => array('administer users'),
    'type' => MENU_LOCAL_ACTION,
  );
  $items['admin/people/cancel'] = array(
    'title' => 'Cancel user accounts',
    'page callback' => 'backdrop_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' => 'User accounts',
    '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' => backdrop_get_path('module', 'system'),
  );
  $items['admin/config/people/settings'] = array(
    'title' => 'Account settings',
    'description' => 'Configure settings for user accounts.',
    'page callback' => 'backdrop_get_form',
    'page arguments' => array('user_admin_settings'),
    'access arguments' => array('administer account settings'),
    'file' => 'user.admin.inc',
  );

  // Login settings.
  $items['admin/config/people/login'] = array(
    'title' => 'Login settings',
    'description' => 'Configure the way visitors may log in and limit login attempts.',
    'page callback' => 'backdrop_get_form',
    'page arguments' => array('user_login_settings'),
    'access arguments' => array('administer account settings'),
    'file' => 'user.admin.inc',
  );

  // Permissions forms.
  $items['admin/config/people/permissions'] = array(
    'title' => 'Permissions',
    'description' => 'Determine access to features by selecting permissions for roles.',
    'page callback' => 'backdrop_get_form',
    'page arguments' => array('user_admin_permissions'),
    'access arguments' => array('administer permissions'),
    'file' => 'user.admin.inc',
  );

  // Role forms.
  $items['admin/config/people/roles'] = array(
    'title' => 'Roles',
    'description' => 'List, edit, or add levels of access, or <em>user roles</em>.',
    'page callback' => 'backdrop_get_form',
    'page arguments' => array('user_admin_roles'),
    'access arguments' => array('administer permissions'),
    'file' => 'user.admin.inc',
  );
  $items['admin/config/people/roles/edit/%user_role'] = array(
    'title' => 'Edit role',
    'page arguments' => array('user_admin_role', 5),
    'access arguments' => array('administer permissions'),
  );
  $items['admin/config/people/roles/delete/%user_role'] = array(
    'title' => 'Delete role',
    'page callback' => 'backdrop_get_form',
    'page arguments' => array('user_admin_role_delete_confirm', 5),
    'access callback' => 'user_role_delete_access',
    'access arguments' => array(5),
    'file' => 'user.admin.inc',
  );

  // Emails.
  $items['admin/config/people/emails'] = array(
    'title' => 'Account emails',
    'description' => 'Configure email templates used for account registration and management.',
    'page callback' => 'backdrop_get_form',
    'page arguments' => array('user_settings_email'),
    'access arguments' => array('administer account settings'),
    'file' => 'user.admin.inc',
    '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),
    // By assigning a different menu name, this item (and all registered child
    // paths) are no longer considered as children of 'user'. When accessing the
    // user account pages, the preferred menu link that is used to build the
    // active trail (breadcrumb) will be found in this menu (unless there is
    // more specific link), so the link to 'user' will not be in the breadcrumb.
    'menu_name' => 'management',
  );

  $items['user/%user/view'] = array(
    'title' => 'View',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );

  $items['user/%user/cancel'] = array(
    'title' => 'Cancel account',
    'page callback' => 'backdrop_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' => 'backdrop_get_form',
    'page arguments' => array('user_profile_form', 1),
    'access callback' => 'user_edit_access',
    'access arguments' => array(1),
    'type' => MENU_LOCAL_TASK,
    'file' => 'user.pages.inc',
  );
  return $items;
}