the presence of large numbers of blocks; added indexes and implemented an
indexed pager.
* (bug 6448) Allow filtering of Special:Newpages according to username
+* (bug 6618) Improve permissions/error detection in Special:Lockdb
== Languages updated ==
$wgOut->permissionRequired( 'siteadmin' );
return;
}
+
+ # If the lock file isn't writable, we can do sweet bugger all
+ global $wgReadOnlyFile;
+ if( !is_writable( dirname( $wgReadOnlyFile ) ) ) {
+ DBLockForm::notWritable();
+ return;
+ }
$action = $wgRequest->getVal( 'action' );
$f = new DBLockForm();
$this->showForm( wfMsg( 'locknoconfirm' ) );
return;
}
- $fp = fopen( $wgReadOnlyFile, 'w' );
+ $fp = @fopen( $wgReadOnlyFile, 'w' );
if ( false === $fp ) {
- $wgOut->showFileNotFoundError( $wgReadOnlyFile );
+ # This used to show a file not found error, but the likeliest reason for fopen()
+ # to fail at this point is insufficient permission to write to the file...good old
+ # is_writable() is plain wrong in some cases, it seems...
+ $this->notWritable();
return;
}
fwrite( $fp, $this->reason );
$wgOut->setSubtitle( wfMsg( 'lockdbsuccesssub' ) );
$wgOut->addWikiText( wfMsg( 'lockdbsuccesstext' ) );
}
+
+ function notWritable() {
+ global $wgOut;
+ $wgOut->errorPage( 'lockdb', 'lockfilenotwritable' );
+ }
+
}
?>
'lockdbsuccesstext' => 'The database has been locked.
<br />Remember to remove the lock after your maintenance is complete.',
'unlockdbsuccesstext' => 'The database has been unlocked.',
+'lockfilenotwritable' => 'The database lock file is not writable. To lock or unlock the database, this needs to be writable by the web server.',
# Make sysop
'makesysoptitle' => 'Make a user into a sysop',