52 $par = ( $par !==
null ) ? $par :
'';
53 $parms = explode(
'/', $par );
54 $symsForAll = [
'*',
'user' ];
56 if ( $parms[0] !=
'' &&
59 $this->requestedGroup = $par;
60 $un =
$request->getText(
'username' );
61 }
elseif ( count( $parms ) == 2 ) {
62 $this->requestedGroup = $parms[0];
65 $this->requestedGroup =
$request->getVal(
'group' );
66 $un = ( $par !=
'' ) ? $par :
$request->getText(
'username' );
69 if (
in_array( $this->requestedGroup, $symsForAll ) ) {
70 $this->requestedGroup =
'';
72 $this->editsOnly =
$request->getBool(
'editsOnly' );
73 $this->temporaryGroupsOnly =
$request->getBool(
'temporaryGroupsOnly' );
74 $this->creationSort =
$request->getBool(
'creationSort' );
76 $this->mDefaultDirection =
$request->getBool(
'desc' )
80 $this->requestedUser =
'';
83 $username = Title::makeTitleSafe( NS_USER, $un );
86 $this->requestedUser =
$username->getText();
90 parent::__construct();
97 return $this->creationSort ?
'user_id' :
'user_name';
108 if ( !$this->
getUser()->isAllowed(
'hideuser' ) ) {
109 $conds[] =
'ipb_deleted IS NULL OR ipb_deleted = 0';
114 if ( $this->requestedGroup !=
'' || $this->temporaryGroupsOnly ) {
115 $conds[] =
'ug_expiry >= ' .
$dbr->addQuotes(
$dbr->timestamp() ) .
116 ( !$this->temporaryGroupsOnly ?
' OR ug_expiry IS NULL' :
'' );
119 if ( $this->requestedGroup !=
'' ) {
123 if ( $this->requestedUser !=
'' ) {
124 # Sorted either by account creation or name
125 if ( $this->creationSort ) {
128 $conds[] =
'user_name >= ' .
$dbr->addQuotes( $this->requestedUser );
132 if ( $this->editsOnly ) {
133 $conds[] =
'user_editcount > 0';
136 $options[
'GROUP BY'] = $this->creationSort ?
'user_id' :
'user_name';
139 'tables' => [
'user',
'user_groups',
'ipblocks' ],
141 'user_name' => $this->creationSort ?
'MAX(user_name)' :
'user_name',
142 'user_id' => $this->creationSort ?
'user_id' :
'MAX(user_id)',
143 'edits' =>
'MAX(user_editcount)',
144 'creation' =>
'MIN(user_registration)',
145 'ipb_deleted' =>
'MAX(ipb_deleted)',
146 'ipb_sitewide' =>
'MAX(ipb_sitewide)'
150 'user_groups' => [
'LEFT JOIN',
'user_id=ug_user' ],
161 Hooks::run(
'SpecialListusersQueryInfo', [ $this, &
$query ] );
171 if ( $row->user_id == 0 ) { # T18487
175 $userName = $row->user_name;
189 if ( !$this->including && count( $ugms ) > 0 ) {
191 foreach ( $ugms as $ugm ) {
194 $groups =
$lang->commaList( $list );
197 $item =
$lang->specialList( $ulinks, $groups );
199 if ( $row->ipb_deleted ) {
200 $item =
"<span class=\"deleted\">$item</span>";
204 if ( !$this->including && $this->
getConfig()->
get(
'Edititis' ) ) {
205 $count = $this->
msg(
'usereditcount' )->numParams( $row->edits )->escaped();
206 $edits = $this->
msg(
'word-separator' )->escaped() . $this->
msg(
'brackets', $count )->escaped();
210 # Some rows may be null
211 if ( !$this->including && $row->creation ) {
213 $d =
$lang->userDate( $row->creation, $user );
214 $t =
$lang->userTime( $row->creation, $user );
215 $created = $this->
msg(
'usercreated', $d,
$t, $row->user_name )->escaped();
216 $created =
' ' . $this->
msg(
'parentheses' )->rawParams( $created )->escaped();
219 $blocked = !
is_null( $row->ipb_deleted ) && $row->ipb_sitewide ===
'1' ?
220 ' ' . $this->
msg(
'listusers-blocked', $userName )->escaped() :
223 Hooks::run(
'SpecialListusersFormatRow', [ &$item, $row ] );
225 return Html::rawElement(
'li', [],
"{$item}{$edits}{$created}{$blocked}" );
231 # Give some pointers to make user links
232 foreach ( $this->mResult as $row ) {
233 $batch->add( NS_USER, $row->user_name );
235 $userIds[] = $row->user_id;
240 $groupRes =
$dbr->select(
242 UserGroupMembership::selectFields(),
243 [
'ug_user' => $userIds ],
248 foreach ( $groupRes as $row ) {
249 $ugm = UserGroupMembership::newFromRow( $row );
250 if ( !$ugm->isExpired() ) {
252 $groups[$row->ug_group] =
true;
258 Hooks::run(
'UsersPagerDoBatchLookups', [
$dbr, $userIds, &
$cache, &$groups ] );
260 $this->userGroupCache =
$cache;
263 foreach ( $groups as $group => $unused ) {
264 $groupPage = UserGroupMembership::getGroupPage( $group );
266 $batch->addObj( $groupPage );
271 $this->mResult->rewind();
280 $groupOptions = [ $this->
msg(
'group-all' )->text() =>
'' ];
281 foreach ( $this->
getAllGroups() as $group => $groupText ) {
287 'class' => HTMLUserTextField::class,
288 'label' => $this->
msg(
'listusersfrom' )->text(),
289 'name' =>
'username',
293 'label' => $this->
msg(
'group' )->text(),
296 'class' => HTMLSelectField::class,
301 'label' => $this->
msg(
'listusers-editsonly' )->text(),
302 'name' =>
'editsOnly',
306 'temporaryGroupsOnly' => [
308 'label' => $this->
msg(
'listusers-temporarygroupsonly' )->text(),
309 'name' =>
'temporaryGroupsOnly',
310 'id' =>
'temporaryGroupsOnly',
315 'label' => $this->
msg(
'listusers-creationsort' )->text(),
316 'name' =>
'creationSort',
317 'id' =>
'creationSort',
322 'label' => $this->
msg(
'listusers-desc' )->text(),
327 'limithiddenfield' => [
328 'class' => HTMLHiddenField::class,
334 $beforeSubmitButtonHookOut =
'';
335 Hooks::run(
'SpecialListusersHeaderForm', [ $this, &$beforeSubmitButtonHookOut ] );
337 if ( $beforeSubmitButtonHookOut !==
'' ) {
339 'class' => HTMLInfoField::class,
346 'class' => HTMLSubmitField::class,
347 'buttonlabel-message' =>
'listusers-submit',
350 $beforeClosingFieldsetHookOut =
'';
351 Hooks::run(
'SpecialListusersHeader', [ $this, &$beforeClosingFieldsetHookOut ] );
353 if ( $beforeClosingFieldsetHookOut !==
'' ) {
355 'class' => HTMLInfoField::class,
364 ->setAction( Title::newFromText(
$self )->getLocalURL() )
365 ->setId(
'mw-listusers-form' )
366 ->setFormIdentifier(
'mw-listusers-form' )
367 ->suppressDefaultSubmit()
368 ->setWrapperLegendMsg(
'listusers' );
369 return $htmlForm->prepareForm()->getHTML(
true );
379 $result[$group] = UserGroupMembership::getGroupName( $group );
391 $query = parent::getDefaultQuery();
392 if ( $this->requestedGroup !=
'' ) {
395 if ( $this->requestedUser !=
'' ) {
398 Hooks::run(
'SpecialListusersDefaultQuery', [ $this, &
$query ] );
414 return $user->getGroupMemberships();
416 return $cache[$uid] ?? [];
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getContext()
Get the base IContextSource object.
setContext(IContextSource $context)
Class representing a list of titles The execute() method checks them all for existence and adds them ...
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
static userToolLinksRedContribs( $userId, $userText, $edits=null, $useParentheses=true)
Alias for userToolLinks( $userId, $userText, true );.
static getAllGroups()
Return the set of defined explicit groups.
static newFromId( $id)
Static factory method for creation from a given user ID.
static idFromName( $name, $flags=self::READ_NORMAL)
Get database id given a user name.
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
namespace being checked & $result
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead & $formDescriptor
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 & $options
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
this hook is for auditing only or null if authentication failed before getting that far $username
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
Interface for objects which can provide a MediaWiki context on request.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
if(!isset( $args[0])) $lang