1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-10 23:01:04 +01:00

Hide "Availability" and "Calendar" on user profiles for disabled users

Summary:
See downstream <https://phabricator.wikimedia.org/T138723>. That suggestion is a little light on details, but I basically agree that showing "Availability: Available" on disabled user profiles is kind of questionable/misleading.

Just hide event information on disabled profiles, since this doesn't seem worth building a special "Availability: Who Knows, They Are Disabled, Good Luck" disabled state for.

Test Plan: Looked at disabled and non-disabled user profiles, saw Calendar stuff only on the former.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D20342
This commit is contained in:
epriestley 2019-03-28 16:21:24 -07:00
parent f1a7eb66da
commit 953a449305
2 changed files with 12 additions and 0 deletions

View file

@ -175,6 +175,12 @@ final class PhabricatorPeopleProfileViewController
return null;
}
// Don't show calendar information for disabled users, since it's probably
// not useful or accurate and may be misleading.
if ($user->getIsDisabled()) {
return null;
}
$midnight = PhabricatorTime::getTodayMidnightDateTime($viewer);
$week_end = clone $midnight;
$week_end = $week_end->modify('+3 days');

View file

@ -30,6 +30,12 @@ final class PhabricatorUserStatusField
$user = $this->getObject();
$viewer = $this->requireViewer();
// Don't show availability for disabled users, since this is vaguely
// misleading to say "Availability: Available" and probably not useful.
if ($user->getIsDisabled()) {
return null;
}
return id(new PHUIUserAvailabilityView())
->setViewer($viewer)
->setAvailableUser($user);