} else if ( strlen($this->mTitle->mRestrictionsExpiry) == 0 ) {
$this->mExpiry = '';
} else {
- $this->mExpiry = $wgLang->timeanddate( $this->mTitle->mRestrictionsExpiry );
+ $this->mExpiry = wfTimestamp( TS_RFC2822, $this->mTitle->mRestrictionsExpiry );
}
}
$this->mRestrictions[$action] = $val;
}
}
-
+ }
+ }
+
+ function execute() {
+ global $wgRequest;
+ if( $wgRequest->wasPosted() ) {
if( $this->save() ) {
global $wgOut;
$wgOut->redirect( $this->mTitle->getFullUrl() );
- return;
}
+ } else {
+ $this->show();
}
}
function save() {
global $wgRequest, $wgUser, $wgOut;
- if( !$wgRequest->wasPosted() ) {
- return false;
- }
-
+
if( $this->disabled ) {
+ $this->show();
return false;
}
$token = $wgRequest->getVal( 'wpEditToken' );
if( !$wgUser->matchEditToken( $token ) ) {
- throw new FatalError( wfMsg( 'sessionfailure' ) );
+ $this->show( wfMsg( 'sessionfailure' ) );
+ return false;
}
if ( strlen( $this->mExpiry ) == 0 ) {
if ( $expiry < 0 || $expiry === false ) {
$this->show( wfMsg( 'protect_expiry_invalid' ) );
- return;
+ return false;
}
$expiry = wfTimestamp( TS_MW, $expiry );