Index: branches/REL1_17/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1149,15 +1149,6 @@ |
1150 | 1150 | 'php-mail-error' => '$1', # do not translate or duplicate this message to other languages |
1151 | 1151 | 'php-mail-error-unknown' => "Unknown error in PHP's mail() function", |
1152 | 1152 | |
1153 | | -# JavaScript password checks |
1154 | | -'password-strength' => 'Estimated password strength: $1', |
1155 | | -'password-strength-bad' => 'BAD', |
1156 | | -'password-strength-mediocre' => 'mediocre', |
1157 | | -'password-strength-acceptable' => 'acceptable', |
1158 | | -'password-strength-good' => 'good', |
1159 | | -'password-retype' => 'Retype password here', |
1160 | | -'password-retype-mismatch' => 'Passwords do not match', |
1161 | | - |
1162 | 1153 | # Password reset dialog |
1163 | 1154 | 'resetpass' => 'Change password', |
1164 | 1155 | 'resetpass_announce' => 'You logged in with a temporary e-mailed code. |
Index: branches/REL1_17/phase3/RELEASE-NOTES |
— | — | @@ -181,8 +181,6 @@ |
182 | 182 | ** When several pages are given the same sort key, they sort by their names |
183 | 183 | instead of randomly. |
184 | 184 | * (bug 23848) Add {{ARTICLEPATH}} Magic Word. |
185 | | -* JavaScript-based password complexity checker on account creation and |
186 | | - password change. |
187 | 185 | * The HTML ID's generated for sections are now much prettier when they contain |
188 | 186 | punctuation or non-English letters, so a section named "Hello?" will now |
189 | 187 | result in a URL ending in "#Hello?" rather than "#Hello.3F". |
Index: branches/REL1_17/phase3/resources/Resources.php |
— | — | @@ -460,11 +460,6 @@ |
461 | 461 | 'dependencies' => 'mediawiki.legacy.wikibits', |
462 | 462 | 'messages' => array( 'search-mwsuggest-enabled', 'search-mwsuggest-disabled' ), |
463 | 463 | ), |
464 | | - 'mediawiki.legacy.password' => array( |
465 | | - 'scripts' => 'skins/common/password.js', |
466 | | - 'styles' => 'skins/common/password.css', |
467 | | - 'dependencies' => 'mediawiki.legacy.wikibits', |
468 | | - ), |
469 | 464 | 'mediawiki.legacy.prefs' => array( |
470 | 465 | 'scripts' => 'skins/common/prefs.js', |
471 | 466 | 'dependencies' => array( 'mediawiki.legacy.wikibits', 'mediawiki.legacy.htmlform' ), |
Index: branches/REL1_17/phase3/maintenance/language/messages.inc |
— | — | @@ -468,15 +468,6 @@ |
469 | 469 | 'php-mail-error', |
470 | 470 | 'php-mail-error-unknown', |
471 | 471 | ), |
472 | | - 'passwordstrength' => array( |
473 | | - 'password-strength', |
474 | | - 'password-strength-bad', |
475 | | - 'password-strength-mediocre', |
476 | | - 'password-strength-acceptable', |
477 | | - 'password-strength-good', |
478 | | - 'password-retype', |
479 | | - 'password-retype-mismatch', |
480 | | - ), |
481 | 472 | 'resetpass' => array( |
482 | 473 | 'resetpass', |
483 | 474 | 'resetpass_announce', |
Index: branches/REL1_17/phase3/skins/common/password.css |
— | — | @@ -1,17 +0,0 @@ |
2 | | -span.mw-password-bad { |
3 | | - background: red; |
4 | | - color: yellow; |
5 | | - font-weight: bold; |
6 | | -} |
7 | | - |
8 | | -.mw-password-mediocre { |
9 | | - background: yellow; |
10 | | -} |
11 | | - |
12 | | -.mw-password-acceptable { |
13 | | - background: silver; |
14 | | -} |
15 | | - |
16 | | -.mw-password-good { |
17 | | - background: green; |
18 | | -} |
\ No newline at end of file |
Index: branches/REL1_17/phase3/skins/common/password.js |
— | — | @@ -1,131 +0,0 @@ |
2 | | -/** |
3 | | - * Password strength checker |
4 | | - * @license WTFPL 2.0 |
5 | | - * All scores are ranged approximately 0 (total disaster) - 100 (_looks_ great) |
6 | | - * @todo Check for popular passwords and keyboard sequences (QWERTY, etc) |
7 | | - */ |
8 | | - |
9 | | -// Estimates how hard it would be to pick the password using brute force |
10 | | -window.bruteForceComplexity = function( pwd ) { |
11 | | - var score = pwd.length * 5; |
12 | | - |
13 | | - var regexes = [ |
14 | | - /[a-z]/, |
15 | | - /[A-Z]/, |
16 | | - /[0-9]/, |
17 | | - /[-_;:\.,'"`~!@#$%\^&\*\(\)\[\]\{\} ]/ |
18 | | - ]; |
19 | | - |
20 | | - var charClasses = 0; |
21 | | - for ( var i=0; i< regexes.length; i++ ) { |
22 | | - if ( pwd.match( regexes[i] ) ) { |
23 | | - charClasses++; |
24 | | - } |
25 | | - } |
26 | | - |
27 | | - var matches = pwd.match( /[\x80-\uFFFF]/g ); |
28 | | - if ( matches ) { |
29 | | - charClasses++; |
30 | | - |
31 | | - var s = matches.join( '' ); |
32 | | - // poor man's isUpper() and isLower() |
33 | | - if ( s != s.toLowerCase() && s != s.toUpperCase() ) { |
34 | | - charClasses++; |
35 | | - } |
36 | | - } |
37 | | - score += ( charClasses - 1 ) * 10; |
38 | | - |
39 | | - return score; |
40 | | -}; |
41 | | - |
42 | | -// Calculates a penalty to brute force score due to character repetition |
43 | | -window.repetitionAdjustment = function( pwd ) { |
44 | | - var unique = ''; |
45 | | - for ( var i=0; i< pwd.length; i++ ) { |
46 | | - if ( unique.indexOf( pwd[i] ) < 0 ) { |
47 | | - unique += pwd[i]; |
48 | | - } |
49 | | - } |
50 | | - var ratio = pwd.length / unique.length - 0.4; // allow up to 40% repetition, reward for less, penalize for more |
51 | | - |
52 | | - return ratio * 10; |
53 | | -}; |
54 | | - |
55 | | -// Checks how many simple sequences ("abc", "321") are there in the password |
56 | | -window.sequenceScore = function( pwd ) { |
57 | | - pwd = pwd.concat( '\0' ); |
58 | | - var score = 100, sequence = 1; |
59 | | - for ( var i = 1; i < pwd.length; i++ ) { |
60 | | - if ( pwd.charCodeAt( i ) == pwd.charCodeAt(i - 1) + 1 ) { |
61 | | - sequence++; |
62 | | - } else { |
63 | | - if ( sequence > 2 ) { |
64 | | - score -= sequence * 7; |
65 | | - } |
66 | | - sequence = 1; |
67 | | - } |
68 | | - } |
69 | | - for ( var i = 1; i < pwd.length; i++ ) { |
70 | | - if ( pwd.charCodeAt( i ) == pwd.charCodeAt(i - 1) - 1 ) { |
71 | | - sequence++; |
72 | | - } else { |
73 | | - if ( sequence > 2 ) { |
74 | | - score -= Math.sqrt( sequence ) * 15; |
75 | | - } |
76 | | - sequence = 1; |
77 | | - } |
78 | | - } |
79 | | - return score; |
80 | | -}; |
81 | | - |
82 | | -(function( $ ) { |
83 | | - function passwordChanged() { |
84 | | - retypeChanged(); |
85 | | - var pwd = $( passwordSecurity.password ).val(); |
86 | | - if ( pwd == '' ) { |
87 | | - $( '#password-strength' ).html( '' ); |
88 | | - return; |
89 | | - } |
90 | | - if ( pwd.length > 100 ) pwd = pwd.slice( 0, 100 ); |
91 | | - var scores = [ |
92 | | - bruteForceComplexity( pwd ), |
93 | | - repetitionAdjustment( pwd ), |
94 | | - sequenceScore( pwd ) |
95 | | - ]; |
96 | | - |
97 | | - var score = Math.min( scores[0] - scores[1], scores[2] ); |
98 | | - var result = 'good'; |
99 | | - if ( score < 40 ) { |
100 | | - result = 'bad'; |
101 | | - } else if ( score < 60 ) { |
102 | | - result = 'mediocre'; |
103 | | - } else if ( score < 80 ) { |
104 | | - result = 'acceptable'; |
105 | | - } |
106 | | - var message = '<span class="mw-password-' + result + '">' + passwordSecurity.messages['password-strength-' + result] |
107 | | - + '</span>'; |
108 | | - $( '#password-strength' ).html( |
109 | | - passwordSecurity.messages['password-strength'].replace( '$1', message ) |
110 | | - //+ scores |
111 | | - ); |
112 | | - } |
113 | | - |
114 | | - function retypeChanged() { |
115 | | - var pwd = $( passwordSecurity.password ).val(); |
116 | | - var retype = $( passwordSecurity.retype ).val(); |
117 | | - var message; |
118 | | - if ( pwd == '' || pwd == retype ) { |
119 | | - message = ''; |
120 | | - } else if ( retype == '' ) { |
121 | | - message = passwordSecurity.messages['password-retype']; |
122 | | - } else { |
123 | | - message = passwordSecurity.messages['password-retype-mismatch']; |
124 | | - } |
125 | | - $( '#password-retype' ).html( message ); |
126 | | - } |
127 | | - |
128 | | - $( document ).ready( function() { |
129 | | - $( passwordSecurity.password ).bind( 'keyup change', passwordChanged ); |
130 | | - $( passwordSecurity.retype ).bind( 'keyup change', retypeChanged ); |
131 | | - }) |
132 | | -})(jQuery); |
Index: branches/REL1_17/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -959,10 +959,6 @@ |
960 | 960 | } |
961 | 961 | |
962 | 962 | if ( $this->mType == 'signup' ) { |
963 | | - global $wgLivePasswordStrengthChecks; |
964 | | - if ( $wgLivePasswordStrengthChecks ) { |
965 | | - $wgOut->addPasswordSecurity( 'wpPassword2', 'wpRetype' ); |
966 | | - } |
967 | 963 | $template = new UsercreateTemplate(); |
968 | 964 | $q = 'action=submitlogin&type=signup'; |
969 | 965 | $linkq = 'type=login'; |
Index: branches/REL1_17/phase3/includes/specials/SpecialResetpass.php |
— | — | @@ -106,11 +106,8 @@ |
107 | 107 | } |
108 | 108 | |
109 | 109 | function showForm() { |
110 | | - global $wgOut, $wgUser, $wgRequest, $wgLivePasswordStrengthChecks; |
| 110 | + global $wgOut, $wgUser, $wgRequest; |
111 | 111 | |
112 | | - if ( $wgLivePasswordStrengthChecks ) { |
113 | | - $wgOut->addPasswordSecurity( 'wpNewPassword', 'wpRetype' ); |
114 | | - } |
115 | 112 | $self = $this->getTitle(); |
116 | 113 | if ( !$this->mUserName ) { |
117 | 114 | $this->mUserName = $wgUser->getName(); |
— | — | @@ -146,10 +143,10 @@ |
147 | 144 | wfMsgExt( 'resetpass_text', array( 'parse' ) ) . "\n" . |
148 | 145 | Xml::openElement( 'table', array( 'id' => 'mw-resetpass-table' ) ) . "\n" . |
149 | 146 | $this->pretty( array( |
150 | | - array( 'wpName', 'username', 'text', $this->mUserName, '' ), |
151 | | - array( 'wpPassword', $oldpassMsg, 'password', $this->mOldpass, '' ), |
152 | | - array( 'wpNewPassword', 'newpassword', 'password', null, '<div id="password-strength"></div>' ), |
153 | | - array( 'wpRetype', 'retypenew', 'password', null, '<div id="password-retype"></div>' ), |
| 147 | + array( 'wpName', 'username', 'text', $this->mUserName ), |
| 148 | + array( 'wpPassword', $oldpassMsg, 'password', $this->mOldpass ), |
| 149 | + array( 'wpNewPassword', 'newpassword', 'password', null ), |
| 150 | + array( 'wpRetype', 'retypenew', 'password', null ), |
154 | 151 | ) ) . "\n" . |
155 | 152 | $rememberMe . |
156 | 153 | "<tr>\n" . |
— | — | @@ -168,7 +165,7 @@ |
169 | 166 | function pretty( $fields ) { |
170 | 167 | $out = ''; |
171 | 168 | foreach ( $fields as $list ) { |
172 | | - list( $name, $label, $type, $value, $extra ) = $list; |
| 169 | + list( $name, $label, $type, $value ) = $list; |
173 | 170 | if( $type == 'text' ) { |
174 | 171 | $field = htmlspecialchars( $value ); |
175 | 172 | } else { |
— | — | @@ -189,8 +186,9 @@ |
190 | 187 | else |
191 | 188 | $out .= wfMsgHtml( $label ); |
192 | 189 | $out .= "</td>\n"; |
193 | | - $out .= "\t<td class='mw-input'>$field</td>\n"; |
194 | | - $out .= "\t<td>$extra</td>\n"; |
| 190 | + $out .= "\t<td class='mw-input'>"; |
| 191 | + $out .= $field; |
| 192 | + $out .= "</td>\n"; |
195 | 193 | $out .= "</tr>"; |
196 | 194 | } |
197 | 195 | return $out; |
Index: branches/REL1_17/phase3/includes/OutputPage.php |
— | — | @@ -2088,27 +2088,6 @@ |
2089 | 2089 | } |
2090 | 2090 | } |
2091 | 2091 | |
2092 | | - /** |
2093 | | - * Adds JS-based password security checker |
2094 | | - * @param $passwordId String ID of input box containing password |
2095 | | - * @param $retypeId String ID of input box containing retyped password |
2096 | | - * @return none |
2097 | | - */ |
2098 | | - public function addPasswordSecurity( $passwordId, $retypeId ) { |
2099 | | - $data = array( |
2100 | | - 'password' => '#' . $passwordId, |
2101 | | - 'retype' => '#' . $retypeId, |
2102 | | - 'messages' => array(), |
2103 | | - ); |
2104 | | - foreach ( array( 'password-strength', 'password-strength-bad', 'password-strength-mediocre', |
2105 | | - 'password-strength-acceptable', 'password-strength-good', 'password-retype', 'password-retype-mismatch' |
2106 | | - ) as $message ) { |
2107 | | - $data['messages'][$message] = wfMsg( $message ); |
2108 | | - } |
2109 | | - $this->addScript( Html::inlineScript( 'var passwordSecurity=' . FormatJson::encode( $data ) ) ); |
2110 | | - $this->addModules( 'mediawiki.legacy.password' ); |
2111 | | - } |
2112 | | - |
2113 | 2092 | /** @deprecated */ |
2114 | 2093 | public function errorpage( $title, $msg ) { |
2115 | 2094 | wfDeprecated( __METHOD__ ); |
Index: branches/REL1_17/phase3/includes/templates/Userlogin.php |
— | — | @@ -198,7 +198,6 @@ |
199 | 199 | 'autofocus' |
200 | 200 | ) ); ?> |
201 | 201 | </td> |
202 | | - <td></td> |
203 | 202 | </tr> |
204 | 203 | <tr> |
205 | 204 | <td class="mw-label"><label for='wpPassword2'><?php $this->msg('yourpassword') ?></label></td> |
— | — | @@ -211,7 +210,6 @@ |
212 | 211 | 'size' => '20' |
213 | 212 | ) + User::passwordChangeInputAttribs() ); ?> |
214 | 213 | </td> |
215 | | - <td><div id="password-strength"></div></td> |
216 | 214 | </tr> |
217 | 215 | <?php if( $this->data['usedomain'] ) { |
218 | 216 | $doms = ""; |
— | — | @@ -227,7 +225,6 @@ |
228 | 226 | <?php echo $doms ?> |
229 | 227 | </select> |
230 | 228 | </td> |
231 | | - <td></td> |
232 | 229 | </tr> |
233 | 230 | <?php } ?> |
234 | 231 | <tr> |
— | — | @@ -241,7 +238,6 @@ |
242 | 239 | 'size' => '20' |
243 | 240 | ) + User::passwordChangeInputAttribs() ); ?> |
244 | 241 | </td> |
245 | | - <td><div id="password-retype"></div></td> |
246 | 242 | </tr> |
247 | 243 | <tr> |
248 | 244 | <?php if( $this->data['useemail'] ) { ?> |
— | — | @@ -262,13 +258,12 @@ |
263 | 259 | } ?> |
264 | 260 | </div> |
265 | 261 | </td> |
266 | | - <td></td> |
267 | 262 | <?php } ?> |
268 | 263 | <?php if( $this->data['userealname'] ) { ?> |
269 | 264 | </tr> |
270 | 265 | <tr> |
271 | 266 | <td class="mw-label"><label for='wpRealName'><?php $this->msg('yourrealname') ?></label></td> |
272 | | - <td class="mw-input" colspan="2"> |
| 267 | + <td class="mw-input"> |
273 | 268 | <input type='text' class='loginText' name="wpRealName" id="wpRealName" |
274 | 269 | tabindex="6" |
275 | 270 | value="<?php $this->text('realname') ?>" size='20' /> |
— | — | @@ -276,13 +271,12 @@ |
277 | 272 | <?php $this->msgWiki('prefs-help-realname'); ?> |
278 | 273 | </div> |
279 | 274 | </td> |
280 | | - <td></td> |
281 | 275 | <?php } ?> |
282 | 276 | <?php if( $this->data['usereason'] ) { ?> |
283 | 277 | </tr> |
284 | 278 | <tr> |
285 | 279 | <td class="mw-label"><label for='wpReason'><?php $this->msg('createaccountreason') ?></label></td> |
286 | | - <td class="mw-input" colspan="2"> |
| 280 | + <td class="mw-input"> |
287 | 281 | <input type='text' class='loginText' name="wpReason" id="wpReason" |
288 | 282 | tabindex="7" |
289 | 283 | value="<?php $this->text('reason') ?>" size='20' /> |
— | — | @@ -292,7 +286,7 @@ |
293 | 287 | <?php if( $this->data['canremember'] ) { ?> |
294 | 288 | <tr> |
295 | 289 | <td></td> |
296 | | - <td class="mw-input" colspan="2"> |
| 290 | + <td class="mw-input"> |
297 | 291 | <?php |
298 | 292 | global $wgCookieExpiration, $wgLang; |
299 | 293 | echo Xml::checkLabel( |
— | — | @@ -320,7 +314,7 @@ |
321 | 315 | ?><td><?php |
322 | 316 | } |
323 | 317 | ?></td> |
324 | | - <td class="mw-input" colspan="2"> |
| 318 | + <td class="mw-input"> |
325 | 319 | <input type="<?php echo htmlspecialchars( $inputItem['type'] ) ?>" name="<?php |
326 | 320 | echo htmlspecialchars( $inputItem['name'] ); ?>" |
327 | 321 | tabindex="<?php echo $tabIndex++; ?>" |
— | — | @@ -355,7 +349,7 @@ |
356 | 350 | ?> |
357 | 351 | <tr> |
358 | 352 | <td></td> |
359 | | - <td class="mw-submit" colspan="2"> |
| 353 | + <td class="mw-submit"> |
360 | 354 | <input type='submit' name="wpCreateaccount" id="wpCreateaccount" |
361 | 355 | tabindex="<?php echo $tabIndex++; ?>" |
362 | 356 | value="<?php $this->msg('createaccount') ?>" /> |