Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15402163
D8351.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8351.diff
View Options
Index: src/applications/auth/controller/PhabricatorEmailVerificationController.php
===================================================================
--- src/applications/auth/controller/PhabricatorEmailVerificationController.php
+++ src/applications/auth/controller/PhabricatorEmailVerificationController.php
@@ -36,6 +36,8 @@
$user->getPHID(),
$this->code);
+ $submit = null;
+
if (!$email) {
$title = pht('Unable to Verify Email');
$content = pht(
@@ -49,38 +51,46 @@
$content = pht(
'This email address has already been verified.');
$continue = pht('Continue to Phabricator');
- } else {
- $guard = AphrontWriteGuard::beginScopedUnguardedWrites();
- $email->openTransaction();
+ } else if ($request->isFormPost()) {
+ $email->openTransaction();
- $email->setIsVerified(1);
- $email->save();
+ $email->setIsVerified(1);
+ $email->save();
- // If the user just verified their primary email address, mark their
- // account as email verified.
- $user_primary = $user->loadPrimaryEmail();
- if ($user_primary->getID() == $email->getID()) {
- $user->setIsEmailVerified(1);
- $user->save();
- }
+ // If the user just verified their primary email address, mark their
+ // account as email verified.
+ $user_primary = $user->loadPrimaryEmail();
+ if ($user_primary->getID() == $email->getID()) {
+ $user->setIsEmailVerified(1);
+ $user->save();
+ }
- $email->saveTransaction();
- unset($guard);
+ $email->saveTransaction();
$title = pht('Address Verified');
$content = pht(
'The email address %s is now verified.',
phutil_tag('strong', array(), $email->getAddress()));
$continue = pht('Continue to Phabricator');
+ } else {
+ $title = pht('Verify Email Address');
+ $content = pht(
+ 'Verify this email address (%s) and attach it to your account?',
+ phutil_tag('strong', array(), $email->getAddress()));
+ $continue = pht('Cancel');
+ $submit = pht('Verify %s', $email->getAddress());
}
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle($title)
- ->setMethod('GET')
->addCancelButton('/', $continue)
->appendChild($content);
+ if ($submit) {
+ $dialog->addSubmitButton($submit);
+ }
+
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Verify Email'));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 8:59 PM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7388198
Default Alt Text
D8351.diff (2 KB)
Attached To
Mode
D8351: Require CSRF submission to verify email addresses
Attached
Detach File
Event Timeline
Log In to Comment