mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 23:01:04 +01:00
Make the new "Unverified Email" behavior more clear to other users
Summary: Ref T12268. Ref T12157. When you mention or interact with a user who is unlikely to be able to respond (for example, because their account is disabled), we try to show a colored dot to provide a hint about this. Recently, we no longer send any normal mail to unverified addresses. However, the rules for showing a dot haven't been updated yet, so they only care about this if `auth.require-verification` is set. This can be misleading, because if you say `Hey @alice, what do you think about this?` and she hasn't verified her email, you may not get a response. Update the rule so users with unverified email addresses get a grey dot in all cases. The hint is basically "you shouldn't expect a response from this user". Make the meaning of this hint more clear on the hovercard and profile. Also: - Allow the non-ajax version of the hovercard page (which is basically only useful for testing hovercards) accept `?names=...` so you can just plug usernames, hashtags, etc., in there. - Fix a bug where the user's join date was based on their profile creation date instead of account creation date on the hovercard. Users may not have a profile creation date (if they never changed any account details), and it may be different from their account creation date. Test Plan: {F2998517} Reviewers: chad Reviewed By: chad Maniphest Tasks: T12268, T12157 Differential Revision: https://secure.phabricator.com/D17374
This commit is contained in:
parent
7448cb0c3a
commit
81a9726fa1
6 changed files with 81 additions and 10 deletions
|
@ -103,6 +103,8 @@ abstract class PhabricatorPeopleProfileController
|
|||
|
||||
if ($user->getIsDisabled()) {
|
||||
$header->setStatus('fa-ban', 'red', pht('Disabled'));
|
||||
} else if (!$user->getIsEmailVerified()) {
|
||||
$header->setStatus('fa-envelope', 'red', pht('Email Not Verified'));
|
||||
} else {
|
||||
$header->setStatus($profile_icon, 'bluegrey', $profile_title);
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ final class PhabricatorMentionRemarkupRule extends PhutilRemarkupRule {
|
|||
$tag->addClass('phabricator-remarkup-mention-nopermission');
|
||||
}
|
||||
|
||||
if (!$user->isUserActivated()) {
|
||||
if (!$user->isResponsive()) {
|
||||
$tag->setDotColor(PHUITagView::COLOR_GREY);
|
||||
} else {
|
||||
if ($user->getAwayUntil()) {
|
||||
|
|
|
@ -61,7 +61,7 @@ final class PhabricatorPeopleUserPHIDType extends PhabricatorPHIDType {
|
|||
}
|
||||
|
||||
$availability = null;
|
||||
if (!$user->isUserActivated()) {
|
||||
if (!$user->isResponsive()) {
|
||||
$availability = PhabricatorObjectHandle::AVAILABILITY_DISABLED;
|
||||
} else {
|
||||
$until = $user->getAwayUntil();
|
||||
|
|
|
@ -120,6 +120,32 @@ final class PhabricatorUser
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is this a user who we can reasonably expect to respond to requests?
|
||||
*
|
||||
* This is used to provide a grey "disabled/unresponsive" dot cue when
|
||||
* rendering handles and tags, so it isn't a surprise if you get ignored
|
||||
* when you ask things of users who will not receive notifications or could
|
||||
* not respond to them (because they are disabled, unapproved, do not have
|
||||
* verified email addresses, etc).
|
||||
*
|
||||
* @return bool True if this user can receive and respond to requests from
|
||||
* other humans.
|
||||
*/
|
||||
public function isResponsive() {
|
||||
if (!$this->isUserActivated()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$this->getIsEmailVerified()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public function canEstablishWebSessions() {
|
||||
if ($this->getIsMailingList()) {
|
||||
return false;
|
||||
|
|
|
@ -52,17 +52,44 @@ final class PhabricatorUserCardView extends AphrontTagView {
|
|||
|
||||
require_celerity_resource('project-card-view-css');
|
||||
|
||||
$profile_icon = PhabricatorPeopleIconSet::getIconIcon($profile->getIcon());
|
||||
$profile_title = $profile->getDisplayTitle();
|
||||
// We don't have a ton of room on the hovercard, so we're trying to show
|
||||
// the most important tag. Users can click through to the profile to get
|
||||
// more details.
|
||||
|
||||
if ($user->getIsDisabled()) {
|
||||
$tag_icon = 'fa-ban';
|
||||
$tag_title = pht('Disabled');
|
||||
$tag_shade = PHUITagView::COLOR_RED;
|
||||
} else if (!$user->getIsApproved()) {
|
||||
$tag_icon = 'fa-ban';
|
||||
$tag_title = pht('Unapproved Account');
|
||||
$tag_shade = PHUITagView::COLOR_RED;
|
||||
} else if (!$user->getIsEmailVerified()) {
|
||||
$tag_icon = 'fa-envelope';
|
||||
$tag_title = pht('Email Not Verified');
|
||||
$tag_shade = PHUITagView::COLOR_RED;
|
||||
} else if ($user->getIsAdmin()) {
|
||||
$tag_icon = 'fa-star';
|
||||
$tag_title = pht('Administrator');
|
||||
$tag_shade = PHUITagView::COLOR_INDIGO;
|
||||
} else {
|
||||
$tag_icon = PhabricatorPeopleIconSet::getIconIcon($profile->getIcon());
|
||||
$tag_title = $profile->getDisplayTitle();
|
||||
$tag_shade = null;
|
||||
}
|
||||
|
||||
$tag = id(new PHUITagView())
|
||||
->setIcon($profile_icon)
|
||||
->setName($profile_title)
|
||||
->addClass('project-view-header-tag')
|
||||
->setIcon($tag_icon)
|
||||
->setName($tag_title)
|
||||
->setType(PHUITagView::TYPE_SHADE);
|
||||
|
||||
if ($tag_shade !== null) {
|
||||
$tag->setShade($tag_shade);
|
||||
}
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(array($user->getFullName(), $tag))
|
||||
->setHeader($user->getFullName())
|
||||
->addTag($tag)
|
||||
->setUser($viewer)
|
||||
->setImage($picture);
|
||||
|
||||
|
@ -70,7 +97,7 @@ final class PhabricatorUserCardView extends AphrontTagView {
|
|||
|
||||
$body[] = $this->addItem(
|
||||
pht('User Since'),
|
||||
phabricator_date($profile->getDateCreated(), $viewer));
|
||||
phabricator_date($user->getDateCreated(), $viewer));
|
||||
|
||||
if (PhabricatorApplication::isClassInstalledForViewer(
|
||||
'PhabricatorCalendarApplication',
|
||||
|
|
|
@ -9,7 +9,23 @@ final class PhabricatorSearchHovercardController
|
|||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $this->getViewer();
|
||||
$phids = $request->getArr('phids');
|
||||
$phids = $request->getStrList('phids');
|
||||
|
||||
// If object names are provided, look them up and pretend they were
|
||||
// passed as additional PHIDs. This is primarily useful for debugging,
|
||||
// since you don't have to go look up user PHIDs to preview their
|
||||
// hovercards.
|
||||
$names = $request->getStrList('names');
|
||||
if ($names) {
|
||||
$named_objects = id(new PhabricatorObjectQuery())
|
||||
->setViewer($viewer)
|
||||
->withNames($names)
|
||||
->execute();
|
||||
|
||||
foreach ($named_objects as $object) {
|
||||
$phids[] = $object->getPHID();
|
||||
}
|
||||
}
|
||||
|
||||
$handles = id(new PhabricatorHandleQuery())
|
||||
->setViewer($viewer)
|
||||
|
|
Loading…
Reference in a new issue