setHeaders(); # Permission check if( !$this->userCanExecute( $this->getUser() ) ) { $this->displayRestrictionError(); return; } $this->outputHeader(); $request = $this->getRequest(); $action = $request->getVal( 'action' ); if ( $action == 'success' ) { $this->showSuccess(); } elseif ( $action == 'submit' && $request->wasPosted() && $this->getUser()->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) { $this->doSubmit(); } else { $this->showForm(); } } private function showForm( $err = '' ) { global $wgReadOnlyFile; $out = $this->getOutput(); if( !file_exists( $wgReadOnlyFile ) ) { $out->addWikiMsg( 'databasenotlocked' ); return; } $out->addWikiMsg( 'unlockdbtext' ); if ( $err != '' ) { $out->setSubtitle( wfMsg( 'formerror' ) ); $out->addHTML( '
' . htmlspecialchars( $err ) . "
\n" ); } $out->addHTML( Html::openElement( 'form', array( 'id' => 'unlockdb', 'method' => 'POST', 'action' => $this->getTitle()->getLocalURL( 'action=submit' ) ) ) . "" . Html::openElement( 'td', array( 'style' => 'text-align:left' ) ) . " " . Html::input( 'wpLock', wfMsg( 'unlockbtn' ), 'submit' ) . " |