X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUnlinkAccounts.php;h=72afb03c9bc4ce16e47a7cc58c43ae17f5c59855;hb=3bb3c8b0ae092b2e667f6f33abfc98f9c205d53c;hp=9564d53910ef5c853aab0044f26fa7cb05fbbd59;hpb=642195be7a146de8348957afc018f912202cf22c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUnlinkAccounts.php b/includes/specials/SpecialUnlinkAccounts.php index 9564d53910..72afb03c9b 100644 --- a/includes/specials/SpecialUnlinkAccounts.php +++ b/includes/specials/SpecialUnlinkAccounts.php @@ -38,6 +38,21 @@ class SpecialUnlinkAccounts extends AuthManagerSpecialPage { public function execute( $subPage ) { $this->setHeaders(); $this->loadAuth( $subPage ); + + if ( !$this->isActionAllowed( $this->authAction ) ) { + if ( $this->authAction === AuthManager::ACTION_UNLINK ) { + // Looks like there are no linked accounts to unlink + $titleMessage = $this->msg( 'cannotunlink-no-provider-title' ); + $errorMessage = $this->msg( 'cannotunlink-no-provider' ); + throw new ErrorPageError( $titleMessage, $errorMessage ); + } else { + // user probably back-button-navigated into an auth session that no longer exists + // FIXME would be nice to show a message + $this->getOutput()->redirect( $this->getPageTitle()->getFullURL( '', false, PROTO_HTTPS ) ); + return; + } + } + $this->outputHeader(); $status = $this->trySubmit();