15use Wikimedia\AtEase\AtEase;
27 parent::__construct(
'Lockdb',
'siteadmin' );
41 parent::checkExecutePermissions( $user );
42 # If the lock file isn't writable, we can do sweet bugger all 57'label-message' =>
'enterlockreason',
61'label-message' =>
'lockconfirm',
68 ->setHeaderHtml( $this->
msg(
'lockdbtext' )->parseAsBlock() )
69 ->setSubmitTextMsg(
'lockbtn' );
74if ( !$data[
'Confirm'] ) {
75return Status::newFatal(
'locknoconfirm' );
78 AtEase::suppressWarnings();
80 AtEase::restoreWarnings();
83 # This used to show a file not found error, but the likeliest reason for fopen() 84 # to fail at this point is insufficient permission to write to the file...good old 85 # is_writable() is plain wrong in some cases, it seems... 86return Status::newFatal(
'lockfilenotwritable' );
88 fwrite( $fp, $data[
'Reason'] );
91 fwrite( $fp,
"\n<p>" . $this->
msg(
'lockedbyandtime',
93 $contLang->date( $timestamp,
false,
false ),
94 $contLang->time( $timestamp,
false,
false )
95 )->inContentLanguage()->text() .
"</p>\n" );
98return Status::newGood();
103 $out->addSubtitle( $this->
msg(
'lockdbsuccesssub' ) );
104 $out->addWikiMsg(
'lockdbsuccesstext' );
119class_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.
Object handling generic submission, CSRF protection, layout and other logic for UI forms in a reusabl...
setWrapperLegend( $legend)
Prompt the whole form to be wrapped in a "<fieldset>", with this text as its "<legend>" element.
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.
A form to make the database read-only (eg for maintenance purposes).
checkExecutePermissions(User $user)
Called from execute() to check if the given user can perform this action.
getDisplayFormat()
Get display format for the form.See HTMLForm documentation for available values.1....
getFormFields()
Get an HTMLForm descriptor array.array
onSuccess()
Do something exciting on successful processing of the form, most likely to show a confirmation messag...
requiresWrite()
Whether this action requires the wiki not to be locked, default to requiresPost()bool
onSubmit(array $data)
Process the form on submission.bool|string|array|Status As documented for HTMLForm::trySubmit.
doesWrites()
Indicates whether POST requests to this special page require write access to the wiki....
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
alterForm(HTMLForm $form)
Play with the HTMLForm if you need to more substantially.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
User class for the MediaWiki software.