user_role_permissions

user_role_permissions(array $roles) Determine the permissions for one or more roles. Parameters array $roles: An array of role IDs. Return value array An array indexed by role ID. Each value is an array of permission strings for the given role. File core/modules/user/user.module, line 319 Enables the user registration and login system. Code function user_role_permissions(array $roles) { if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update') { return _user_role_permis

user_role_grant_permissions

user_role_grant_permissions($rid, array $permissions = array()) Grant permissions to a user role. Parameters mixed $rid: The ID of a user role to alter. array $permissions: (optional) A list of permission names to grant. See also user_role_change_permissions() user_role_revoke_permissions() File core/modules/user/user.module, line 1139 Enables the user registration and login system. Code function user_role_grant_permissions($rid, array $permissions = array()) { // Grant new permissions fo

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_role_load

user_role_load($rid) Fetches a user role by role ID. Parameters string $rid: A string representing the role ID. Return value \Drupal\user\RoleInterface|null A fully-loaded role object if a role with the given ID exists, or NULL otherwise. Deprecated in Drupal 8.x, will be removed before Drupal 9.0. Use \Drupal\user\Entity\Role::load(). File core/modules/user/user.module, line 1081 Enables the user registration and login system. Code function user_role_load($rid) { return Role::load($ri

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

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_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_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';