commit 295ccaef18ea88b943bba015fb41ebfe09a642c4 Author: Joel Pittet Date: Thu Nov 21 16:52:20 2013 -0800 trying to remove others related to auth diff --git a/core/lib/Drupal/Core/Entity/EntityAccessController.php b/core/lib/Drupal/Core/Entity/EntityAccessController.php index c747cca..8fb1271 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessController.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessController.php @@ -277,7 +277,7 @@ protected function checkCreateAccess(AccountInterface $account, array $context, */ protected function prepareUser(AccountInterface $account = NULL) { if (!$account) { - $account = $GLOBALS['user']; + $account = \Drupal::currentUser(); } return $account; } diff --git a/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php index 5bdf61c..a2aa7d8 100644 --- a/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/AuthenticationSubscriber.php @@ -78,13 +78,13 @@ public function onException(GetResponseForExceptionEvent $event) { * {@inheritdoc} * * The priority for request must be higher than the highest event subscriber - * accessing the global $user. + * accessing the current user. * The priority for the response must be as low as possible allowing e.g the * Cookie provider to send all relevant session data to the user. */ public static function getSubscribedEvents() { // Priority must be higher than LanguageRequestSubscriber as LanguageManager - // access global $user in case language module enabled. + // access current user in case language module enabled. $events[KernelEvents::REQUEST][] = array('onKernelRequestAuthenticate', 300); $events[KernelEvents::RESPONSE][] = array('onRespond', 0); $events[KernelEvents::EXCEPTION][] = array('onException', 0); diff --git a/core/lib/Drupal/Core/Routing/Enhancer/AuthenticationEnhancer.php b/core/lib/Drupal/Core/Routing/Enhancer/AuthenticationEnhancer.php index 6e577b9..58cb0be 100644 --- a/core/lib/Drupal/Core/Routing/Enhancer/AuthenticationEnhancer.php +++ b/core/lib/Drupal/Core/Routing/Enhancer/AuthenticationEnhancer.php @@ -55,11 +55,6 @@ public function enhance(array $defaults, Request $request) { $anonymous_user = drupal_anonymous_user(); $this->container->set('current_user', $anonymous_user, 'request'); - - // The global $user object is included for backward compatibility only - // and should be considered deprecated. - // @todo Remove this line once global $user is no longer used. - $GLOBALS['user'] = $anonymous_user; } } return $defaults;