Index: trunk/phase3/includes/SpecialListusers.php |
— | — | @@ -39,8 +39,11 @@ |
40 | 40 | function __construct($group=null) { |
41 | 41 | global $wgRequest; |
42 | 42 | $this->requestedGroup = $group != "" ? $group : $wgRequest->getVal( 'group' ); |
43 | | - $this->requestedUser = $wgRequest->getText( 'username', $this->mOffset ); |
44 | | - |
| 43 | + $un = $wgRequest->getText( 'username' ); |
| 44 | + if ( $un != '' ) { |
| 45 | + $username = Title::makeTitleSafe( NS_USER, $un ); |
| 46 | + $this->requestedUser = $username->getText(); |
| 47 | + } |
45 | 48 | parent::__construct(); |
46 | 49 | } |
47 | 50 | |
— | — | @@ -57,9 +60,9 @@ |
58 | 61 | if ($this->requestedUser != "") { |
59 | 62 | $conds[] = 'user_name >= ' . wfGetDB()->addQuotes( $this->requestedUser ); |
60 | 63 | } |
61 | | - |
| 64 | + |
62 | 65 | list ($user,$user_groups) = wfGetDB()->tableNamesN('user','user_groups'); |
63 | | - |
| 66 | + |
64 | 67 | return array( |
65 | 68 | 'tables' => " $user LEFT JOIN $user_groups ON user_id=ug_user ", |
66 | 69 | 'fields' => array('user_name', |
— | — | @@ -70,7 +73,7 @@ |
71 | 74 | 'conds' => $conds |
72 | 75 | ); |
73 | 76 | } |
74 | | - |
| 77 | + |
75 | 78 | function formatRow($row) { |
76 | 79 | $userPage = Title::makeTitle(NS_USER, $row->user_name); |
77 | 80 | $name = $this->getSkin()->makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) ); |
— | — | @@ -87,7 +90,7 @@ |
88 | 91 | } elseif ($row->numgroups == 1 ) { // MAX hack inside query :) |
89 | 92 | $groups[$row->singlegroup] = User::getGroupMember( $row->singlegroup ); |
90 | 93 | } |
91 | | - |
| 94 | + |
92 | 95 | if ( count($groups) > 0 ) { |
93 | 96 | foreach( $groups as $group => $desc ) { |
94 | 97 | $list[] = User::makeGroupLinkHTML( $group, $desc); |
— | — | @@ -96,18 +99,19 @@ |
97 | 100 | } else { |
98 | 101 | $groups =''; |
99 | 102 | } |
| 103 | + //$ulink = $skin->userLink( $result->user, $result->user_text ) . ' ' . $skin->userToolLinks( $result->user, $result->user_text ); |
100 | 104 | return '<li>' . wfSpecialList ($name, $groups) .'</li>'; |
101 | 105 | } |
102 | | - |
| 106 | + |
103 | 107 | function getBody() { |
104 | 108 | if (!$this->mQueryDone) { |
105 | 109 | $this->doQuery(); |
106 | 110 | } |
107 | 111 | $batch = new LinkBatch; |
108 | 112 | $db = $this->mDb; |
109 | | - |
| 113 | + |
110 | 114 | $this->mResult->rewind(); |
111 | | - |
| 115 | + |
112 | 116 | while ( $row = $this->mResult->fetchObject() ) { |
113 | 117 | $batch->addObj( Title::makeTitleSafe( NS_USER, $row->user_name ) ); |
114 | 118 | } |
— | — | @@ -115,41 +119,45 @@ |
116 | 120 | $this->mResult->rewind(); |
117 | 121 | return parent::getBody(); |
118 | 122 | } |
119 | | - |
| 123 | + |
120 | 124 | function getPageHeader( ) { |
| 125 | + global $wgRequest; |
121 | 126 | $self = $this->getTitle(); |
122 | 127 | |
123 | 128 | # Form tag |
124 | | - $out = wfOpenElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) ); |
125 | | - |
| 129 | + $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $self->getLocalUrl() ) ) . |
| 130 | + '<fieldset>' . |
| 131 | + Xml::element( 'legend', array(), wfMsg( 'listusers' ) ); |
| 132 | + |
| 133 | + # Username field |
| 134 | + $out .= Xml::label( wfMsg( 'listusersfrom' ), 'offset' ) . ' ' . |
| 135 | + Xml::input( 'username', 20, $this->requestedUser ) . ' '; |
| 136 | + |
| 137 | + if( $this->mLimit ) |
| 138 | + $out .= Xml::hidden( 'limit', $this->mLimit ); |
| 139 | + |
126 | 140 | # Group drop-down list |
127 | | - $out .= wfElement( 'label', array( 'for' => 'group' ), wfMsg( 'group' ) ) . ' '; |
128 | | - $out .= wfOpenElement( 'select', array( 'name' => 'group', 'id' => 'group' ) ); |
129 | | - $out .= wfElement( 'option', array( 'value' => '' ), wfMsg( 'group-all' ) ); # Item for "all groups" |
| 141 | + $out .= Xml::label( wfMsg( 'group' ), 'group' ) . ' ' . |
| 142 | + Xml::openElement('select', array( 'name' => 'group', 'id' => 'group' ) ) . |
| 143 | + Xml::option( wfMsg( 'group-all' ), '' ); # Item for "all groups" |
| 144 | + |
130 | 145 | $groups = User::getAllGroups(); |
131 | 146 | foreach( $groups as $group ) { |
132 | 147 | $attribs = array( 'value' => $group ); |
133 | 148 | if( $group == $this->requestedGroup ) |
134 | 149 | $attribs['selected'] = 'selected'; |
135 | | - $out .= wfElement( 'option', $attribs, User::getGroupName( $group ) ); |
| 150 | + $out .= Xml::option( User::getGroupName( $group ), $attribs['value'], $attribs['selected'] ); |
136 | 151 | } |
137 | | - $out .= wfCloseElement( 'select' ) . ' ';;# . wfElement( 'br' ); |
| 152 | + $out .= Xml::closeElement( 'select' ) . ' '; |
138 | 153 | |
139 | | - # Username field |
140 | | - $out .= wfElement( 'label', array( 'for' => 'offset' ), wfMsg( 'listusersfrom' ) ) . ' '; |
141 | | - $out .= wfElement( 'input', array( 'type' => 'text', 'id' => 'username', 'name' => 'username', |
142 | | - 'value' => $this->requestedUser ) ) . ' '; |
143 | | - |
144 | | - if( $this->mLimit ) |
145 | | - $out .= wfElement( 'input', array( 'type' => 'hidden', 'name' => 'limit', 'value' => $this->mLimit ) ); |
146 | | - |
147 | 154 | # Submit button and form bottom |
148 | | - $out .= wfElement( 'input', array( 'type' => 'submit', 'value' => wfMsg( 'allpagessubmit' ) ) ); |
149 | | - $out .= wfCloseElement( 'form' ); |
| 155 | + $out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . |
| 156 | + '</fieldset>' . |
| 157 | + Xml::closeElement( 'form' ); |
150 | 158 | |
151 | 159 | return $out; |
152 | 160 | } |
153 | | - |
| 161 | + |
154 | 162 | /** |
155 | 163 | * Preserve group and username offset parameters when paging |
156 | 164 | * @return array |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1597,7 +1597,7 @@ |
1598 | 1598 | # Special:Listusers |
1599 | 1599 | 'listusersfrom' => 'Display users starting at:', |
1600 | 1600 | 'listusers-submit' => 'Show', |
1601 | | -'listusers-noresult' => 'No users found. Please check upper-/lowercase variants too.', |
| 1601 | +'listusers-noresult' => 'No user found.', |
1602 | 1602 | |
1603 | 1603 | # Email this user |
1604 | 1604 | # |
Index: trunk/phase3/languages/messages/MessagesDe.php |
— | — | @@ -1198,7 +1198,7 @@ |
1199 | 1199 | # Special:Listusers |
1200 | 1200 | 'listusersfrom' => 'Zeige Benutzer ab:', |
1201 | 1201 | 'listusers-submit' => 'Zeige', |
1202 | | -'listusers-noresult' => 'Keine Benutzer gefunden. Bitte beachte, dass die Groß-/Kleinschreibung des Anfangsbuchstabens zu unterschiedlichen Ergebnissen führt.', |
| 1202 | +'listusers-noresult' => 'Keinen Benutzer gefunden.', |
1203 | 1203 | |
1204 | 1204 | # E-mail user |
1205 | 1205 | 'mailnologin' => 'Sie sind nicht angemeldet.', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -264,8 +264,8 @@ |
265 | 265 | * (bug 8815) Setting password in initUser() breaks LdapAuthentication plugin |
266 | 266 | * (bug 9256) Add a quick note to index.php header comments |
267 | 267 | * (bug 1196) Add IPv6 support to blocks |
| 268 | +* Make Special:Listusers caseinsensitive for first letter |
268 | 269 | |
269 | | - |
270 | 270 | == Languages updated == |
271 | 271 | |
272 | 272 | * Arabic (ar) |