Go to the documentation of this file.
44 parent::__construct(
'Userrights' );
64 if ( $targetUser->getId() == 0 ) {
68 return !empty( $available[
'add'] )
69 || !empty( $available[
'remove'] )
70 || ( (
$isself || !$checkIfSelf ) &&
71 ( !empty( $available[
'add-self'] )
72 || !empty( $available[
'remove-self'] ) ) );
88 $out->addModules( [
'mediawiki.special.userrights' ] );
90 if ( $par !==
null ) {
91 $this->mTarget = $par;
93 $this->mTarget =
$request->getVal(
'user' );
96 if ( is_string( $this->mTarget ) ) {
97 $this->mTarget = trim( $this->mTarget );
101 $this->isself =
true;
104 $fetchedStatus = $this->
fetchUser( $this->mTarget,
true );
105 if ( $fetchedStatus->isOK() ) {
106 $this->mFetchedUser = $fetchedStatus->value;
107 if ( $this->mFetchedUser instanceof
User ) {
110 $this->
getSkin()->setRelevantUser( $this->mFetchedUser );
116 $session->get(
'specialUserrightsSaveSuccess' ) &&
117 $this->mFetchedUser !== null
120 $session->remove(
'specialUserrightsSaveSuccess' );
122 $out->addModuleStyles(
'mediawiki.notification.convertmessagebox.styles' );
127 'class' =>
'mw-notify-success successbox',
128 'id' =>
'mw-preferences-success',
129 'data-mw-autohide' =>
'false',
134 $this->
msg(
'savedrights', $this->mFetchedUser->getName() )->
text()
143 $out->addModuleStyles(
'mediawiki.special' );
144 $this->
addHelpLink(
'Help:Assigning permissions' );
150 $request->getCheck(
'saveusergroups' ) &&
151 $this->mTarget !==
null &&
159 if (
$user->isBlocked() && !
$user->isAllowed(
'userrights' ) ) {
166 if ( !$fetchedStatus->isOK() ) {
167 $this->
getOutput()->addWikiText( $fetchedStatus->getWikiText() );
173 if ( $targetUser instanceof
User ) {
174 $targetUser->clearInstanceCache();
177 if (
$request->getVal(
'conflictcheck-originalgroups' )
178 !== implode(
',', $targetUser->getGroups() )
180 $out->addWikiMsg(
'userrights-conflict' );
190 $session->set(
'specialUserrightsSaveSuccess', 1 );
196 $out->addWikiText(
'<div class="error">' .
$status->getWikiText() .
'</div>' );
202 if ( $this->mTarget !==
null ) {
208 return $this->
getPageTitle( $this->mTarget )->getFullURL();
235 $unix = strtotime( $expiry );
237 if ( !$unix || $unix === -1 ) {
260 $existingUGMs =
$user->getGroupMemberships();
264 foreach ( $allgroups
as $group ) {
267 if ( $this->
getRequest()->getCheck(
"wpGroup-$group" ) ) {
268 $addgroup[] = $group;
272 $expiryDropdown = $this->
getRequest()->getVal(
"wpExpiry-$group" );
273 if ( $expiryDropdown ===
'existing' ) {
277 if ( $expiryDropdown ===
'other' ) {
278 $expiryValue = $this->
getRequest()->getVal(
"wpExpiry-$group-other" );
280 $expiryValue = $expiryDropdown;
286 if ( $groupExpiries[$group] ===
false ) {
291 if ( $groupExpiries[$group] && $groupExpiries[$group] <
wfTimestampNow() ) {
298 isset( $existingUGMs[$group] ) &&
299 ( $existingUGMs[$group]->getExpiry() ?:
'infinity' ) >
300 ( $groupExpiries[$group] ?:
'infinity' )
306 $removegroup[] = $group;
329 $groupExpiries = [] ) {
333 $groups =
$user->getGroups();
334 $ugms =
$user->getGroupMemberships();
336 $addable = array_merge( $changeable[
'add'],
$isself ? $changeable[
'add-self'] : [] );
337 $removable = array_merge( $changeable[
'remove'],
$isself ? $changeable[
'remove-self'] : [] );
339 $remove = array_unique(
340 array_intersect( (
array)$remove, $removable, $groups ) );
341 $add = array_intersect( (
array)$add, $addable );
346 $add = array_filter( $add,
347 function( $group )
use ( $groups, $groupExpiries, $removable, $ugms ) {
348 if ( isset( $groupExpiries[$group] ) &&
349 !in_array( $group, $removable ) &&
350 isset( $ugms[$group] ) &&
351 ( $ugms[$group]->getExpiry() ?:
'infinity' ) >
352 ( $groupExpiries[$group] ?:
'infinity' )
356 return !in_array( $group, $groups ) || array_key_exists( $group, $groupExpiries );
361 $oldGroups = $groups;
362 $oldUGMs =
$user->getGroupMemberships();
363 $newGroups = $oldGroups;
367 foreach ( $remove
as $index => $group ) {
368 if ( !
$user->removeGroup( $group ) ) {
369 unset( $remove[$index] );
372 $newGroups = array_diff( $newGroups, $remove );
375 foreach ( $add
as $index => $group ) {
376 $expiry = isset( $groupExpiries[$group] ) ? $groupExpiries[$group] :
null;
377 if ( !
$user->addGroup( $group, $expiry ) ) {
378 unset( $add[$index] );
381 $newGroups = array_merge( $newGroups, $add );
383 $newGroups = array_unique( $newGroups );
384 $newUGMs =
$user->getGroupMemberships();
387 $user->invalidateCache();
391 $reason, $oldUGMs, $newUGMs ] );
393 'updateExternalDBGroups', [
$user, $add, $remove ]
396 wfDebug(
'oldGroups: ' . print_r( $oldGroups,
true ) .
"\n" );
397 wfDebug(
'newGroups: ' . print_r( $newGroups,
true ) .
"\n" );
398 wfDebug(
'oldUGMs: ' . print_r( $oldUGMs,
true ) .
"\n" );
399 wfDebug(
'newUGMs: ' . print_r( $newUGMs,
true ) .
"\n" );
404 if ( $newGroups != $oldGroups || $newUGMs != $oldUGMs ) {
405 $this->
addLogEntry(
$user, $oldGroups, $newGroups, $reason, $tags, $oldUGMs, $newUGMs );
408 return [ $add, $remove ];
422 return [
'expiry' => $ugm->getExpiry() ];
436 $oldUGMs, $newUGMs ) {
440 $oldUGMs = array_map(
function( $group )
use ( $oldUGMs ) {
441 return isset( $oldUGMs[$group] ) ?
445 $newUGMs = array_map(
function( $group )
use ( $newUGMs ) {
446 return isset( $newUGMs[$group] ) ?
452 $logEntry->setPerformer( $this->
getUser() );
453 $logEntry->setTarget(
$user->getUserPage() );
454 $logEntry->setComment( $reason );
455 $logEntry->setParameters( [
456 '4::oldgroups' => $oldGroups,
457 '5::newgroups' => $newGroups,
458 'oldmetadata' => $oldUGMs,
459 'newmetadata' => $newUGMs,
461 $logid = $logEntry->insert();
462 if (
count( $tags ) ) {
463 $logEntry->setTags( $tags );
465 $logEntry->publish( $logid );
482 $groups =
$user->getGroups();
483 $groupMemberships =
$user->getGroupMemberships();
501 $parts = explode( $this->
getConfig()->
get(
'UserrightsInterwikiDelimiter' ),
$username );
502 if (
count( $parts ) < 2 ) {
506 list(
$name, $database ) = array_map(
'trim', $parts );
511 if ( $writing && !$this->
getUser()->isAllowed(
'userrights-interwiki' ) ) {
520 if (
$name ===
'' ) {
524 if (
$name[0] ==
'#' ) {
527 $id = intval( substr(
$name, 1 ) );
529 if ( $database ==
'' ) {
540 if (
$name ===
false ) {
546 if ( $database ==
'' ) {
567 if ( empty( $ids ) ) {
568 return $this->
msg(
'rightsnone' )->inContentLanguage()->text();
570 return implode(
', ', $ids );
578 $this->
getOutput()->addModules(
'mediawiki.userSuggest' );
587 'id' =>
'mw-userrights-form1'
593 $this->
msg(
'userrights-user-editname' )->
text(),
597 str_replace(
'_',
' ', $this->mTarget ),
599 'class' =>
'mw-autocomplete-user',
602 $this->mFetchedUser ===
null ? [
'autofocus' =>
'' ] : []
606 $this->
msg(
'editusergroup' )->
text()
623 $list = $membersList = $tempList = $tempMembersList = [];
624 foreach ( $groupMemberships
as $ugm ) {
628 if ( $ugm->getExpiry() ) {
629 $tempList[] = $linkG;
630 $tempMembersList[] = $linkM;
633 $membersList[] = $linkM;
639 $autoMembersList = [];
644 'html',
$user->getName() );
649 $displayedList = $this->
msg(
'userrights-groupsmember-type' )
651 $language->commaList( array_merge( $tempList, $list ) ),
652 $language->commaList( array_merge( $tempMembersList, $membersList ) )
654 $displayedAutolist = $this->
msg(
'userrights-groupsmember-type' )
656 $language->commaList( $autoList ),
657 $language->commaList( $autoMembersList )
661 $count =
count( $list );
663 $grouplist = $this->
msg(
'userrights-groupsmember' )
664 ->numParams( $count )
665 ->params(
$user->getName() )
667 $grouplist =
'<p>' . $grouplist .
' ' . $displayedList .
"</p>\n";
670 $count =
count( $autoList );
672 $autogrouplistintro = $this->
msg(
'userrights-groupsmember-auto' )
673 ->numParams( $count )
674 ->params(
$user->getName() )
676 $grouplist .=
'<p>' . $autogrouplistintro .
' ' . $displayedAutolist .
"</p>\n";
686 list( $groupCheckboxes, $canChangeAny ) =
694 'name' =>
'editGroup',
695 'id' =>
'mw-userrights-form2'
701 'conflictcheck-originalgroups',
702 implode(
',',
$user->getGroups() )
709 $canChangeAny ?
'userrights-editusergroup' :
'userrights-viewusergroup',
714 $canChangeAny ?
'editinguser' :
'viewinguserrights'
716 ->rawParams( $userToolLinks )->parse()
718 if ( $canChangeAny ) {
720 $this->
msg(
'userrights-groups-help',
$user->getName() )->parse() .
725 <td class='mw-label'>" .
728 <td class='mw-input'>" .
730 [
'id' =>
'wpReason',
'maxlength' => 255 ] ) .
735 <td class='mw-submit'>" .
737 [
'name' =>
'saveusergroups' ] +
745 $this->
getOutput()->addHTML( $grouplist );
775 $expiryOptionsMsg = $this->
msg(
'userrights-expiry-options' )->inContentLanguage();
776 $expiryOptions = $expiryOptionsMsg->isDisabled() ?
778 explode(
',', $expiryOptionsMsg->text() );
782 $columns = [
'unchangeable' => [],
'changeable' => [] ];
784 foreach ( $allgroups
as $group ) {
785 $set = isset( $usergroups[$group] );
789 $canOnlyLengthenExpiry = ( $set && $this->
canAdd( $group ) &&
790 !$this->
canRemove( $group ) && $usergroups[$group]->getExpiry() );
792 $disabledCheckbox = !(
793 ( $set && $this->
canRemove( $group ) ) ||
794 ( !$set && $this->
canAdd( $group ) ) );
796 $disabledExpiry = $disabledCheckbox && !$canOnlyLengthenExpiry;
798 $irreversible = !$disabledCheckbox && (
799 ( $set && !$this->
canAdd( $group ) ) ||
800 ( !$set && !$this->
canRemove( $group ) ) );
804 'disabled' => $disabledCheckbox,
805 'disabled-expiry' => $disabledExpiry,
806 'irreversible' => $irreversible
809 if ( $disabledCheckbox && $disabledExpiry ) {
810 $columns[
'unchangeable'][$group] = $checkbox;
812 $columns[
'changeable'][$group] = $checkbox;
819 foreach ( $columns
as $name => $column ) {
820 if ( $column === [] ) {
831 $ret .=
"</tr>\n<tr>\n";
832 foreach ( $columns
as $column ) {
833 if ( $column === [] ) {
836 $ret .=
"\t<td style='vertical-align:top;'>\n";
837 foreach ( $column
as $group => $checkbox ) {
838 $attr = $checkbox[
'disabled'] ? [
'disabled' =>
'disabled' ] : [];
841 if ( $checkbox[
'irreversible'] ) {
842 $text = $this->
msg(
'userrights-irreversible-marker', $member )->text();
843 } elseif ( $checkbox[
'disabled'] && !$checkbox[
'disabled-expiry'] ) {
844 $text = $this->
msg(
'userrights-no-shorten-expiry-marker', $member )->text();
849 "wpGroup-" . $group, $checkbox[
'set'], $attr );
850 $ret .=
"\t\t" . ( ( $checkbox[
'disabled'] && $checkbox[
'disabled-expiry'] )
851 ?
Xml::tags(
'div', [
'class' =>
'mw-userrights-disabled' ], $checkboxHtml )
859 $currentExpiry = isset( $usergroups[$group] ) ?
860 $usergroups[$group]->getExpiry() :
865 if ( $checkbox[
'set'] &&
866 ( $checkbox[
'irreversible'] || $checkbox[
'disabled-expiry'] )
868 if ( $currentExpiry ) {
869 $expiryFormatted = $uiLanguage->userTimeAndDate( $currentExpiry, $uiUser );
870 $expiryFormattedD = $uiLanguage->userDate( $currentExpiry, $uiUser );
871 $expiryFormattedT = $uiLanguage->userTime( $currentExpiry, $uiUser );
872 $expiryHtml = $this->
msg(
'userrights-expiry-current' )->params(
873 $expiryFormatted, $expiryFormattedD, $expiryFormattedT )->text();
875 $expiryHtml = $this->
msg(
'userrights-expiry-none' )->text();
877 $expiryHtml .=
"<br />\n";
880 $this->
msg(
'userrights-expiry' )->
text() );
886 "mw-input-wpExpiry-$group",
887 $currentExpiry ?
'existing' :
'infinite'
889 if ( $checkbox[
'disabled-expiry'] ) {
890 $expiryFormOptions->setAttribute(
'disabled',
'disabled' );
893 if ( $currentExpiry ) {
894 $timestamp = $uiLanguage->userTimeAndDate( $currentExpiry, $uiUser );
895 $d = $uiLanguage->userDate( $currentExpiry, $uiUser );
896 $t = $uiLanguage->userTime( $currentExpiry, $uiUser );
897 $existingExpiryMessage = $this->
msg(
'userrights-expiry-existing',
898 $timestamp, $d,
$t );
899 $expiryFormOptions->addOption( $existingExpiryMessage->text(),
'existing' );
902 $expiryFormOptions->addOption(
903 $this->
msg(
'userrights-expiry-none' )->
text(),
906 $expiryFormOptions->addOption(
907 $this->
msg(
'userrights-expiry-othertime' )->
text(),
910 foreach ( $expiryOptions
as $option ) {
911 if ( strpos( $option,
":" ) ===
false ) {
912 $displayText =
$value = $option;
914 list( $displayText,
$value ) = explode(
":", $option );
916 $expiryFormOptions->addOption( $displayText, htmlspecialchars(
$value ) );
920 $expiryHtml .= $expiryFormOptions->getHTML() .
'<br />';
923 $attribs = [
'id' =>
"mw-input-wpExpiry-$group-other" ];
924 if ( $checkbox[
'disabled-expiry'] ) {
931 if ( $checkbox[
'set'] && $checkbox[
'disabled'] ) {
939 'id' =>
"mw-userrights-nested-wpGroup-$group",
940 'class' =>
'mw-userrights-nested',
942 $ret .=
"\t\t\t" .
Xml::tags(
'div', $divAttribs, $expiryHtml ) .
"\n";
949 return [
$ret, (bool)$columns[
'changeable'] ];
961 $groups[
'remove'] ) || ( $this->isself && in_array( $group, $groups[
'remove-self'] )
974 $groups[
'add'] ) || ( $this->isself && in_array( $group, $groups[
'add-self'] )
989 return $this->
getUser()->changeableGroups();
999 $rightsLogPage =
new LogPage(
'rights' );
getPageTitle( $subpage=false)
Get a self-referential title object.
error also a ContextSource you ll probably need to make sure the header is varied on $request
Show an error when the user tries to do something whilst blocked.
static tags( $element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
getOutput()
Get the OutputPage being used for this instance.
editUserGroupsForm( $username)
Edit user groups membership.
static label( $label, $id, $attribs=[])
Convenience function to build an HTML form label.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
static search( $audience, $search, $limit, $offset=0)
Do a prefix search of user names and return a list of matching user names.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
static newFatal( $message)
Factory function for fatal errors.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
switchForm()
Output a form to allow searching for a user.
getSkin()
Shortcut to get the skin being used for this instance.
execute( $par)
Manage forms to be shown according to posted data.
Allows to change the fields on the form that will be generated $name
getLanguage()
Shortcut to get user's language.
userCanChangeRights( $targetUser, $checkIfSelf=true)
Check whether the current user (from context) can change the target user's rights.
static openElement( $element, $attribs=null)
This opens an XML element.
showLogFragment( $user, $output)
Show a rights log fragment for the specified user.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Class for generating HTML <select> or <datalist> elements.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
static fieldset( $legend=false, $content=false, $attribs=[])
Shortcut for creating fieldsets.
static closeElement( $element)
Returns "</$element>".
static expiryToTimestamp( $expiry)
Converts a user group membership expiry string into a timestamp.
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
static getAllGroups()
Returns an array of all groups that may be edited.
Special page to allow managing user group membership.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
showEditUserGroupsForm( $user, $groups, $groupMemberships)
Show the form to edit group memberships.
getConfig()
Shortcut to get main config object.
static serialiseUgmForLog( $ugm)
Serialise a UserGroupMembership object for storage in the log_params section of the logging table.
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
static getLink( $ugm, IContextSource $context, $format, $userName=null)
Gets a link for a user group, possibly including the expiry date if relevant.
fetchUser( $username, $writing=true)
Normalize the input username, which may be local or remote, and return a user (or proxy) object for m...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
Class to simplify the use of log pages.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers please use GetContentModels hook to make them known to core if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive $limit
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
canProcessExpiries()
Returns true if this user rights form can set and change user group expiries.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object & $output
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
static showLogExtract(&$out, $types=[], $page='', $user='', $param=[])
Show log extract.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
getContext()
Gets the context this SpecialPage is executed in.
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
wfWikiID()
Get an ASCII string identifying this wiki This is used as a prefix in memcached keys.
static whoIs( $id)
Get the username corresponding to a given user ID.
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[])
Returns the attributes for the tooltip and access key.
msg()
Wrapper around wfMessage that sets the current context.
static newGood( $value=null)
Factory function for good results.
Parent class for all special pages.
static validDatabase( $database)
Confirm the selected database name is a valid local interwiki database name.
groupCheckboxes( $usergroups, $user)
Adds a table with checkboxes where you can select what groups to add/remove.
wfIsInfinity( $str)
Determine input string is represents as infinity.
getRequest()
Get the WebRequest being used for this instance.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
doesWrites()
Indicates whether this special page may perform database writes.
static getAllGroups()
Return the set of defined explicit groups.
saveUserGroups( $username, $reason, $user)
Save user groups changes in the database.
static newFromName( $database, $name, $ignoreInvalidDB=false)
Factory function; get a remote user entry by name.
doSaveUserGroups( $user, $add, $remove, $reason='', $tags=[], $groupExpiries=[])
Save user groups changes in the database.
static closeElement( $element)
Shortcut to close an XML element.
static getCanonicalName( $name, $validate='valid')
Given unvalidated user input, return a canonical username, or false if the username is invalid.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Class for creating log entries manually, to inject them into the database.
$mTarget
The target of the local right-adjuster's interest.
static input( $name, $size=false, $value=false, $attribs=[])
Convenience function to build an HTML text input field.
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
changeableGroups()
Returns $this->getUser()->changeableGroups()
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static whoIs( $database, $id, $ignoreInvalidDB=false)
Same as User::whoIs()
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags, $oldUGMs, $newUGMs)
Add a rights log entry for an action.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
static inputLabel( $label, $name, $id, $size=false, $value=false, $attribs=[])
Convenience function to build an HTML text input field with a label.
this hook is for auditing only or null if authentication failed before getting that far $username
static getGroupMemberName( $group, $username)
Gets the localized name for a member of a group, if it exists.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Represents a "user group membership" – a specific instance of a user belonging to a group.
the array() calling protocol came about after MediaWiki 1.4rc1.
static submitButton( $value, $attribs=[])
Convenience function to build an HTML submit button When $wgUseMediaWikiUIEverywhere is true it will ...
static checkLabel( $label, $name, $id, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox with a label.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out