}
public function execute( $par ) {
- global $wgUser, $wgOut, $wgRequest;
+ global $wgUser, $wgRequest;
$this->setHeaders();
- if( !$wgUser->isAllowed( 'siteadmin' ) ) {
- $wgOut->permissionRequired( 'siteadmin' );
+ # Permission check
+ if( !$this->userCanExecute( $wgUser ) ) {
+ $this->displayRestrictionError();
return;
}
if ( $action == 'success' ) {
$this->showSuccess();
- } else if ( $action == 'submit' && $wgRequest->wasPosted() &&
+ } elseif ( $action == 'submit' && $wgRequest->wasPosted() &&
$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
$this->doSubmit();
} else {
<table>
<tr>
" . Html::openElement( 'td', array( 'style' => 'text-align:right' ) ) . "
- " . Html::input( 'wpLockConfirm', null, 'checkbox' ) . "
+ " . Html::input( 'wpLockConfirm', null, 'checkbox', array( 'id' => 'mw-input-wplockconfirm' ) ) . "
</td>
" . Html::openElement( 'td', array( 'style' => 'text-align:left' ) ) .
- wfMsgHtml( 'lockconfirm' ) . "</td>
+ Html::openElement( 'label', array( 'for' => 'mw-input-wplockconfirm' ) ) .
+
+ wfMsgHtml( 'lockconfirm' ) . "</label></td>
</tr>
<tr>
<td> </td>
return;
}
fwrite( $fp, $this->reason );
- fwrite( $fp, "\n<p>(by " . $wgUser->getName() . " at " .
- $wgContLang->timeanddate( wfTimestampNow() ) . ")</p>\n" );
+ $timestamp = wfTimestampNow();
+ fwrite( $fp, "\n<p>" . wfMsgExt(
+ 'lockedbyandtime',
+ array( 'content', 'parsemag' ),
+ $wgUser->getName(),
+ $wgContLang->date( $timestamp ),
+ $wgContLang->time( $timestamp )
+ ) . "</p>\n" );
fclose( $fp );
$wgOut->redirect( $this->getTitle()->getFullURL( 'action=success' ) );