annotate core/lib/Drupal/Core/Session/AccountProxyInterface.php @ 13:5fb285c0d0e3

Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've been lucky to get away with this so far, as we don't support self-registration which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5 was vulnerable to.
author Chris Cannam
date Mon, 23 Apr 2018 09:33:26 +0100
parents 4c8ae668cc8c
children 1fec387a4317
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Core\Session;
Chris@0 4
Chris@0 5 /**
Chris@0 6 * Defines an interface for a service which has the current account stored.
Chris@0 7 *
Chris@0 8 * @ingroup user_api
Chris@0 9 */
Chris@0 10 interface AccountProxyInterface extends AccountInterface {
Chris@0 11
Chris@0 12 /**
Chris@0 13 * Sets the currently wrapped account.
Chris@0 14 *
Chris@0 15 * Setting the current account is highly discouraged! Instead, make sure to
Chris@0 16 * inject the desired user object into the dependent code directly.
Chris@0 17 *
Chris@0 18 * A preferable method of account impersonation is to use
Chris@0 19 * \Drupal\Core\Session\AccountSwitcherInterface::switchTo() and
Chris@0 20 * \Drupal\Core\Session\AccountSwitcherInterface::switchBack().
Chris@0 21 *
Chris@0 22 * @param \Drupal\Core\Session\AccountInterface $account
Chris@0 23 * The current account.
Chris@0 24 */
Chris@0 25 public function setAccount(AccountInterface $account);
Chris@0 26
Chris@0 27 /**
Chris@0 28 * Gets the currently wrapped account.
Chris@0 29 *
Chris@0 30 * @return \Drupal\Core\Session\AccountInterface
Chris@0 31 * The current account.
Chris@0 32 */
Chris@0 33 public function getAccount();
Chris@0 34
Chris@0 35 /**
Chris@0 36 * Sets the id of the initial account.
Chris@0 37 *
Chris@0 38 * Never use this method, its sole purpose is to work around weird effects
Chris@0 39 * during mid-request container rebuilds.
Chris@0 40 *
Chris@0 41 * @param int $account_id
Chris@0 42 * The id of the initial account.
Chris@0 43 */
Chris@0 44 public function setInitialAccountId($account_id);
Chris@0 45
Chris@0 46 }