Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/engine/PhabricatorAuthSessionEngine.php
| Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | foreach ($info as $key => $value) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| } | } | ||||
| $user = $user_table->loadFromArray($info); | $user = $user_table->loadFromArray($info); | ||||
| $cache_raw = $this->filterRawCacheData($user, $types_map, $cache_raw); | $cache_raw = $this->filterRawCacheData($user, $types_map, $cache_raw); | ||||
| $user->attachRawCacheData($cache_raw); | $user->attachRawCacheData($cache_raw); | ||||
| $user->setAllowInlineCacheGeneration(true); | |||||
| switch ($session_type) { | switch ($session_type) { | ||||
| case PhabricatorAuthSession::TYPE_WEB: | case PhabricatorAuthSession::TYPE_WEB: | ||||
| // Explicitly prevent bots and mailing lists from establishing web | // Explicitly prevent bots and mailing lists from establishing web | ||||
| // sessions. It's normally impossible to attach authentication to these | // sessions. It's normally impossible to attach authentication to these | ||||
| // accounts, and likewise impossible to generate sessions, but it's | // accounts, and likewise impossible to generate sessions, but it's | ||||
| // technically possible that a session could exist in the database. If | // technically possible that a session could exist in the database. If | ||||
| // one does somehow, refuse to load it. | // one does somehow, refuse to load it. | ||||
| ▲ Show 20 Lines • Show All 651 Lines • ▼ Show 20 Lines | foreach ($cache_raw as $cache_key => $cache_data) { | ||||
| unset($cache_raw[$cache_key]); | unset($cache_raw[$cache_key]); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return $cache_raw; | return $cache_raw; | ||||
| } | } | ||||
| public function willServeRequestForUser(PhabricatorUser $user) { | |||||
| // We allow the login user to generate any missing cache data inline. | |||||
| $user->setAllowInlineCacheGeneration(true); | |||||
| // Switch to the user's translation. | |||||
| PhabricatorEnv::setLocaleCode($user->getTranslation()); | |||||
| } | |||||
| } | } | ||||