1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-17 23:05:20 +01:00

Hide the blurb of a user when that user is disabled

Summary: T15074

Test Plan: Disabled a user, then made sure their blurb disappeared.

Reviewers: O1 Blessed Committers, avivey, speck

Reviewed By: O1 Blessed Committers, avivey, speck

Subscribers: 20after4, avivey, speck, tobiaswiese, valerio.bozzolan

Maniphest Tasks: T15074

Differential Revision: https://we.phorge.it/D25035
This commit is contained in:
Matthew Bowker 2022-03-30 09:16:52 -06:00 committed by Matthew Bowker
parent b293e6ffed
commit 7d4357683a

View file

@ -320,12 +320,28 @@ final class PhabricatorUser
const EMAIL_CYCLE_FREQUENCY = 86400; const EMAIL_CYCLE_FREQUENCY = 86400;
const EMAIL_TOKEN_LENGTH = 24; const EMAIL_TOKEN_LENGTH = 24;
/**
* This function removes the blurb from a profile.
* This is an incredibly broad hammer to handle some spam on the upstream,
* which will be refined later.
*
* @return void
*/
private function cleanUpProfile() {
$this->profile->setBlurb('');
}
public function getUserProfile() { public function getUserProfile() {
return $this->assertAttached($this->profile); return $this->assertAttached($this->profile);
} }
public function attachUserProfile(PhabricatorUserProfile $profile) { public function attachUserProfile(PhabricatorUserProfile $profile) {
$this->profile = $profile; $this->profile = $profile;
if ($this->isDisabled) {
$this->cleanUpProfile();
}
return $this; return $this;
} }
@ -342,6 +358,10 @@ final class PhabricatorUser
$this->profile = PhabricatorUserProfile::initializeNewProfile($this); $this->profile = PhabricatorUserProfile::initializeNewProfile($this);
} }
if ($this->isDisabled) {
$this->cleanUpProfile();
}
return $this->profile; return $this->profile;
} }