29use Wikimedia\AtEase\AtEase;
41 parent::__construct(
'Lockdb',
'siteadmin' );
53 parent::checkExecutePermissions( $user );
54 # If the lock file isn't writable, we can do sweet bugger all
68 'label-message' =>
'enterlockreason',
72 'label-message' =>
'lockconfirm',
79 ->setHeaderHtml( $this->
msg(
'lockdbtext' )->parseAsBlock() )
80 ->setSubmitTextMsg(
'lockbtn' );
84 if ( !$data[
'Confirm'] ) {
85 return Status::newFatal(
'locknoconfirm' );
88 AtEase::suppressWarnings();
90 AtEase::restoreWarnings();
92 if ( $fp ===
false ) {
93 # This used to show a file not found error, but the likeliest reason for fopen()
94 # to fail at this point is insufficient permission to write to the file...good old
95 # is_writable() is plain wrong in some cases, it seems...
96 return Status::newFatal(
'lockfilenotwritable' );
98 fwrite( $fp, $data[
'Reason'] );
101 fwrite( $fp,
"\n<p>" . $this->
msg(
'lockedbyandtime',
103 $contLang->date( $timestamp,
false,
false ),
104 $contLang->time( $timestamp,
false,
false )
105 )->inContentLanguage()->text() .
"</p>\n" );
108 return Status::newGood();
113 $out->addSubtitle( $this->
msg(
'lockdbsuccesssub' ) );
114 $out->addWikiMsg(
'lockdbsuccesstext' );
127class_alias( SpecialLockdb::class,
'SpecialLockdb' );
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
An error page which can definitely be safely rendered using the OutputPage.
A class containing constants representing the names of configuration variables.
const ReadOnlyFile
Name constant for the ReadOnlyFile setting, for use with Config::get()
Special page which uses an HTMLForm to handle processing.
getUser()
Shortcut to get the User executing this instance.
getConfig()
Shortcut to get main config object.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
getContentLanguage()
Shortcut to get content language.
getName()
Get the canonical, unlocalized name of this special page without namespace.