Changeset 615063
- Timestamp:
- 10/20/2012 10:55:11 PM (13 years ago)
- Location:
- login-security-solution/trunk
- Files:
-
- 7 edited
-
languages/login-security-solution-fr_FR.mo (modified) (previous)
-
languages/login-security-solution-pt_BR.mo (modified) (previous)
-
languages/login-security-solution.pot (modified) (1 diff)
-
login-security-solution.php (modified) (7 diffs)
-
readme.txt (modified) (1 diff)
-
tests/LoginFailTest.php (modified) (1 diff)
-
tests/VerifiedIpTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
login-security-solution/trunk/languages/login-security-solution.pot
r613877 r615063 467 467 #: login-security-solution.php:1863 468 468 msgid "" 469 " WARNING: The '%s' setting you chose means this person has NOT been logged"470 " out and will NOT be required to confirm their identity."469 "The user has been logged out and will be required to confirm their identity " 470 "via the password reset functionality." 471 471 msgstr "" 472 472 -
login-security-solution/trunk/login-security-solution.php
r613877 r615063 7 7 * 8 8 * Plugin URI: http://wordpress.org/extend/plugins/login-security-solution/ 9 * Version: 0.3 3.09 * Version: 0.34.0 10 10 * (Remember to change the VERSION constant, below, as well!) 11 11 * Author: Daniel Convissor … … 43 43 * This plugin's version 44 44 */ 45 const VERSION = '0.3 3.0';45 const VERSION = '0.34.0'; 46 46 47 47 /** … … 502 502 */ 503 503 public function login_errors($out = '') { 504 global $errors, $ user_name;504 global $errors, $wp_error, $user_name; 505 505 506 506 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'register') { … … 510 510 } 511 511 512 $error_codes = $errors->get_error_codes(); 512 if (is_wp_error($errors)) { 513 $error_codes = $errors->get_error_codes(); 514 } elseif (is_wp_error($wp_error)) { 515 $error_codes = $wp_error->get_error_codes(); 516 } else { 517 return $out; 518 } 513 519 514 520 $codes_to_cloak = array('incorrect_password', 'invalid_username'); … … 1233 1239 1234 1240 /** 1241 * Determines if PHP's exec() function is usable 1242 * @return bool 1243 */ 1244 protected function is_exec_available() { 1245 static $available; 1246 1247 if (!isset($available)) { 1248 $available = true; 1249 if (ini_get('safe_mode')) { 1250 $available = false; 1251 } else { 1252 $d = ini_get('disable_functions'); 1253 $s = ini_get('suhosin.executor.func.blacklist'); 1254 if ("$d$s") { 1255 $array = preg_split('/,\s*/', "$d,$s"); 1256 if (in_array('exec', $array)) { 1257 $available = false; 1258 } 1259 } 1260 } 1261 } 1262 1263 return $available; 1264 } 1265 1266 /** 1235 1267 * Examines how long ago the current user last interacted with the 1236 1268 * site and takes appropriate action … … 1307 1339 } 1308 1340 1341 if (!$this->is_exec_available()) { 1342 $this->available_dict = false; 1343 return null; 1344 } 1345 1309 1346 $term = escapeshellarg($pw); 1310 1347 exec("dict -m -s exact $term 2>&1", $output, $result); … … 1377 1414 protected function is_pw_dictionary__grep($pw) { 1378 1415 if ($this->available_grep === false) { 1416 return null; 1417 } 1418 1419 if (!$this->is_exec_available()) { 1420 $this->available_grep = false; 1379 1421 return null; 1380 1422 } -
login-security-solution/trunk/readme.txt
r613877 r615063 412 412 413 413 == Changelog == 414 415 = 0.34.0 (2012-10-21) = 416 * Have `login_errors` filter check `$wp_error` also, not just `$errors.` 417 * Skip `exec()` calls if `safe_mode` is on. 414 418 415 419 = 0.33.0 (2012-10-18) = -
login-security-solution/trunk/tests/LoginFailTest.php
r613877 r615063 215 215 216 216 /** 217 * @depends test_process_login_fail__pre_threshold 218 */ 219 public function test_process_login_fail__post_threshold_not_modulus() { 220 global $wpdb; 221 222 $wpdb->query('SAVEPOINT pre_not_modulus'); 223 224 try { 225 // Do THE deed. 226 $sleep = self::$lss->process_login_fail($this->user_name, __FUNCTION__); 227 // Count is now 5. 228 } catch (Exception $e) { 229 $this->fail($e->getMessage()); 230 } 231 $this->assertGreaterThan(0, $sleep, 'Sleep was not set.'); 232 } 233 234 /** 235 * @depends test_process_login_fail__post_threshold_not_modulus 236 */ 237 public function test_process_login_fail__post_threshold_multiple_on() { 238 global $wpdb; 239 240 $wpdb->query('SAVEPOINT pre_multiple'); 241 242 self::$mail_file_basename = __METHOD__; 243 244 $options = self::$lss->options; 245 $options['login_fail_notify'] = 2; 246 $options['login_fail_notify_multiple'] = 1; 247 self::$lss->options = $options; 248 249 try { 250 // Do THE deed. 251 $sleep = self::$lss->process_login_fail($this->user_name, __FUNCTION__); 252 // Count is now 6. 253 } catch (Exception $e) { 254 $this->fail($e->getMessage()); 255 } 256 257 $this->check_mail_file(); 258 $this->assertGreaterThan(0, $sleep, 'Sleep was not set.'); 259 260 $wpdb->query('ROLLBACK TO pre_multiple'); 261 // Count is now 5. 262 } 263 264 /** 265 * @depends test_process_login_fail__post_threshold_multiple_on 266 */ 267 public function test_process_login_fail__post_threshold_multiple_off() { 268 global $wpdb; 269 270 $options = self::$lss->options; 271 $options['login_fail_notify'] = 2; 272 self::$lss->options = $options; 273 274 try { 275 // Do THE deed. 276 $sleep = self::$lss->process_login_fail($this->user_name, __FUNCTION__); 277 // Count is now 6. 278 } catch (Exception $e) { 279 $this->fail($e->getMessage()); 280 } 281 $this->assertGreaterThan(0, $sleep, 'Sleep was not set.'); 282 283 $wpdb->query('ROLLBACK TO pre_not_modulus'); 284 } 285 286 /** 287 * @depends test_process_login_fail__post_threshold_multiple_off 217 * @depends test_process_login_fail__post_threshold 288 218 */ 289 219 public function test_process_login_fail__post_threshold_force_change_off() { -
login-security-solution/trunk/tests/VerifiedIpTest.php
r607720 r615063 79 79 80 80 $wpdb->query('ROLLBACK TO empty'); 81 wp_cache_ flush();81 wp_cache_init(); 82 82 83 83 $actual = self::$lss->get_verified_ips($this->user->ID); … … 108 108 109 109 $wpdb->query('ROLLBACK TO empty'); 110 wp_cache_ flush();110 wp_cache_init(); 111 111 } 112 112 … … 128 128 129 129 $wpdb->query('ROLLBACK TO empty'); 130 wp_cache_ flush();130 wp_cache_init(); 131 131 } 132 132
Note: See TracChangeset
for help on using the changeset viewer.