setHeaders(); if( !$wgUser->isAllowed( 'siteadmin' ) ) { $wgOut->permissionRequired( 'siteadmin' ); return; } $this->outputHeader(); $action = $wgRequest->getVal( 'action' ); if ( $action == 'success' ) { $this->showSuccess(); } else if ( $action == 'submit' && $wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { $this->doSubmit(); } else { $this->showForm(); } } private function showForm( $err = '' ) { global $wgOut, $wgUser; global $wgReadOnlyFile; if( !file_exists( $wgReadOnlyFile ) ) { $wgOut->addWikiMsg( 'databasenotlocked' ); return; } $wgOut->addWikiMsg( 'unlockdbtext' ); if ( $err != '' ) { $wgOut->setSubtitle( wfMsg( 'formerror' ) ); $wgOut->addHTML( '
' . htmlspecialchars( $err ) . "
\n" ); } $wgOut->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' ) . " |