W3cubDocs

/Drupal 8

user.module

Enables the user registration and login system.

File

core/modules/user/user.module

Functions

Name Description
template_preprocess_user Prepares variables for user templates.
template_preprocess_username Prepares variables for username templates.
user_cancel Cancel a user account.
user_cancel_methods Helper function to return available account cancellation methods.
user_cancel_url Generates a URL to confirm an account cancellation request.
user_cookie_delete Delete a visitor information cookie.
user_cookie_save Saves visitor information as a cookie so it can be reused.
user_delete Delete a user.
user_delete_multiple Delete multiple user accounts.
user_element_info_alter Implements hook_element_info_alter().
user_entity_extra_field_info Implements hook_entity_extra_field_info().
user_format_name Deprecated Format a username.
user_form_process_password_confirm Form element process handler for client-side password validation.
user_help Implements hook_help().
user_is_blocked Checks for usernames blocked by user administration.
user_js_settings_alter Implements hook_js_settings_alter().
user_load Deprecated Loads a user object.
user_load_by_mail Fetches a user object by email address.
user_load_by_name Fetches a user object by account name.
user_load_multiple Deprecated Loads multiple users based on certain conditions.
user_login_finalize Finalizes the login process and logs in a user.
user_logout Logs the current user out.
user_mail Implements hook_mail().
user_mail_tokens Token callback to add unsafe tokens for user mails.
user_modules_uninstalled Implements hook_modules_uninstalled().
user_password Generate a random alphanumeric password.
user_pass_rehash Creates a unique hash value for use in time-dependent per-user URLs.
user_pass_reset_url Generates a unique URL for a user to log in and reset their password.
user_picture_enabled Returns whether this site supports the default user picture feature.
user_preprocess_block Implements hook_preprocess_HOOK() for block templates.
user_roles Retrieve an array of roles matching specified conditions.
user_role_change_permissions Change permissions for a user role.
user_role_grant_permissions Grant permissions to a user role.
user_role_load Deprecated Fetches a user role by role ID.
user_role_names Retrieves the names of roles matching specified conditions.
user_role_permissions Determine the permissions for one or more roles.
user_role_revoke_permissions Revoke permissions from a user role.
user_template_preprocess_default_variables_alter Implements hook_template_preprocess_default_variables_alter().
user_theme Implements hook_theme().
user_toolbar Implements hook_toolbar().
user_user_login Implements hook_user_login().
user_user_logout Implements hook_user_logout().
user_user_role_delete Implements hook_ENTITY_TYPE_delete() for user_role entities.
user_user_role_insert Implements hook_ENTITY_TYPE_insert() for user_role entities.
user_user_view Implements hook_ENTITY_TYPE_view() for user entities.
user_user_view_alter Implements hook_ENTITY_TYPE_view_alter() for user entities.
user_validate_name Verify the syntax of the given name.
user_view Generate an array for rendering the given user.
user_view_multiple Constructs a drupal_render() style array from an array of loaded users.
_user_cancel Implements callback_batch_operation().
_user_cancel_session_regenerate Implements callback_batch_finished().
_user_mail_notify Conditionally create and send a notification email when a certain operation happens on the given user account.
_user_role_permissions_update Determine the permissions for one or more roles during update.

Constants

Name Description
USERNAME_MAX_LENGTH Maximum length of username text field.
USER_REGISTER_ADMINISTRATORS_ONLY Only administrators can create user accounts.
USER_REGISTER_VISITORS Visitors can create their own accounts.
USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL Visitors can create accounts, but they don't become active without administrative approval.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!user!user.module/8.1.x