user_password

user_password($length = 10) Generate a random alphanumeric password. File core/modules/user/user.module, line 281 Enables the user registration and login system. Code function user_password($length = 10) { // This variable contains the list of allowable characters for the // password. Note that the number 0 and the letter 'O' have been // removed to avoid confusion between the two. The same is true // of 'I', 1, and 'l'. $allowable_characters = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLM

user_pass_rehash

user_pass_rehash(UserInterface $account, $timestamp) Creates a unique hash value for use in time-dependent per-user URLs. This hash is normally used to build a unique and secure URL that is sent to the user by email for purposes such as resetting the user's password. In order to validate the URL, the same hash can be generated again, from the same information, and compared to the hash value from the URL. The hash contains the time stamp, the user's last login time, the numeric user ID, and the

user_pass_reset_url

user_pass_reset_url($account, $options = array()) Generates a unique URL for a user to log in and reset their password. Parameters \Drupal\user\UserInterface $account: An object containing the user account. array $options: (optional) A keyed array of settings. Supported options are: langcode: A language code to be used when generating locale-sensitive URLs. If langcode is NULL the users preferred language is used. Return value string A unique URL that provides a one-time log in for the use

user_picture_enabled

user_picture_enabled() Returns whether this site supports the default user picture feature. This approach preserves compatibility with node/comment templates. Alternate user picture implementations (e.g., Gravatar) should provide their own add/edit/delete forms and populate the 'picture' variable during the preprocess stage. File core/modules/user/user.module, line 130 Enables the user registration and login system. Code function user_picture_enabled() { $field_definitions = \Drupal::entity

user_preprocess_block

user_preprocess_block(&$variables) Implements hook_preprocess_HOOK() for block templates. File core/modules/user/user.module, line 401 Enables the user registration and login system. Code function user_preprocess_block(&$variables) { if ($variables['configuration']['provider'] == 'user') { switch ($variables['elements']['#plugin_id']) { case 'user_login_block': $variables['attributes']['role'] = 'form'; break; } } }

USER_REGISTER_ADMINISTRATORS_ONLY

Only administrators can create user accounts. File core/modules/user/user.module, line 37 Enables the user registration and login system. Code const USER_REGISTER_ADMINISTRATORS_ONLY = 'admin_only';

USER_REGISTER_VISITORS

Visitors can create their own accounts. File core/modules/user/user.module, line 42 Enables the user registration and login system. Code const USER_REGISTER_VISITORS = 'visitors';

USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL

Visitors can create accounts, but they don't become active without administrative approval. File core/modules/user/user.module, line 48 Enables the user registration and login system. Code const USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL = 'visitors_admin_approval';

user_roles

user_roles($membersonly = FALSE, $permission = NULL) Retrieve an array of roles matching specified conditions. Parameters bool $membersonly: (optional) Set this to TRUE to exclude the 'anonymous' role. Defaults to FALSE. string|null $permission: (optional) A string containing a permission. If set, only roles containing that permission are returned. Defaults to NULL, which returns all roles. Return value \Drupal\user\RoleInterface[] An associative array with the role id as the key and the role

user_role_change_permissions

user_role_change_permissions($rid, array $permissions = array()) Change permissions for a user role. This function may be used to grant and revoke multiple permissions at once. For example, when a form exposes checkboxes to configure permissions for a role, the form submit handler may directly pass the submitted values for the checkboxes form element to this function. Parameters mixed $rid: The ID of a user role to alter. array $permissions: (optional) An associative array, where the key holds