Compare commits
5 Commits
blender-tw
...
blender-tw
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
436e69f1d0 | ||
| 5db4b6f01a | |||
| 5aabb434b1 | |||
| eced78a591 | |||
| fb3e6ba493 |
@@ -137,7 +137,7 @@ return array(
|
|||||||
'rsrc/css/phui/object-item/phui-oi-simple-ui.css' => '6a30fa46',
|
'rsrc/css/phui/object-item/phui-oi-simple-ui.css' => '6a30fa46',
|
||||||
'rsrc/css/phui/phui-action-list.css' => '1b0085b2',
|
'rsrc/css/phui/phui-action-list.css' => '1b0085b2',
|
||||||
'rsrc/css/phui/phui-action-panel.css' => '6c386cbf',
|
'rsrc/css/phui/phui-action-panel.css' => '6c386cbf',
|
||||||
'rsrc/css/phui/phui-badge.css' => '666e25ad',
|
'rsrc/css/phui/phui-badge.css' => '96576409',
|
||||||
'rsrc/css/phui/phui-basic-nav-view.css' => '56ebd66d',
|
'rsrc/css/phui/phui-basic-nav-view.css' => '56ebd66d',
|
||||||
'rsrc/css/phui/phui-big-info-view.css' => '362ad37b',
|
'rsrc/css/phui/phui-big-info-view.css' => '362ad37b',
|
||||||
'rsrc/css/phui/phui-box.css' => '5ed3b8cb',
|
'rsrc/css/phui/phui-box.css' => '5ed3b8cb',
|
||||||
@@ -188,6 +188,14 @@ return array(
|
|||||||
'rsrc/css/sprite-tokens.css' => 'f1896dc5',
|
'rsrc/css/sprite-tokens.css' => 'f1896dc5',
|
||||||
'rsrc/css/syntax/syntax-default.css' => '055fc231',
|
'rsrc/css/syntax/syntax-default.css' => '055fc231',
|
||||||
'rsrc/custom/css/phabricator-welcome-page.css' => 'a641fcc9',
|
'rsrc/custom/css/phabricator-welcome-page.css' => 'a641fcc9',
|
||||||
|
'rsrc/custom/image/badges/badge_devfund_bronze.png' => '0f98ccf2',
|
||||||
|
'rsrc/custom/image/badges/badge_devfund_diamond.png' => '196d8206',
|
||||||
|
'rsrc/custom/image/badges/badge_devfund_gold.png' => 'd03e1722',
|
||||||
|
'rsrc/custom/image/badges/badge_devfund_platinum.png' => '3e517840',
|
||||||
|
'rsrc/custom/image/badges/badge_devfund_silver.png' => '73594dee',
|
||||||
|
'rsrc/custom/image/badges/badge_devfund_titanium.png' => 'e30aa898',
|
||||||
|
'rsrc/custom/image/badges/badge_sprite_fright.png' => '6f4b20e6',
|
||||||
|
'rsrc/custom/image/badges/badge_studio.png' => 'ffbdcabb',
|
||||||
'rsrc/custom/image/blender_logo.png' => '86dc8498',
|
'rsrc/custom/image/blender_logo.png' => '86dc8498',
|
||||||
'rsrc/externals/d3/d3.min.js' => '9d068042',
|
'rsrc/externals/d3/d3.min.js' => '9d068042',
|
||||||
'rsrc/externals/font/fontawesome/fontawesome-webfont.eot' => '23f8c698',
|
'rsrc/externals/font/fontawesome/fontawesome-webfont.eot' => '23f8c698',
|
||||||
@@ -823,7 +831,7 @@ return array(
|
|||||||
'phrequent-css' => 'bd79cc67',
|
'phrequent-css' => 'bd79cc67',
|
||||||
'phriction-document-css' => '03380da0',
|
'phriction-document-css' => '03380da0',
|
||||||
'phui-action-panel-css' => '6c386cbf',
|
'phui-action-panel-css' => '6c386cbf',
|
||||||
'phui-badge-view-css' => '666e25ad',
|
'phui-badge-view-css' => '96576409',
|
||||||
'phui-basic-nav-view-css' => '56ebd66d',
|
'phui-basic-nav-view-css' => '56ebd66d',
|
||||||
'phui-big-info-view-css' => '362ad37b',
|
'phui-big-info-view-css' => '362ad37b',
|
||||||
'phui-box-css' => '5ed3b8cb',
|
'phui-box-css' => '5ed3b8cb',
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ class Configuration {
|
|||||||
$this->config_file = "$gitolite_root/conf/gitolite.conf";
|
$this->config_file = "$gitolite_root/conf/gitolite.conf";
|
||||||
|
|
||||||
$this->collectSystemPublicKeys();
|
$this->collectSystemPublicKeys();
|
||||||
|
|
||||||
|
$this->used_keys = array();
|
||||||
$this->committers = array();
|
$this->committers = array();
|
||||||
|
|
||||||
if (!file_exists($this->config_file)) {
|
if (!file_exists($this->config_file)) {
|
||||||
@@ -121,8 +123,10 @@ class Configuration {
|
|||||||
$variable_name = trim($parts[0]);
|
$variable_name = trim($parts[0]);
|
||||||
if (array_key_exists($variable_name, $this->committers)) {
|
if (array_key_exists($variable_name, $this->committers)) {
|
||||||
$system_committers = $this->getNonPhabtricatorUsers($parts[1]);
|
$system_committers = $this->getNonPhabtricatorUsers($parts[1]);
|
||||||
$committers = implode(' ', array_merge(
|
$all_committers = array_merge(
|
||||||
$system_committers, $this->committers[$variable_name]));
|
$system_committers, $this->committers[$variable_name]);
|
||||||
|
$unique_committers = array_unique($all_committers);
|
||||||
|
$committers = implode(' ', $unique_committers);
|
||||||
$line = "$variable_name = $committers";
|
$line = "$variable_name = $committers";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2166,6 +2166,7 @@ phutil_register_library_map(array(
|
|||||||
'PasteSearchConduitAPIMethod' => 'applications/paste/conduit/PasteSearchConduitAPIMethod.php',
|
'PasteSearchConduitAPIMethod' => 'applications/paste/conduit/PasteSearchConduitAPIMethod.php',
|
||||||
'PeopleBrowseUserDirectoryCapability' => 'applications/people/capability/PeopleBrowseUserDirectoryCapability.php',
|
'PeopleBrowseUserDirectoryCapability' => 'applications/people/capability/PeopleBrowseUserDirectoryCapability.php',
|
||||||
'PeopleCreateUsersCapability' => 'applications/people/capability/PeopleCreateUsersCapability.php',
|
'PeopleCreateUsersCapability' => 'applications/people/capability/PeopleCreateUsersCapability.php',
|
||||||
|
'PeopleDisableSpamUsersCapability' => 'applications/people/capability/PeopleDisableSpamUsersCapability.php',
|
||||||
'PeopleDisableUsersCapability' => 'applications/people/capability/PeopleDisableUsersCapability.php',
|
'PeopleDisableUsersCapability' => 'applications/people/capability/PeopleDisableUsersCapability.php',
|
||||||
'PeopleHovercardEngineExtension' => 'applications/people/engineextension/PeopleHovercardEngineExtension.php',
|
'PeopleHovercardEngineExtension' => 'applications/people/engineextension/PeopleHovercardEngineExtension.php',
|
||||||
'PeopleMainMenuBarExtension' => 'applications/people/engineextension/PeopleMainMenuBarExtension.php',
|
'PeopleMainMenuBarExtension' => 'applications/people/engineextension/PeopleMainMenuBarExtension.php',
|
||||||
@@ -4167,6 +4168,7 @@ phutil_register_library_map(array(
|
|||||||
'PhabricatorPeopleRenameController' => 'applications/people/controller/PhabricatorPeopleRenameController.php',
|
'PhabricatorPeopleRenameController' => 'applications/people/controller/PhabricatorPeopleRenameController.php',
|
||||||
'PhabricatorPeopleRevisionsProfileMenuItem' => 'applications/people/menuitem/PhabricatorPeopleRevisionsProfileMenuItem.php',
|
'PhabricatorPeopleRevisionsProfileMenuItem' => 'applications/people/menuitem/PhabricatorPeopleRevisionsProfileMenuItem.php',
|
||||||
'PhabricatorPeopleSearchEngine' => 'applications/people/query/PhabricatorPeopleSearchEngine.php',
|
'PhabricatorPeopleSearchEngine' => 'applications/people/query/PhabricatorPeopleSearchEngine.php',
|
||||||
|
'PhabricatorPeopleSpamController' => 'applications/people/controller/PhabricatorPeopleSpamController.php',
|
||||||
'PhabricatorPeopleTasksProfileMenuItem' => 'applications/people/menuitem/PhabricatorPeopleTasksProfileMenuItem.php',
|
'PhabricatorPeopleTasksProfileMenuItem' => 'applications/people/menuitem/PhabricatorPeopleTasksProfileMenuItem.php',
|
||||||
'PhabricatorPeopleTestDataGenerator' => 'applications/people/lipsum/PhabricatorPeopleTestDataGenerator.php',
|
'PhabricatorPeopleTestDataGenerator' => 'applications/people/lipsum/PhabricatorPeopleTestDataGenerator.php',
|
||||||
'PhabricatorPeopleTransactionQuery' => 'applications/people/query/PhabricatorPeopleTransactionQuery.php',
|
'PhabricatorPeopleTransactionQuery' => 'applications/people/query/PhabricatorPeopleTransactionQuery.php',
|
||||||
@@ -5059,6 +5061,7 @@ phutil_register_library_map(array(
|
|||||||
'PhabricatorUserCustomFieldNumericIndex' => 'applications/people/storage/PhabricatorUserCustomFieldNumericIndex.php',
|
'PhabricatorUserCustomFieldNumericIndex' => 'applications/people/storage/PhabricatorUserCustomFieldNumericIndex.php',
|
||||||
'PhabricatorUserCustomFieldStringIndex' => 'applications/people/storage/PhabricatorUserCustomFieldStringIndex.php',
|
'PhabricatorUserCustomFieldStringIndex' => 'applications/people/storage/PhabricatorUserCustomFieldStringIndex.php',
|
||||||
'PhabricatorUserDAO' => 'applications/people/storage/PhabricatorUserDAO.php',
|
'PhabricatorUserDAO' => 'applications/people/storage/PhabricatorUserDAO.php',
|
||||||
|
'PhabricatorUserDisableSpamTransaction' => 'applications/people/xaction/PhabricatorUserDisableSpamTransaction.php',
|
||||||
'PhabricatorUserDisableTransaction' => 'applications/people/xaction/PhabricatorUserDisableTransaction.php',
|
'PhabricatorUserDisableTransaction' => 'applications/people/xaction/PhabricatorUserDisableTransaction.php',
|
||||||
'PhabricatorUserEditEngine' => 'applications/people/editor/PhabricatorUserEditEngine.php',
|
'PhabricatorUserEditEngine' => 'applications/people/editor/PhabricatorUserEditEngine.php',
|
||||||
'PhabricatorUserEditor' => 'applications/people/editor/PhabricatorUserEditor.php',
|
'PhabricatorUserEditor' => 'applications/people/editor/PhabricatorUserEditor.php',
|
||||||
@@ -8473,6 +8476,7 @@ phutil_register_library_map(array(
|
|||||||
'PasteSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod',
|
'PasteSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod',
|
||||||
'PeopleBrowseUserDirectoryCapability' => 'PhabricatorPolicyCapability',
|
'PeopleBrowseUserDirectoryCapability' => 'PhabricatorPolicyCapability',
|
||||||
'PeopleCreateUsersCapability' => 'PhabricatorPolicyCapability',
|
'PeopleCreateUsersCapability' => 'PhabricatorPolicyCapability',
|
||||||
|
'PeopleDisableSpamUsersCapability' => 'PhabricatorPolicyCapability',
|
||||||
'PeopleDisableUsersCapability' => 'PhabricatorPolicyCapability',
|
'PeopleDisableUsersCapability' => 'PhabricatorPolicyCapability',
|
||||||
'PeopleHovercardEngineExtension' => 'PhabricatorHovercardEngineExtension',
|
'PeopleHovercardEngineExtension' => 'PhabricatorHovercardEngineExtension',
|
||||||
'PeopleMainMenuBarExtension' => 'PhabricatorMainMenuBarExtension',
|
'PeopleMainMenuBarExtension' => 'PhabricatorMainMenuBarExtension',
|
||||||
@@ -10790,6 +10794,7 @@ phutil_register_library_map(array(
|
|||||||
'PhabricatorPeopleRenameController' => 'PhabricatorPeopleController',
|
'PhabricatorPeopleRenameController' => 'PhabricatorPeopleController',
|
||||||
'PhabricatorPeopleRevisionsProfileMenuItem' => 'PhabricatorProfileMenuItem',
|
'PhabricatorPeopleRevisionsProfileMenuItem' => 'PhabricatorProfileMenuItem',
|
||||||
'PhabricatorPeopleSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
'PhabricatorPeopleSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||||
|
'PhabricatorPeopleSpamController' => 'PhabricatorPeopleController',
|
||||||
'PhabricatorPeopleTasksProfileMenuItem' => 'PhabricatorProfileMenuItem',
|
'PhabricatorPeopleTasksProfileMenuItem' => 'PhabricatorProfileMenuItem',
|
||||||
'PhabricatorPeopleTestDataGenerator' => 'PhabricatorTestDataGenerator',
|
'PhabricatorPeopleTestDataGenerator' => 'PhabricatorTestDataGenerator',
|
||||||
'PhabricatorPeopleTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
'PhabricatorPeopleTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||||
@@ -11860,6 +11865,7 @@ phutil_register_library_map(array(
|
|||||||
'PhabricatorUserCustomFieldNumericIndex' => 'PhabricatorCustomFieldNumericIndexStorage',
|
'PhabricatorUserCustomFieldNumericIndex' => 'PhabricatorCustomFieldNumericIndexStorage',
|
||||||
'PhabricatorUserCustomFieldStringIndex' => 'PhabricatorCustomFieldStringIndexStorage',
|
'PhabricatorUserCustomFieldStringIndex' => 'PhabricatorCustomFieldStringIndexStorage',
|
||||||
'PhabricatorUserDAO' => 'PhabricatorLiskDAO',
|
'PhabricatorUserDAO' => 'PhabricatorLiskDAO',
|
||||||
|
'PhabricatorUserDisableSpamTransaction' => 'PhabricatorUserTransactionType',
|
||||||
'PhabricatorUserDisableTransaction' => 'PhabricatorUserTransactionType',
|
'PhabricatorUserDisableTransaction' => 'PhabricatorUserTransactionType',
|
||||||
'PhabricatorUserEditEngine' => 'PhabricatorEditEngine',
|
'PhabricatorUserEditEngine' => 'PhabricatorEditEngine',
|
||||||
'PhabricatorUserEditor' => 'PhabricatorEditor',
|
'PhabricatorUserEditor' => 'PhabricatorEditor',
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ final class PhabricatorPeopleApplication extends PhabricatorApplication {
|
|||||||
=> 'PhabricatorPeopleDisableController',
|
=> 'PhabricatorPeopleDisableController',
|
||||||
'(?P<via>disable)/(?P<id>[1-9]\d*)/'
|
'(?P<via>disable)/(?P<id>[1-9]\d*)/'
|
||||||
=> 'PhabricatorPeopleDisableController',
|
=> 'PhabricatorPeopleDisableController',
|
||||||
|
'spam/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleSpamController',
|
||||||
'empower/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleEmpowerController',
|
'empower/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleEmpowerController',
|
||||||
'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleDeleteController',
|
'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleDeleteController',
|
||||||
'rename/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleRenameController',
|
'rename/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleRenameController',
|
||||||
@@ -99,6 +100,9 @@ final class PhabricatorPeopleApplication extends PhabricatorApplication {
|
|||||||
PeopleDisableUsersCapability::CAPABILITY => array(
|
PeopleDisableUsersCapability::CAPABILITY => array(
|
||||||
'default' => PhabricatorPolicies::POLICY_ADMIN,
|
'default' => PhabricatorPolicies::POLICY_ADMIN,
|
||||||
),
|
),
|
||||||
|
PeopleDisableSpamUsersCapability::CAPABILITY => array(
|
||||||
|
'default' => PhabricatorPolicies::POLICY_ADMIN,
|
||||||
|
),
|
||||||
PeopleBrowseUserDirectoryCapability::CAPABILITY => array(),
|
PeopleBrowseUserDirectoryCapability::CAPABILITY => array(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
final class PeopleDisableSpamUsersCapability
|
||||||
|
extends PhabricatorPolicyCapability {
|
||||||
|
|
||||||
|
const CAPABILITY = 'people.disable_spam.users';
|
||||||
|
|
||||||
|
public function getCapabilityName() {
|
||||||
|
return pht('Can Disable Spammers');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function describeCapabilityRejection() {
|
||||||
|
return pht('You do not have permission to handle spam users.');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -93,6 +93,10 @@ final class PhabricatorPeopleProfileManageController
|
|||||||
PeopleDisableUsersCapability::CAPABILITY);
|
PeopleDisableUsersCapability::CAPABILITY);
|
||||||
$can_disable = ($has_disable && !$is_self);
|
$can_disable = ($has_disable && !$is_self);
|
||||||
|
|
||||||
|
$has_disable_spam_capability = $this->hasApplicationCapability(
|
||||||
|
PeopleDisableSpamUsersCapability::CAPABILITY);
|
||||||
|
$can_disable_spam = ($has_disable_spam_capability && !$is_self);
|
||||||
|
|
||||||
$id = $user->getID();
|
$id = $user->getID();
|
||||||
|
|
||||||
$welcome_engine = id(new PhabricatorPeopleWelcomeMailEngine())
|
$welcome_engine = id(new PhabricatorPeopleWelcomeMailEngine())
|
||||||
@@ -193,6 +197,14 @@ final class PhabricatorPeopleProfileManageController
|
|||||||
->setWorkflow(true)
|
->setWorkflow(true)
|
||||||
->setHref($this->getApplicationURI('disable/'.$id.'/')));
|
->setHref($this->getApplicationURI('disable/'.$id.'/')));
|
||||||
|
|
||||||
|
$curtain->addAction(
|
||||||
|
id(new PhabricatorActionView())
|
||||||
|
->setIcon('fa-shield')
|
||||||
|
->setName(pht('Disable as Spam'))
|
||||||
|
->setDisabled(!$can_disable_spam)
|
||||||
|
->setWorkflow(true)
|
||||||
|
->setHref($this->getApplicationURI('spam/'.$id.'/')));
|
||||||
|
|
||||||
$curtain->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setIcon('fa-times')
|
->setIcon('fa-times')
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
final class PhabricatorPeopleSpamController
|
||||||
|
extends PhabricatorPeopleController {
|
||||||
|
|
||||||
|
public function shouldRequireAdmin() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handleRequest(AphrontRequest $request) {
|
||||||
|
$viewer = $this->getViewer();
|
||||||
|
$id = $request->getURIData('id');
|
||||||
|
|
||||||
|
$user = id(new PhabricatorPeopleQuery())
|
||||||
|
->setViewer($viewer)
|
||||||
|
->withIDs(array($id))
|
||||||
|
->executeOne();
|
||||||
|
if (!$user) {
|
||||||
|
return new Aphront404Response();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->requireApplicationCapability(
|
||||||
|
PeopleDisableUsersCapability::CAPABILITY);
|
||||||
|
|
||||||
|
$actor = $viewer;
|
||||||
|
$done_uri = $this->getApplicationURI("manage/{$id}/");
|
||||||
|
|
||||||
|
if ($viewer->getPHID() == $user->getPHID()) {
|
||||||
|
return $this->newDialog()
|
||||||
|
->setTitle(pht('Something Stays Your Hand'))
|
||||||
|
->appendParagraph(
|
||||||
|
pht(
|
||||||
|
'Try as you might, you find you can not disable your own account.'))
|
||||||
|
->addCancelButton($done_uri, pht('Curses!'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->isFormPost()) {
|
||||||
|
// Disable the account.
|
||||||
|
if (!$user->getIsDisabled()) {
|
||||||
|
$xactions = array();
|
||||||
|
$xactions[] = id(new PhabricatorUserTransaction())
|
||||||
|
->setTransactionType(PhabricatorUserDisableTransaction::TRANSACTIONTYPE)
|
||||||
|
->setNewValue(true);
|
||||||
|
|
||||||
|
id(new PhabricatorUserTransactionEditor())
|
||||||
|
->setActor($actor)
|
||||||
|
->setActingAsPHID($viewer->getPHID())
|
||||||
|
->setContentSourceFromRequest($request)
|
||||||
|
->setContinueOnMissingFields(true)
|
||||||
|
->setContinueOnNoEffect(true)
|
||||||
|
->applyTransactions($user, $xactions);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set profile info to spam and blank to everything else.
|
||||||
|
{
|
||||||
|
$xactions = array();
|
||||||
|
$xactions[] = id(new PhabricatorUserTransaction())
|
||||||
|
->setTransactionType(PhabricatorUserDisableSpamTransaction::TRANSACTIONTYPE);
|
||||||
|
|
||||||
|
id(new PhabricatorUserTransactionEditor())
|
||||||
|
->setActor($actor)
|
||||||
|
->setActingAsPHID($viewer->getPHID())
|
||||||
|
->setContentSourceFromRequest($request)
|
||||||
|
->setContinueOnMissingFields(true)
|
||||||
|
->setContinueOnNoEffect(true)
|
||||||
|
->applyTransactions($user, $xactions);
|
||||||
|
}
|
||||||
|
|
||||||
|
return id(new AphrontRedirectResponse())->setURI($done_uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
$title = pht('Disable as Spam?');
|
||||||
|
$short_title = pht('Disable as Spam');
|
||||||
|
|
||||||
|
$body = pht(
|
||||||
|
'Is %s\'s profile spam?<br />All the profile info will be erased and '.
|
||||||
|
'they will no longer be able to access Phabricator.',
|
||||||
|
phutil_tag('strong', array(), $user->getUsername()));
|
||||||
|
|
||||||
|
$submit = pht('Disable as Spam');
|
||||||
|
|
||||||
|
return $this->newDialog()
|
||||||
|
->setTitle($title)
|
||||||
|
->setShortTitle($short_title)
|
||||||
|
->appendParagraph($body)
|
||||||
|
->addCancelButton($done_uri)
|
||||||
|
->addSubmitButton($submit);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
final class PhabricatorUserDisableSpamTransaction
|
||||||
|
extends PhabricatorUserTransactionType {
|
||||||
|
|
||||||
|
const TRANSACTIONTYPE = 'user.disable_spam';
|
||||||
|
|
||||||
|
public function generateOldValue($object) {
|
||||||
|
$user = $object;
|
||||||
|
return (string)$user->getRealName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function generateNewValue($object, $value) {
|
||||||
|
// Deliberately not using 'spam'.
|
||||||
|
// This way we can use this button even for accounts that
|
||||||
|
// have been already manually renamed to 'spam'.
|
||||||
|
// Otherwise when the name clash with the existing name
|
||||||
|
// none of the changes happens.
|
||||||
|
return 'disabled_spam';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyInternalEffects($object, $value) {
|
||||||
|
$user = $object;
|
||||||
|
$user->setRealName('spam');
|
||||||
|
$profile = $user->loadUserProfile();
|
||||||
|
$profile->setBlurb('');
|
||||||
|
$profile->setTitle('');
|
||||||
|
$profile->setIcon('');
|
||||||
|
|
||||||
|
$file = PhabricatorFile::loadBuiltin($user, 'profile.png');
|
||||||
|
$user->setProfileImagePHID($file->getPHID());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle() {
|
||||||
|
return pht(
|
||||||
|
'%s set this user as spam.',
|
||||||
|
$this->renderAuthor());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function shouldHideForFeed() {
|
||||||
|
// Don't publish feed stories about handling spam.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function validateTransactions($object, array $xactions) {
|
||||||
|
$errors = array();
|
||||||
|
|
||||||
|
foreach ($xactions as $xaction) {
|
||||||
|
|
||||||
|
// You must have the "Can Disable Spam Users" permission to disable a user as spam.
|
||||||
|
$this->requireApplicationCapability(
|
||||||
|
PeopleDisableSpamUsersCapability::CAPABILITY);
|
||||||
|
|
||||||
|
if ($this->getActingAsPHID() === $object->getPHID()) {
|
||||||
|
$errors[] = $this->newInvalidError(
|
||||||
|
pht('You can not disable your own account as spam.'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredCapabilities(
|
||||||
|
$object,
|
||||||
|
PhabricatorApplicationTransaction $xaction) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -295,7 +295,13 @@ EOREMARKUP
|
|||||||
'new' => $xaction->getNewValue(),
|
'new' => $xaction->getNewValue(),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case DifferentialTransaction::TYPE_ACTION:
|
||||||
|
$type = DifferentialTransaction::TYPE_ACTION;
|
||||||
|
$fields = array(
|
||||||
|
'old' => $xaction->getOldValue(),
|
||||||
|
'new' => $xaction->getNewValue(),
|
||||||
|
);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.phui-badge-mini-white {
|
.phui-badge-mini-white {
|
||||||
background-color: {$lightblueborder};
|
/* Custom Blender ID badges need mini-badges without any background.
|
||||||
|
* Because badges were not used at developer.blender.org at all,
|
||||||
|
* this seemed like an acceptible compromise for achieving good looking custom badges.
|
||||||
|
* */
|
||||||
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phui-badge-mini-green {
|
.phui-badge-mini-green {
|
||||||
@@ -217,3 +221,88 @@
|
|||||||
.phui-badge-mini-yellow {
|
.phui-badge-mini-yellow {
|
||||||
background-color: {$sh-yellowicon};
|
background-color: {$sh-yellowicon};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Badges integration with Blender ID */
|
||||||
|
.badge-devfund-bronze {
|
||||||
|
background-image: url(/rsrc/custom/image/badges/badge_devfund_bronze.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-devfund-gold {
|
||||||
|
background-image: url(/rsrc/custom/image/badges/badge_devfund_gold.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-devfund-silver {
|
||||||
|
background-image: url(/rsrc/custom/image/badges/badge_devfund_silver.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-devfund-titanium {
|
||||||
|
background-image: url(/rsrc/custom/image/badges/badge_devfund_titanium.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-devfund-platinum {
|
||||||
|
background-image: url(/rsrc/custom/image/badges/badge_devfund_platinum.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-devfund-diamond {
|
||||||
|
background-image: url(/rsrc/custom/image/badges/badge_devfund_diamond.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-cloud-subscriber {
|
||||||
|
background-image: url(/rsrc/custom/image/badges/badge_studio.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-sprite-fright {
|
||||||
|
background-image: url(/rsrc/custom/image/badges/badge_sprite_fright.png);
|
||||||
|
}
|
||||||
|
.badge-devfund-bronze,
|
||||||
|
.badge-devfund-gold,
|
||||||
|
.badge-devfund-silver,
|
||||||
|
.badge-devfund-titanium,
|
||||||
|
.badge-devfund-platinum,
|
||||||
|
.badge-devfund-diamond,
|
||||||
|
.badge-cloud-subscriber,
|
||||||
|
.badge-sprite-fright {
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-position: center;
|
||||||
|
background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
width: 2em;
|
||||||
|
height: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* When shown under avatars in comments */
|
||||||
|
.phui-timeline-badges .badge-devfund-bronze,
|
||||||
|
.phui-timeline-badges .badge-devfund-gold,
|
||||||
|
.phui-timeline-badges .badge-devfund-silver,
|
||||||
|
.phui-timeline-badges .badge-devfund-titanium,
|
||||||
|
.phui-timeline-badges .badge-devfund-platinum,
|
||||||
|
.phui-timeline-badges .badge-devfund-diamond,
|
||||||
|
.phui-timeline-badges .badge-cloud-subscriber,
|
||||||
|
.phui-timeline-badges .badge-sprite-fright {
|
||||||
|
display: block;
|
||||||
|
margin-top: 4px !important;
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* When shown in "Award Badge" popup */
|
||||||
|
.jx-tokenizer-token .badge-devfund-bronze,
|
||||||
|
.jx-tokenizer-token .badge-devfund-gold,
|
||||||
|
.jx-tokenizer-token .badge-devfund-silver,
|
||||||
|
.jx-tokenizer-token .badge-devfund-titanium,
|
||||||
|
.jx-tokenizer-token .badge-devfund-platinum,
|
||||||
|
.jx-tokenizer-token .badge-devfund-diamond,
|
||||||
|
.jx-tokenizer-token .badge-cloud-subscriber,
|
||||||
|
.jx-tokenizer-token .badge-sprite-fright,
|
||||||
|
.jx-result .badge-devfund-bronze,
|
||||||
|
.jx-result .badge-devfund-gold,
|
||||||
|
.jx-result .badge-devfund-silver,
|
||||||
|
.jx-result .badge-devfund-titanium,
|
||||||
|
.jx-result .badge-devfund-platinum,
|
||||||
|
.jx-result .badge-devfund-diamond,
|
||||||
|
.jx-result .badge-cloud-subscriber,
|
||||||
|
.jx-result .badge-sprite-fright {
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
margin-bottom: -2px;
|
||||||
|
}
|
||||||
|
|||||||
BIN
webroot/rsrc/custom/image/badges/badge_devfund_bronze.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
webroot/rsrc/custom/image/badges/badge_devfund_diamond.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
webroot/rsrc/custom/image/badges/badge_devfund_gold.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
webroot/rsrc/custom/image/badges/badge_devfund_platinum.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
webroot/rsrc/custom/image/badges/badge_devfund_silver.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
webroot/rsrc/custom/image/badges/badge_devfund_titanium.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
webroot/rsrc/custom/image/badges/badge_sprite_fright.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
webroot/rsrc/custom/image/badges/badge_studio.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |