return false;
}
- public function userCanExecute( User $user ) {
- parent::userCanExecute( $user );
-
+ public function checkExecutePermissions( User $user ) {
+ parent::checkExecutePermissions( $user );
# If the lock file isn't writable, we can do sweet bugger all
- global $wgReadOnlyFile;
- if ( !file_exists( $wgReadOnlyFile ) ) {
+ if ( !file_exists( $this->getConfig()->get( 'ReadOnlyFile' ) ) ) {
throw new ErrorPageError( 'lockdb', 'databasenotlocked' );
}
}
}
public function onSubmit( array $data ) {
- global $wgReadOnlyFile;
-
if ( !$data['Confirm'] ) {
return Status::newFatal( 'locknoconfirm' );
}
+ $readOnlyFile = $this->getConfig()->get( 'ReadOnlyFile' );
wfSuppressWarnings();
- $res = unlink( $wgReadOnlyFile );
+ $res = unlink( $readOnlyFile );
wfRestoreWarnings();
if ( $res ) {
return Status::newGood();
} else {
- return Status::newFatal( 'filedeleteerror', $wgReadOnlyFile );
+ return Status::newFatal( 'filedeleteerror', $readOnlyFile );
}
}
public function onSuccess() {
$out = $this->getOutput();
- $out->setSubtitle( wfMsg( 'unlockdbsuccesssub' ) );
+ $out->addSubtitle( $this->msg( 'unlockdbsuccesssub' ) );
$out->addWikiMsg( 'unlockdbsuccesstext' );
}
+
+ protected function getGroupName() {
+ return 'wiki';
+ }
}