Do not insert page titles into querycache.qc_value
[lhc/web/wiklou.git] / includes / specials / SpecialUnlinkAccounts.php
index 9564d53..72afb03 100644 (file)
@@ -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();