Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15187955
D10858.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
D10858.diff
View Options
diff --git a/src/applications/people/config/PhabricatorUserConfigOptions.php b/src/applications/people/config/PhabricatorUserConfigOptions.php
--- a/src/applications/people/config/PhabricatorUserConfigOptions.php
+++ b/src/applications/people/config/PhabricatorUserConfigOptions.php
@@ -43,6 +43,9 @@
pht('Make real names required'),
pht('Make real names optional'),
)),
+ $this->newOption('user.default-avatar', 'string', '')
+ ->setDescription(pht('Default File to use as user avatar.'))
+ ->addExample('F4', 'Use {{{F4}}} as default avatar'),
);
}
diff --git a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
--- a/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
+++ b/src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
@@ -98,8 +98,6 @@
$form = id(new PHUIFormLayoutView())
->setUser($viewer);
- $default_image = PhabricatorFile::loadBuiltin($viewer, 'profile.png');
-
$images = array();
$current = $user->getProfileImagePHID();
@@ -157,7 +155,7 @@
}
$images[PhabricatorPHIDConstants::PHID_VOID] = array(
- 'uri' => $default_image->getBestURI(),
+ 'uri' => PhabricatorUser::getDefaultProfileImageURI(),
'tip' => pht('Default Picture'),
);
diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php
--- a/src/applications/people/storage/PhabricatorUser.php
+++ b/src/applications/people/storage/PhabricatorUser.php
@@ -654,6 +654,14 @@
}
public static function getDefaultProfileImageURI() {
+ $defaultAvatar = PhabricatorEnv::getEnvConfig('user.default-avatar');
+ if (0 === strncmp($defaultAvatar, 'F', 1)) {
+ $file = id(new PhabricatorFile())
+ ->loadOneWhere('id = %s', substr($defaultAvatar, 1));
+ if ($file) {
+ return $file->getBestURI();
+ }
+ }
return celerity_get_resource_uri('/rsrc/image/avatar.png');
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 22, 12:12 PM (1 h, 53 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7180513
Default Alt Text
D10858.diff (2 KB)
Attached To
Mode
D10858: Make default profile image configurable
Attached
Detach File
Event Timeline
Log In to Comment