Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/PhabricatorAuthUnlinkController.php
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | private function renderNotUnlinkableErrorDialog( | ||||
PhabricatorAuthProvider $provider, | PhabricatorAuthProvider $provider, | ||||
$done_uri) { | $done_uri) { | ||||
return $this->newDialog() | return $this->newDialog() | ||||
->setTitle(pht('Permanent Account Link')) | ->setTitle(pht('Permanent Account Link')) | ||||
->appendChild( | ->appendChild( | ||||
pht( | pht( | ||||
'You can not unlink this account because the administrator has '. | 'You can not unlink this account because the administrator has '. | ||||
'configured Phabricator to make links to "%s" accounts permanent.', | 'configured %s to make links to "%s" accounts permanent.', | ||||
PhabricatorPlatformSite::getName(), | |||||
$provider->getProviderName())) | $provider->getProviderName())) | ||||
->addCancelButton($done_uri); | ->addCancelButton($done_uri); | ||||
} | } | ||||
private function renderOnlyUsableAccountConfirmDialog( | private function renderOnlyUsableAccountConfirmDialog( | ||||
array $confirmations, | array $confirmations, | ||||
$done_uri) { | $done_uri) { | ||||
$confirmations[] = 'only'; | $confirmations[] = 'only'; | ||||
return $this->newDialog() | return $this->newDialog() | ||||
->setTitle(pht('Unlink Your Only Login Account?')) | ->setTitle(pht('Unlink Your Only Login Account?')) | ||||
->addHiddenInput('confirmations', implode(',', $confirmations)) | ->addHiddenInput('confirmations', implode(',', $confirmations)) | ||||
->appendParagraph( | ->appendParagraph( | ||||
pht( | pht( | ||||
'This is the only external login account linked to your Phabicator '. | 'This is the only external login account linked to your %s '. | ||||
'account. If you remove it, you may no longer be able to log in.')) | 'account. If you remove it, you may no longer be able to log in.', | ||||
PhabricatorPlatformSite::getName())) | |||||
->appendParagraph( | ->appendParagraph( | ||||
pht( | pht( | ||||
'If you lose access to your account, you can recover access by '. | 'If you lose access to your account, you can recover access by '. | ||||
'sending yourself an email login link from the login screen.')) | 'sending yourself an email login link from the login screen.')) | ||||
->addCancelButton($done_uri) | ->addCancelButton($done_uri) | ||||
->addSubmitButton(pht('Unlink External Account')); | ->addSubmitButton(pht('Unlink External Account')); | ||||
} | } | ||||
private function renderConfirmDialog( | private function renderConfirmDialog( | ||||
array $confirmations, | array $confirmations, | ||||
PhabricatorAuthProviderConfig $config, | PhabricatorAuthProviderConfig $config, | ||||
$done_uri) { | $done_uri) { | ||||
$confirmations[] = 'unlink'; | $confirmations[] = 'unlink'; | ||||
$provider = $config->getProvider(); | $provider = $config->getProvider(); | ||||
$title = pht('Unlink "%s" Account?', $provider->getProviderName()); | $title = pht('Unlink "%s" Account?', $provider->getProviderName()); | ||||
$body = pht( | $body = pht( | ||||
'You will no longer be able to use your %s account to '. | 'You will no longer be able to use your %s account to '. | ||||
'log in to Phabricator.', | 'log in to %s.', | ||||
$provider->getProviderName()); | $provider->getProviderName(), | ||||
PhabricatorPlatformSite::getName()); | |||||
return $this->newDialog() | return $this->newDialog() | ||||
->setTitle($title) | ->setTitle($title) | ||||
->addHiddenInput('confirmations', implode(',', $confirmations)) | ->addHiddenInput('confirmations', implode(',', $confirmations)) | ||||
->appendParagraph($body) | ->appendParagraph($body) | ||||
->appendParagraph( | ->appendParagraph( | ||||
pht( | pht( | ||||
'Note: Unlinking an authentication provider will terminate any '. | 'Note: Unlinking an authentication provider will terminate any '. | ||||
'other active login sessions.')) | 'other active login sessions.')) | ||||
->addSubmitButton(pht('Unlink Account')) | ->addSubmitButton(pht('Unlink Account')) | ||||
->addCancelButton($done_uri); | ->addCancelButton($done_uri); | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0