Index: trunk/phase3/CREDITS |
— | — | @@ -81,6 +81,7 @@ |
82 | 82 | * Michael Walsh |
83 | 83 | * Mike Horvath |
84 | 84 | * Mormegil |
| 85 | +* MrPete |
85 | 86 | * Nakon |
86 | 87 | * Nathan Larson |
87 | 88 | * nephele |
Index: trunk/phase3/includes/AuthPlugin.php |
— | — | @@ -130,8 +130,35 @@ |
131 | 131 | public function allowPasswordChange() { |
132 | 132 | return true; |
133 | 133 | } |
| 134 | + |
| 135 | + /** |
| 136 | + * Can users change their Real Name? |
| 137 | + * |
| 138 | + * @return bool |
| 139 | + */ |
| 140 | + public function allowRealNameChange() { |
| 141 | + return false; |
| 142 | + } |
134 | 143 | |
135 | 144 | /** |
| 145 | + * Can users change their email address? |
| 146 | + * |
| 147 | + * @return bool |
| 148 | + */ |
| 149 | + public function allowEmailChange() { |
| 150 | + return false; |
| 151 | + } |
| 152 | + |
| 153 | + /** |
| 154 | + * Can users change their Nickname? |
| 155 | + * |
| 156 | + * @return bool |
| 157 | + */ |
| 158 | + public function allowNickChange() { |
| 159 | + return false; |
| 160 | + } |
| 161 | + |
| 162 | + /** |
136 | 163 | * Set the given password in the authentication database. |
137 | 164 | * As a special case, the password may be set to null to request |
138 | 165 | * locking the password to an unusable value, with the expectation |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -138,11 +138,11 @@ |
139 | 139 | } |
140 | 140 | |
141 | 141 | // Actually changeable stuff |
142 | | - global $wgAllowRealName; |
| 142 | + global $wgAllowRealName, $wgAuth; |
143 | 143 | if ($wgAllowRealName) { |
144 | 144 | $defaultPreferences['realname'] = |
145 | 145 | array( |
146 | | - 'type' => 'text', |
| 146 | + 'type' => $wgAuth->allowRealNameChange() ? 'text' : 'info', |
147 | 147 | 'default' => $user->getRealName(), |
148 | 148 | 'section' => 'personal/info', |
149 | 149 | 'label-message' => 'yourrealname', |
— | — | @@ -164,7 +164,6 @@ |
165 | 165 | 'help-message' => 'prefs-help-gender', |
166 | 166 | ); |
167 | 167 | |
168 | | - global $wgAuth; |
169 | 168 | if ($wgAuth->allowPasswordChange()) { |
170 | 169 | global $wgUser; // For skin. |
171 | 170 | $link = $wgUser->getSkin()->link( SpecialPage::getTitleFor( 'ResetPass' ), |
— | — | @@ -253,7 +252,7 @@ |
254 | 253 | global $wgMaxSigChars; |
255 | 254 | $defaultPreferences['nickname'] = |
256 | 255 | array( |
257 | | - 'type' => 'text', |
| 256 | + 'type' => $wgAuth->allowNickChange() ? 'text' : 'info', |
258 | 257 | 'maxlength' => $wgMaxSigChars, |
259 | 258 | 'label-message' => 'yournick', |
260 | 259 | 'validation-callback' => |
— | — | @@ -274,7 +273,7 @@ |
275 | 274 | |
276 | 275 | $defaultPreferences['emailaddress'] = |
277 | 276 | array( |
278 | | - 'type' => 'text', |
| 277 | + 'type' => $wgAuth->allowEmailChange() ? 'text' : 'info', |
279 | 278 | 'default' => $user->getEmail(), |
280 | 279 | 'section' => 'personal/email', |
281 | 280 | 'label-message' => 'youremail', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -175,6 +175,7 @@ |
176 | 176 | * (bug 18242) Show the Subversion revision number per extensions in |
177 | 177 | Special:Version |
178 | 178 | * (bug 18420) Missing file revisions are handled gracefully now |
| 179 | +* (bug 9219) Auth plugins can control editing RealName/Email/Nick preferences |
179 | 180 | |
180 | 181 | === Bug fixes in 1.15 === |
181 | 182 | * (bug 16968) Special:Upload no longer throws useless warnings. |