Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -690,6 +690,7 @@ |
691 | 691 | 'userrights-groupsmember', |
692 | 692 | 'userrights-groupsavailable', |
693 | 693 | 'userrights-groupshelp', |
| 694 | + 'userrights-reason', |
694 | 695 | ), |
695 | 696 | 'group' => array( |
696 | 697 | 'group', |
— | — | @@ -1222,7 +1223,7 @@ |
1223 | 1224 | 'contributions' => array( |
1224 | 1225 | 'contributions', |
1225 | 1226 | 'mycontris', |
1226 | | - 'contribsub', |
| 1227 | + 'contribsub2', |
1227 | 1228 | 'nocontribs', |
1228 | 1229 | 'ucnote', |
1229 | 1230 | 'uclinks', |
Index: trunk/phase3/includes/SpecialUserrights.php |
— | — | @@ -53,10 +53,12 @@ |
54 | 54 | if( $this->mRequest->getCheck( 'saveusergroups' ) ) { |
55 | 55 | global $wgUser; |
56 | 56 | $username = $this->mRequest->getVal( 'user-editname' ); |
| 57 | + $reason = $this->mRequest->getVal( 'user-reason' ); |
57 | 58 | if( $wgUser->matchEditToken( $this->mRequest->getVal( 'wpEditToken' ), $username ) ) { |
58 | 59 | $this->saveUserGroups( $username, |
59 | 60 | $this->mRequest->getArray( 'member' ), |
60 | | - $this->mRequest->getArray( 'available' ) ); |
| 61 | + $this->mRequest->getArray( 'available' ), |
| 62 | + $reason ); |
61 | 63 | } |
62 | 64 | } |
63 | 65 | } |
— | — | @@ -69,9 +71,10 @@ |
70 | 72 | * @param string $username Username to apply changes to. |
71 | 73 | * @param array $removegroup id of groups to be removed. |
72 | 74 | * @param array $addgroup id of groups to be added. |
| 75 | + * @param string $reason Reason for group change |
73 | 76 | * |
74 | 77 | */ |
75 | | - function saveUserGroups( $username, $removegroup, $addgroup) { |
| 78 | + function saveUserGroups( $username, $removegroup, $addgroup, $reason ) { |
76 | 79 | global $wgOut; |
77 | 80 | $u = User::newFromName($username); |
78 | 81 | |
— | — | @@ -107,7 +110,7 @@ |
108 | 111 | |
109 | 112 | wfRunHooks( 'UserRights', array( &$u, $addgroup, $removegroup ) ); |
110 | 113 | $log = new LogPage( 'rights' ); |
111 | | - $log->addEntry( 'rights', Title::makeTitle( NS_USER, $u->getName() ), '', array( $this->makeGroupNameList( $oldGroups ), |
| 114 | + $log->addEntry( 'rights', Title::makeTitle( NS_USER, $u->getName() ), $reason, array( $this->makeGroupNameList( $oldGroups ), |
112 | 115 | $this->makeGroupNameList( $newGroups ) ) ); |
113 | 116 | } |
114 | 117 | |
— | — | @@ -148,29 +151,27 @@ |
149 | 152 | |
150 | 153 | $groups = $user->getGroups(); |
151 | 154 | |
152 | | - $wgOut->addHTML( "<form name=\"editGroup\" action=\"$this->action\" method=\"post\">\n". |
153 | | - wfElement( 'input', array( |
154 | | - 'type' => 'hidden', |
155 | | - 'name' => 'user-editname', |
156 | | - 'value' => $username ) ) . |
157 | | - wfElement( 'input', array( |
158 | | - 'type' => 'hidden', |
159 | | - 'name' => 'wpEditToken', |
160 | | - 'value' => $wgUser->editToken( $username ) ) ) . |
161 | | - $this->fieldset( 'editusergroup', |
162 | | - $wgOut->parse( wfMsg('editinguser', $username ) ) . |
163 | | - '<table border="0" align="center"><tr><td>'. |
164 | | - HTMLSelectGroups('member', $this->mName.'-groupsmember', $groups,true,6). |
165 | | - '</td><td>'. |
166 | | - HTMLSelectGroups('available', $this->mName.'-groupsavailable', $groups,true,6,true). |
167 | | - '</td></tr></table>'."\n". |
| 155 | + $wgOut->addHTML( |
| 156 | + Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->action, 'name' => 'editGroup' ) ) . |
| 157 | + Xml::hidden( 'user-editname', $username ) . |
| 158 | + Xml::hidden( 'wpEditToken', $wgUser->editToken( $username ) ) . |
| 159 | + Xml::openElement( 'fieldset' ) . |
| 160 | + Xml::element( 'legend', array(), wfMsg( 'userrights-editusergroup' ) ) . |
| 161 | + $wgOut->parse( wfMsg( 'editinguser', $username ) ) . |
| 162 | + "<table border='0' align='center'> |
| 163 | + <tr> |
| 164 | + <td>" . HTMLSelectGroups( 'member', $this->mName.'-groupsmember', $groups, true, 6 ) . "</td> |
| 165 | + <td align='right'>" . HTMLSelectGroups( 'available', $this->mName.'-groupsavailable', $groups, true, 6, true) . "</td> |
| 166 | + </tr><tr> |
| 167 | + <td>" . $wgOut->parse( wfMsg( 'userrights-reason' ) ) . "</td> |
| 168 | + <td align='right'>" . Xml::input( 'user-reason', 30 ) . "</td> |
| 169 | + </tr> |
| 170 | + </table> \n" . |
168 | 171 | $wgOut->parse( wfMsg('userrights-groupshelp') ) . |
169 | | - wfElement( 'input', array( |
170 | | - 'type' => 'submit', |
171 | | - 'name' => 'saveusergroups', |
172 | | - 'value' => wfMsg( 'saveusergroups' ) ) ) |
173 | | - )); |
174 | | - $wgOut->addHTML( "</form>\n" ); |
| 172 | + Xml::submitButton( wfMsg( 'saveusergroups' ), array( 'name' => 'saveusergroups' ) ) . |
| 173 | + Xml::closeElement( 'fieldset' ) . |
| 174 | + Xml::closeElement( 'form' ) . "\n" |
| 175 | + ); |
175 | 176 | } |
176 | 177 | } // end class UserrightsForm |
177 | 178 | ?> |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1266,6 +1266,7 @@ |
1267 | 1267 | 'userrights-groupsavailable' => 'Available groups:', |
1268 | 1268 | 'userrights-groupshelp' => 'Select groups you want the user to be removed from or added to. |
1269 | 1269 | Unselected groups will not be changed. You can deselect a group with CTRL + Left Click', |
| 1270 | +'userrights-reason' => 'Reason:', |
1270 | 1271 | |
1271 | 1272 | # Groups |
1272 | 1273 | 'group' => 'Group:', |
Index: trunk/phase3/languages/messages/MessagesDe.php |
— | — | @@ -884,6 +884,7 @@ |
885 | 885 | 'userrights-groupsavailable' => 'Verfügbare Gruppen:', |
886 | 886 | 'userrights-groupshelp' => "Wählen Sie die Gruppen, aus denen der Benutzer entfernt oder zu denen er hinzugefügt werden soll. |
887 | 887 | Nicht selektierte Gruppen werden nicht geändert. Eine Selektion kann mit '''Strg + Linksklick''' (bzw. Ctrl + Linksklick) entfernt werden.", |
| 888 | +'userrights-reason' => 'Grund:', |
888 | 889 | |
889 | 890 | # Groups |
890 | 891 | 'group' => 'Gruppe:', |
— | — | @@ -1469,7 +1470,7 @@ |
1470 | 1471 | # Contributions |
1471 | 1472 | 'contributions' => 'Benutzerbeiträge', |
1472 | 1473 | 'mycontris' => 'Eigene Beiträge', |
1473 | | -'contribsub2' => 'Für $1 ($2)', |
| 1474 | +'contribsub2' => 'Für $1 ($2)', |
1474 | 1475 | 'nocontribs' => 'Es wurden keine Benutzerbeiträge mit diesen Kriterien gefunden.', |
1475 | 1476 | 'ucnote' => 'Dies sind die letzten <b>$1</b> Beiträge des Benutzers in den letzten <b>$2</b> Tagen.', |
1476 | 1477 | 'uclinks' => 'Zeige die letzten $1 Beiträge; zeige die letzten $2 Tage.', |
— | — | @@ -1885,7 +1886,7 @@ |
1886 | 1887 | 'variantname-kk-cn' => 'kk-cn', |
1887 | 1888 | 'variantname-kk' => 'kk', |
1888 | 1889 | |
1889 | | -'passwordtooshort' => 'Das Passwort ist zu kurz. Es muss mindestens $1 Zeichen lang sein.', |
| 1890 | +'passwordtooshort' => 'Fehler bei der Passwort-Wahl: Es muss mindestens $1 Zeichen lang sein und darf nicht mit dem Benutzernamen identisch sein.', |
1890 | 1891 | |
1891 | 1892 | # Metadata |
1892 | 1893 | 'metadata' => 'Metadaten', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -128,6 +128,7 @@ |
129 | 129 | * 'contribsub' message changed to 'contribsub2' with two parameters to permit |
130 | 130 | better localization. Change is reverse-compatible and can be ignored for |
131 | 131 | most wikis. |
| 132 | +* Adding a 'reason' field to Special:Userrights |
132 | 133 | |
133 | 134 | == Bugfixes since 1.9 == |
134 | 135 | |