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_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_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_login_finalize

user_login_finalize(UserInterface $account) Finalizes the login process and logs in a user. The function logs in the user, records a watchdog message about the new session, saves the login timestamp, calls hook_user_login(), and generates a new session. The current user is replaced with the passed in account. Parameters \Drupal\user\UserInterface $account: The account to log in. See also hook_user_login() File core/modules/user/user.module, line 530 Enables the user registration and login sys

user_mail

user_mail($key, &$message, $params) Implements hook_mail(). File core/modules/user/user.module, line 910 Enables the user registration and login system. Code function user_mail($key, &$message, $params) { $token_service = \Drupal::token(); $language_manager = \Drupal::languageManager(); $langcode = $message['langcode']; $variables = array('user' => $params['account']); $language = \Drupal::languageManager()->getLanguage($params['account']->getPreferredLangcode());

user_logout

user_logout() Logs the current user out. File core/modules/user/user.module, line 1391 Enables the user registration and login system. Code function user_logout() { $user = \Drupal::currentUser(); \Drupal::logger('user')->notice('Session closed for %name.', array('%name' => $user->getAccountName())); \Drupal::moduleHandler()->invokeAll('user_logout', array($user)); // Destroy the current session, and reset $user to the anonymous user. // Note: In Symfony the session i

user_mail_tokens

user_mail_tokens(&$replacements, $data, $options) Token callback to add unsafe tokens for user mails. This function is used by \Drupal\Core\Utility\Token::replace() to set up some additional tokens that can be used in email messages generated by user_mail(). Parameters array $replacements: An associative array variable containing mappings from token names to values (for use with strtr()). array $data: An associative array of token replacement values. If the 'user' element exists, it must c

user_modules_uninstalled

user_modules_uninstalled($modules) Implements hook_modules_uninstalled(). File core/modules/user/user.module, line 1276 Enables the user registration and login system. Code function user_modules_uninstalled($modules) { // Remove any potentially orphan module data stored for users. \Drupal::service('user.data')->delete($modules); }

user_load

user_load($uid, $reset = FALSE) Loads a user object. Parameters int $uid: Integer specifying the user ID to load. bool $reset: TRUE to reset the internal cache and load from the database; FALSE (default) to load from the internal cache, if set. Return value \Drupal\user\UserInterface A fully-loaded user object upon successful user load, or NULL if the user cannot be loaded. Deprecated in Drupal 8.x, will be removed before Drupal 9.0. Use \Drupal\user\Entity\User::load(). See also \Drupal\

user_load_multiple

user_load_multiple(array $uids = NULL, $reset = FALSE) Loads multiple users based on certain conditions. This function should be used whenever you need to load more than one user from the database. Users are loaded into memory and will not require database access if loaded again during the same page request. Parameters array $uids: (optional) An array of entity IDs. If omitted, all entities are loaded. bool $reset: A boolean indicating that the internal cache should be reset. Use this if loadi