Index: trunk/extensions/SecurePasswords/SecurePasswords.php |
— | — | @@ -239,37 +239,37 @@ |
240 | 240 | |
241 | 241 | // check password length |
242 | 242 | if( strlen( $password ) < $wgValidPasswords['minlength'] ) { |
243 | | - $result = false; |
| 243 | + $result = 'securepasswords-valid'; |
244 | 244 | return false; |
245 | 245 | } |
246 | 246 | |
247 | 247 | // check for a lowercase letter, if needed |
248 | 248 | if( $wgValidPasswords['lowercase'] && !preg_match( '/[a-z]/', $password ) ) { |
249 | | - $result = false; |
| 249 | + $result = 'securepasswords-lowercase'; |
250 | 250 | return false; |
251 | 251 | } |
252 | 252 | |
253 | 253 | // check for an uppercase letter, if needed |
254 | 254 | if( $wgValidPasswords['uppercase'] && !preg_match( '/[A-Z]/', $password ) ) { |
255 | | - $result = false; |
| 255 | + $result = 'securepasswords-uppercase'; |
256 | 256 | return false; |
257 | 257 | } |
258 | 258 | |
259 | 259 | // check for a digit, if needed |
260 | 260 | if( $wgValidPasswords['digit'] && !preg_match( '/[0-9]/', $password ) ) { |
261 | | - $result = false; |
| 261 | + $result = 'securepasswords-digit'; |
262 | 262 | return false; |
263 | 263 | } |
264 | 264 | |
265 | 265 | // check for a special character, if needed |
266 | 266 | if( $wgValidPasswords['special'] && !preg_match( '/[' . $wgSecurePasswordsSpecialChars . ']/', $password ) ) { |
267 | | - $result = false; |
| 267 | + $result = 'securepasswords-special'; |
268 | 268 | return false; |
269 | 269 | } |
270 | 270 | |
271 | 271 | // check for the username, if needed |
272 | 272 | if( $wgValidPasswords['usercheck'] && $wgContLang->lc( $password ) == $wgContLang->lc( $user->getName() ) ) { |
273 | | - $result = false; |
| 273 | + $result = 'securepasswords-username'; |
274 | 274 | return false; |
275 | 275 | } |
276 | 276 | |
— | — | @@ -278,7 +278,7 @@ |
279 | 279 | $link = pspell_new( $lang ); |
280 | 280 | if( $link ) { |
281 | 281 | if( pspell_check( $link, $password ) ) { |
282 | | - $result = false; |
| 282 | + $result = 'securepasswords-word'; |
283 | 283 | return false; |
284 | 284 | } |
285 | 285 | } |
— | — | @@ -286,7 +286,7 @@ |
287 | 287 | $link = pspell_new( 'en' ); |
288 | 288 | if( $link ) { |
289 | 289 | if( pspell_check( $link, $password ) ) { |
290 | | - $result = false; |
| 290 | + $result = 'securepasswords-word'; |
291 | 291 | return false; |
292 | 292 | } |
293 | 293 | } |