Index: trunk/phase3/includes/AuthPlugin.php |
— | — | @@ -123,42 +123,26 @@ |
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
127 | | - * Can users change their passwords? |
| 127 | + * Allow a property change? Properties are the same as preferences |
| 128 | + * and use the same keys. 'Realname' 'Emailaddress' and 'Nickname' |
| 129 | + * all reference this. |
128 | 130 | * |
129 | 131 | * @return bool |
130 | 132 | */ |
131 | | - public function allowPasswordChange() { |
| 133 | + public function allowPropChange( $prop = '' ) { |
132 | 134 | return true; |
133 | 135 | } |
134 | | - |
135 | | - /** |
136 | | - * Can users change their Real Name? |
137 | | - * |
138 | | - * @return bool |
139 | | - */ |
140 | | - public function allowRealNameChange() { |
141 | | - return true; |
142 | | - } |
143 | 136 | |
144 | 137 | /** |
145 | | - * Can users change their email address? |
| 138 | + * Can users change their passwords? |
146 | 139 | * |
147 | 140 | * @return bool |
148 | 141 | */ |
149 | | - public function allowEmailChange() { |
| 142 | + public function allowPasswordChange() { |
150 | 143 | return true; |
151 | 144 | } |
152 | 145 | |
153 | 146 | /** |
154 | | - * Can users change their Nickname? |
155 | | - * |
156 | | - * @return bool |
157 | | - */ |
158 | | - public function allowNickChange() { |
159 | | - return true; |
160 | | - } |
161 | | - |
162 | | - /** |
163 | 147 | * Set the given password in the authentication database. |
164 | 148 | * As a special case, the password may be set to null to request |
165 | 149 | * locking the password to an unusable value, with the expectation |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | if ($wgAllowRealName) { |
144 | 144 | $defaultPreferences['realname'] = |
145 | 145 | array( |
146 | | - 'type' => $wgAuth->allowRealNameChange() ? 'text' : 'info', |
| 146 | + 'type' => $wgAuth->allowPropChange( 'realname' ) ? 'text' : 'info', |
147 | 147 | 'default' => $user->getRealName(), |
148 | 148 | 'section' => 'personal/info', |
149 | 149 | 'label-message' => 'yourrealname', |
— | — | @@ -252,7 +252,7 @@ |
253 | 253 | global $wgMaxSigChars; |
254 | 254 | $defaultPreferences['nickname'] = |
255 | 255 | array( |
256 | | - 'type' => $wgAuth->allowNickChange() ? 'text' : 'info', |
| 256 | + 'type' => $wgAuth->allowPropChange( 'nickname' ) ? 'text' : 'info', |
257 | 257 | 'maxlength' => $wgMaxSigChars, |
258 | 258 | 'label-message' => 'yournick', |
259 | 259 | 'validation-callback' => |
— | — | @@ -273,7 +273,7 @@ |
274 | 274 | |
275 | 275 | $defaultPreferences['emailaddress'] = |
276 | 276 | array( |
277 | | - 'type' => $wgAuth->allowEmailChange() ? 'text' : 'info', |
| 277 | + 'type' => $wgAuth->allowPropChange( 'emailaddress' ) ? 'text' : 'info', |
278 | 278 | 'default' => $user->getEmail(), |
279 | 279 | 'section' => 'personal/email', |
280 | 280 | 'label-message' => 'youremail', |