Changeset 160010
- Timestamp:
- 10/02/2009 07:41:59 PM (17 years ago)
- Location:
- limit-login-attempts
- Files:
-
- 30 added
- 4 edited
- 17 copied
-
tags/1.3.2 (copied) (copied from limit-login-attempts/tags/1.3.1)
-
tags/1.3.2/limit-login-attempts-bg_BG.mo (added)
-
tags/1.3.2/limit-login-attempts-bg_BG.po (added)
-
tags/1.3.2/limit-login-attempts-es_ES.mo (added)
-
tags/1.3.2/limit-login-attempts-es_ES.po (added)
-
tags/1.3.2/limit-login-attempts-fa_IR.mo (added)
-
tags/1.3.2/limit-login-attempts-fa_IR.po (added)
-
tags/1.3.2/limit-login-attempts-nb_NO.mo (added)
-
tags/1.3.2/limit-login-attempts-nb_NO.po (added)
-
tags/1.3.2/limit-login-attempts-ru_RU.mo (added)
-
tags/1.3.2/limit-login-attempts-ru_RU.po (added)
-
tags/1.3.2/limit-login-attempts.php (modified) (1 diff)
-
tags/1.3.2/readme.txt (modified) (3 diffs)
-
tags/2.0beta2 (copied) (copied from limit-login-attempts/trunk)
-
tags/2.0beta2/images (copied) (copied from limit-login-attempts/trunk/images)
-
tags/2.0beta2/limit-login-attempts-bg_BG.mo (added)
-
tags/2.0beta2/limit-login-attempts-bg_BG.po (added)
-
tags/2.0beta2/limit-login-attempts-ca.mo (copied) (copied from limit-login-attempts/trunk/limit-login-attempts-ca.mo)
-
tags/2.0beta2/limit-login-attempts-ca.po (copied) (copied from limit-login-attempts/trunk/limit-login-attempts-ca.po)
-
tags/2.0beta2/limit-login-attempts-de_DE.mo (copied) (copied from limit-login-attempts/trunk/limit-login-attempts-de_DE.mo)
-
tags/2.0beta2/limit-login-attempts-de_DE.po (copied) (copied from limit-login-attempts/trunk/limit-login-attempts-de_DE.po)
-
tags/2.0beta2/limit-login-attempts-es_ES.mo (added)
-
tags/2.0beta2/limit-login-attempts-es_ES.po (added)
-
tags/2.0beta2/limit-login-attempts-fa_IR.mo (added)
-
tags/2.0beta2/limit-login-attempts-fa_IR.po (added)
-
tags/2.0beta2/limit-login-attempts-nb_NO.mo (added)
-
tags/2.0beta2/limit-login-attempts-nb_NO.po (added)
-
tags/2.0beta2/limit-login-attempts-ro_RO.mo (copied) (copied from limit-login-attempts/trunk/limit-login-attempts-ro_RO.mo)
-
tags/2.0beta2/limit-login-attempts-ro_RO.po (copied) (copied from limit-login-attempts/trunk/limit-login-attempts-ro_RO.po)
-
tags/2.0beta2/limit-login-attempts-ru_RU.mo (added)
-
tags/2.0beta2/limit-login-attempts-ru_RU.po (added)
-
tags/2.0beta2/limit-login-attempts-sv_SE.mo (copied) (copied from limit-login-attempts/trunk/limit-login-attempts-sv_SE.mo)
-
tags/2.0beta2/limit-login-attempts-sv_SE.po (copied) (copied from limit-login-attempts/trunk/limit-login-attempts-sv_SE.po)
-
tags/2.0beta2/limit-login-attempts.php (copied) (copied from limit-login-attempts/trunk/limit-login-attempts.php) (7 diffs)
-
tags/2.0beta2/limit-login-attempts.pot (copied) (copied from limit-login-attempts/trunk/limit-login-attempts.pot)
-
tags/2.0beta2/readme.txt (copied) (copied from limit-login-attempts/trunk/readme.txt) (3 diffs)
-
tags/2.0beta2/screenshot-1.gif (copied) (copied from limit-login-attempts/trunk/screenshot-1.gif)
-
tags/2.0beta2/screenshot-3.gif (copied) (copied from limit-login-attempts/trunk/screenshot-3.gif)
-
tags/2.0beta2/screenshot-4.gif (copied) (copied from limit-login-attempts/trunk/screenshot-4.gif)
-
trunk/limit-login-attempts-bg_BG.mo (added)
-
trunk/limit-login-attempts-bg_BG.po (added)
-
trunk/limit-login-attempts-es_ES.mo (added)
-
trunk/limit-login-attempts-es_ES.po (added)
-
trunk/limit-login-attempts-fa_IR.mo (added)
-
trunk/limit-login-attempts-fa_IR.po (added)
-
trunk/limit-login-attempts-nb_NO.mo (added)
-
trunk/limit-login-attempts-nb_NO.po (added)
-
trunk/limit-login-attempts-ru_RU.mo (added)
-
trunk/limit-login-attempts-ru_RU.po (added)
-
trunk/limit-login-attempts.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
limit-login-attempts/tags/1.3.2/limit-login-attempts.php
r112192 r160010 6 6 Author: Johan Eenfeldt 7 7 Author URI: http://devel.kostdoktorn.se 8 Version: 1.3. 18 Version: 1.3.2 9 9 10 10 Copyright 2008, 2009 Johan Eenfeldt -
limit-login-attempts/tags/1.3.2/readme.txt
r112192 r160010 3 3 Tags: login, security, authentication 4 4 Requires at least: 2.5 5 Tested up to: 2. 7.16 Stable tag: 1.3. 15 Tested up to: 2.8.4 6 Stable tag: 1.3.2 7 7 8 8 Limit rate of login attempts, including by way of cookies, for each IP. … … 23 23 * Optional logging, optional email notification 24 24 * Handles server behind reverse proxy 25 26 Translations: Bulgarian, Catalan, German, Norwegian, Persian, Romanian, Russian, Spanish, Swedish 25 27 26 28 Plugin uses standard actions and filters only. … … 63 65 == Version History == 64 66 67 * Version 1.3.2 68 * Added Bulgarian translation, thanks to Hristo Chakarov 69 * Added Norwegian translation, thanks to Rune Gulbrandsøy 70 * Added Spanish translation, thanks to Marcelo Pedra 71 * Added Persian translation, thanks to Mostafa Soufi 72 * Added Russian translation, thanks to Jack Leonid (http://studio-xl.com) 65 73 * Version 1.3.1 66 74 * Added Catalan translation, thanks to Robert Buj -
limit-login-attempts/tags/2.0beta2/limit-login-attempts.php
r112269 r160010 79 79 80 80 /* Enforce limit on new user registrations for IP */ 81 , 'register_enforce' => false81 , 'register_enforce' => true 82 82 83 83 /* Allow this many new user registrations ... */ … … 88 88 89 89 /* Allow password reset using login name? */ 90 , 'disable_pwd_reset_username' => false90 , 'disable_pwd_reset_username' => true 91 91 92 92 /* ... for capability level_xx or higher */ … … 386 386 /* do the same for the registration arrays, if necessary */ 387 387 $valid = get_option('limit_login_registrations_valid'); 388 $re tries = get_option('limit_login_registrations');389 if (is_array($valid) && !empty($valid) && is_array($re tries) && !empty($retries)) {390 foreach ($valid as $ip => $ lockout) {391 if ($ lockout< $now) {388 $regs = get_option('limit_login_registrations'); 389 if (is_array($valid) && !empty($valid) && is_array($regs) && !empty($regs)) { 390 foreach ($valid as $ip => $until) { 391 if ($until < $now) { 392 392 unset($valid[$ip]); 393 unset($re tries[$ip]);393 unset($regs[$ip]); 394 394 } 395 395 } 396 396 397 /* go through re tries directly, if for some reason they've gone out of sync */398 foreach ($re tries as $ip => $retry) {397 /* go through registrations directly, if for some reason they've gone out of sync */ 398 foreach ($regs as $ip => $reg) { 399 399 if (!isset($valid[$ip])) { 400 unset($re tries[$ip]);400 unset($regs[$ip]); 401 401 } 402 402 } 403 403 404 update_option('limit_login_registrations', $re tries);404 update_option('limit_login_registrations', $regs); 405 405 update_option('limit_login_registrations_valid', $valid); 406 406 } … … 534 534 $limit = null; 535 535 536 /* What limit to use, if any */536 /* What limit (max privilege level) to use, if any */ 537 537 if (limit_login_option('disable_pwd_reset')) { 538 /* limit on all pwd resets */ 538 539 $limit = intval(limit_login_option('pwd_reset_limit')); 539 540 } 540 541 541 542 if (limit_login_option('disable_pwd_reset_username') && !strpos($_POST['user_login'], '@')) { 542 $limit2 = intval(limit_login_option('pwd_reset_username_limit')); 543 544 if (is_null($limit) || $limit > $limit2) { 545 $limit = $limit2; 543 /* limit on pwd reset using user name */ 544 $limit_username = intval(limit_login_option('pwd_reset_username_limit')); 545 546 if (is_null($limit) || $limit > $limit_username) { 547 $limit = $limit_username; 546 548 } 547 549 } … … 577 579 } 578 580 579 /* check if we are at the right nr to do notification */ 581 /* Check if we are at the right nr to do notification 582 * 583 * Todo: this always sends notification on long lockout (when $retries[$ip] 584 * is reset). 585 */ 580 586 if ( isset($retries[$ip]) 581 587 && ( ($retries[$ip] / limit_login_option('allowed_retries')) … … 998 1004 999 1005 1006 /* Remove space and - characters before comparing (because of how user_nicename 1007 * is constructed from user_login) */ 1008 function limit_login_fuzzy_cmp($s1, $s2) { 1009 $remove = array(' ', '-'); 1010 1011 return strcasecmp(str_replace($remove, '', $s1), str_replace($remove, '', $s2)); 1012 } 1013 1014 1000 1015 /* Show privileged users various names, and warn if equal to login name */ 1001 1016 function limit_login_show_users() { … … 1019 1034 $r = ''; 1020 1035 foreach ($users as $user) { 1021 $login_ok = strcasecmp($user->user_login, 'admin');1022 $display_ok = strcasecmp($user->user_login, $user->display_name);1023 $nicename_ok = strcasecmp($user->user_login, $user->user_nicename);1024 $nickname_ok = strcasecmp($user->user_login, $user->nickname);1036 $login_ok = limit_login_fuzzy_cmp($user->user_login, 'admin'); 1037 $display_ok = limit_login_fuzzy_cmp($user->user_login, $user->display_name); 1038 $nicename_ok = limit_login_fuzzy_cmp($user->user_login, $user->user_nicename); 1039 $nickname_ok = limit_login_fuzzy_cmp($user->user_login, $user->nickname); 1025 1040 1026 1041 if ($login_ok && $display_ok && $nicename_ok && $nickname_ok) { -
limit-login-attempts/tags/2.0beta2/readme.txt
r112213 r160010 3 3 Tags: login, security, authentication 4 4 Requires at least: 2.5 5 Tested up to: 2. 7.16 Stable tag: 1.3. 15 Tested up to: 2.8.4 6 Stable tag: 1.3.2 7 7 8 8 Limit rate of login attempts, including by way of cookies, for each IP. (BETA VERSION) … … 28 28 * Optional restriction on password reset attempts for privileged users, and rate limit new user registration 29 29 30 Translations: Bulgarian, Catalan, German, Norwegian, Persian, Romanian, Russian, Spanish, Swedish 31 30 32 Plugin uses standard actions and filters only. 31 33 … … 40 42 == Todo == 41 43 42 * There is no built in way to change user login name or nicename. 43 * Smarter matching vs login name 44 * There is no built in way to change user login name or nicename -- split to separate plugin? 44 45 * Translations 46 * Test vs. 2.5 47 * Keep two versions (1.x and 2.x)? 45 48 46 49 == Frequently Asked Questions == -
limit-login-attempts/trunk/limit-login-attempts.php
r112269 r160010 79 79 80 80 /* Enforce limit on new user registrations for IP */ 81 , 'register_enforce' => false81 , 'register_enforce' => true 82 82 83 83 /* Allow this many new user registrations ... */ … … 88 88 89 89 /* Allow password reset using login name? */ 90 , 'disable_pwd_reset_username' => false90 , 'disable_pwd_reset_username' => true 91 91 92 92 /* ... for capability level_xx or higher */ … … 386 386 /* do the same for the registration arrays, if necessary */ 387 387 $valid = get_option('limit_login_registrations_valid'); 388 $re tries = get_option('limit_login_registrations');389 if (is_array($valid) && !empty($valid) && is_array($re tries) && !empty($retries)) {390 foreach ($valid as $ip => $ lockout) {391 if ($ lockout< $now) {388 $regs = get_option('limit_login_registrations'); 389 if (is_array($valid) && !empty($valid) && is_array($regs) && !empty($regs)) { 390 foreach ($valid as $ip => $until) { 391 if ($until < $now) { 392 392 unset($valid[$ip]); 393 unset($re tries[$ip]);393 unset($regs[$ip]); 394 394 } 395 395 } 396 396 397 /* go through re tries directly, if for some reason they've gone out of sync */398 foreach ($re tries as $ip => $retry) {397 /* go through registrations directly, if for some reason they've gone out of sync */ 398 foreach ($regs as $ip => $reg) { 399 399 if (!isset($valid[$ip])) { 400 unset($re tries[$ip]);400 unset($regs[$ip]); 401 401 } 402 402 } 403 403 404 update_option('limit_login_registrations', $re tries);404 update_option('limit_login_registrations', $regs); 405 405 update_option('limit_login_registrations_valid', $valid); 406 406 } … … 534 534 $limit = null; 535 535 536 /* What limit to use, if any */536 /* What limit (max privilege level) to use, if any */ 537 537 if (limit_login_option('disable_pwd_reset')) { 538 /* limit on all pwd resets */ 538 539 $limit = intval(limit_login_option('pwd_reset_limit')); 539 540 } 540 541 541 542 if (limit_login_option('disable_pwd_reset_username') && !strpos($_POST['user_login'], '@')) { 542 $limit2 = intval(limit_login_option('pwd_reset_username_limit')); 543 544 if (is_null($limit) || $limit > $limit2) { 545 $limit = $limit2; 543 /* limit on pwd reset using user name */ 544 $limit_username = intval(limit_login_option('pwd_reset_username_limit')); 545 546 if (is_null($limit) || $limit > $limit_username) { 547 $limit = $limit_username; 546 548 } 547 549 } … … 577 579 } 578 580 579 /* check if we are at the right nr to do notification */ 581 /* Check if we are at the right nr to do notification 582 * 583 * Todo: this always sends notification on long lockout (when $retries[$ip] 584 * is reset). 585 */ 580 586 if ( isset($retries[$ip]) 581 587 && ( ($retries[$ip] / limit_login_option('allowed_retries')) … … 998 1004 999 1005 1006 /* Remove space and - characters before comparing (because of how user_nicename 1007 * is constructed from user_login) */ 1008 function limit_login_fuzzy_cmp($s1, $s2) { 1009 $remove = array(' ', '-'); 1010 1011 return strcasecmp(str_replace($remove, '', $s1), str_replace($remove, '', $s2)); 1012 } 1013 1014 1000 1015 /* Show privileged users various names, and warn if equal to login name */ 1001 1016 function limit_login_show_users() { … … 1019 1034 $r = ''; 1020 1035 foreach ($users as $user) { 1021 $login_ok = strcasecmp($user->user_login, 'admin');1022 $display_ok = strcasecmp($user->user_login, $user->display_name);1023 $nicename_ok = strcasecmp($user->user_login, $user->user_nicename);1024 $nickname_ok = strcasecmp($user->user_login, $user->nickname);1036 $login_ok = limit_login_fuzzy_cmp($user->user_login, 'admin'); 1037 $display_ok = limit_login_fuzzy_cmp($user->user_login, $user->display_name); 1038 $nicename_ok = limit_login_fuzzy_cmp($user->user_login, $user->user_nicename); 1039 $nickname_ok = limit_login_fuzzy_cmp($user->user_login, $user->nickname); 1025 1040 1026 1041 if ($login_ok && $display_ok && $nicename_ok && $nickname_ok) { -
limit-login-attempts/trunk/readme.txt
r112213 r160010 3 3 Tags: login, security, authentication 4 4 Requires at least: 2.5 5 Tested up to: 2. 7.16 Stable tag: 1.3. 15 Tested up to: 2.8.4 6 Stable tag: 1.3.2 7 7 8 8 Limit rate of login attempts, including by way of cookies, for each IP. (BETA VERSION) … … 28 28 * Optional restriction on password reset attempts for privileged users, and rate limit new user registration 29 29 30 Translations: Bulgarian, Catalan, German, Norwegian, Persian, Romanian, Russian, Spanish, Swedish 31 30 32 Plugin uses standard actions and filters only. 31 33 … … 40 42 == Todo == 41 43 42 * There is no built in way to change user login name or nicename. 43 * Smarter matching vs login name 44 * There is no built in way to change user login name or nicename -- split to separate plugin? 44 45 * Translations 46 * Test vs. 2.5 47 * Keep two versions (1.x and 2.x)? 45 48 46 49 == Frequently Asked Questions ==
Note: See TracChangeset
for help on using the changeset viewer.