* @ingroup SpecialPage
*/
class SpecialLockdb extends FormSpecialPage {
- var $reason = '';
+ protected $reason = '';
public function __construct() {
parent::__construct( 'Lockdb', 'siteadmin' );
return false;
}
- public function userCanExecute( User $user ) {
- parent::userCanExecute( $user );
+ public function checkExecutePermissions( User $user ) {
+ global $wgReadOnlyFile;
+ parent::checkExecutePermissions( $user );
# If the lock file isn't writable, we can do sweet bugger all
- global $wgReadOnlyFile;
if ( !is_writable( dirname( $wgReadOnlyFile ) ) ) {
throw new ErrorPageError( 'lockdb', 'lockfilenotwritable' );
}
}
fwrite( $fp, $data['Reason'] );
$timestamp = wfTimestampNow();
- fwrite( $fp, "\n<p>" . wfMsgExt(
- 'lockedbyandtime',
- array( 'content', 'parsemag' ),
+ fwrite( $fp, "\n<p>" . $this->msg( 'lockedbyandtime',
$this->getUser()->getName(),
- $wgContLang->date( $timestamp ),
- $wgContLang->time( $timestamp )
- ) . "</p>\n" );
+ $wgContLang->date( $timestamp, false, false ),
+ $wgContLang->time( $timestamp, false, false )
+ )->inContentLanguage()->text() . "</p>\n" );
fclose( $fp );
return Status::newGood();
public function onSuccess() {
$out = $this->getOutput();
- $out->setSubtitle( wfMsg( 'lockdbsuccesssub' ) );
+ $out->addSubtitle( $this->msg( 'lockdbsuccesssub' ) );
$out->addWikiMsg( 'lockdbsuccesstext' );
}
+
+ protected function getGroupName() {
+ return 'wiki';
+ }
}