Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2670771
D25845.1734055832.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
D25845.1734055832.diff
View Options
diff --git a/src/applications/diffusion/query/DiffusionResolveUserQuery.php b/src/applications/diffusion/query/DiffusionResolveUserQuery.php
--- a/src/applications/diffusion/query/DiffusionResolveUserQuery.php
+++ b/src/applications/diffusion/query/DiffusionResolveUserQuery.php
@@ -93,7 +93,8 @@
private function findUserByEmailAddress($email_address) {
- $by_email = PhabricatorUser::loadOneWithEmailAddress($email_address);
+ $by_email =
+ PhabricatorUser::loadOneWithVerifiedEmailAddress($email_address);
if ($by_email) {
return $by_email->getPHID();
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
@@ -652,6 +652,28 @@
return $this->getUsername();
}
+ /**
+ * Load one user from their verified email address.
+ * @param string $address
+ * @return PhabricatorUser|null
+ */
+ public static function loadOneWithVerifiedEmailAddress($address) {
+ $email = id(new PhabricatorUserEmail())->loadOneWhere(
+ 'address = %s AND isVerified = 1',
+ $address);
+ if (!$email) {
+ return null;
+ }
+ return id(new self())->loadOneWhere(
+ 'phid = %s',
+ $email->getUserPHID());
+ }
+
+ /**
+ * Load one user from their potentially unverified email address.
+ * @param string $address
+ * @return PhabricatorUser|null
+ */
public static function loadOneWithEmailAddress($address) {
$email = id(new PhabricatorUserEmail())->loadOneWhere(
'address = %s',
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php
@@ -281,7 +281,7 @@
$user->getMonogram()));
$emails = id(new PhabricatorUserEmail())->loadAllWhere(
- 'userPHID = %s',
+ 'userPHID = %s AND isVerified = 1',
$user->getPHID());
if ($emails) {
$this->rebuildEmails(mpull($emails, 'getAddress'));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 13, 02:10 (15 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1008081
Default Alt Text
D25845.1734055832.diff (2 KB)
Attached To
Mode
D25845: Repository Identity "Automatically Detected User": don't trust unverified emails
Attached
Detach File
Event Timeline
Log In to Comment