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

user_load_by_name($name) Fetches a user object by account name. Parameters string $name: String with the account's user name. Return value object|bool A fully-loaded $user object upon successful user load or FALSE if user cannot be loaded. See also \Drupal\user\Entity\User::loadMultiple() File core/modules/user/user.module, line 251 Enables the user registration and login system. Code function user_load_by_name($name) { $users = \Drupal::entityTypeManager()->getStorage('user') -&g

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\