Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15400052
D16066.id38658.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D16066.id38658.diff
View Options
diff --git a/scripts/ssh/ssh-exec.php b/scripts/ssh/ssh-exec.php
--- a/scripts/ssh/ssh-exec.php
+++ b/scripts/ssh/ssh-exec.php
@@ -103,6 +103,9 @@
'Invalid username ("%s"). There is no user with this username.',
$user_name));
}
+
+ id(new PhabricatorAuthSessionEngine())
+ ->willServeRequestForUser($user);
} else if (strlen($device_name)) {
if (!$remote_address) {
throw new Exception(
diff --git a/src/applications/auth/engine/PhabricatorAuthSessionEngine.php b/src/applications/auth/engine/PhabricatorAuthSessionEngine.php
--- a/src/applications/auth/engine/PhabricatorAuthSessionEngine.php
+++ b/src/applications/auth/engine/PhabricatorAuthSessionEngine.php
@@ -164,7 +164,6 @@
$cache_raw = $this->filterRawCacheData($user, $types_map, $cache_raw);
$user->attachRawCacheData($cache_raw);
- $user->setAllowInlineCacheGeneration(true);
switch ($session_type) {
case PhabricatorAuthSession::TYPE_WEB:
@@ -832,4 +831,12 @@
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());
+ }
+
}
diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php
--- a/src/applications/base/controller/PhabricatorController.php
+++ b/src/applications/base/controller/PhabricatorController.php
@@ -104,7 +104,8 @@
$request->setUser($user);
}
- PhabricatorEnv::setLocaleCode($user->getTranslation());
+ id(new PhabricatorAuthSessionEngine())
+ ->willServeRequestForUser($user);
if (PhabricatorEnv::getEnvConfig('darkconsole.enabled')) {
$dark_console = PhabricatorDarkConsoleSetting::SETTINGKEY;
diff --git a/src/applications/conduit/controller/PhabricatorConduitAPIController.php b/src/applications/conduit/controller/PhabricatorConduitAPIController.php
--- a/src/applications/conduit/controller/PhabricatorConduitAPIController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitAPIController.php
@@ -487,6 +487,10 @@
}
$request->setUser($user);
+
+ id(new PhabricatorAuthSessionEngine())
+ ->willServeRequestForUser($user);
+
return null;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 9:21 AM (6 d, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225544
Default Alt Text
D16066.id38658.diff (2 KB)
Attached To
Mode
D16066: Centralize "this is the current user for the request" code
Attached
Detach File
Event Timeline
Log In to Comment