Changeset 916385
- Timestamp:
- 05/18/2014 05:19:28 AM (12 years ago)
- Location:
- block-default-login-attempts/trunk
- Files:
-
- 2 edited
-
block-default-login-attempts.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
block-default-login-attempts/trunk/block-default-login-attempts.php
r916357 r916385 3 3 Plugin Name: Block Default Login Attempts 4 4 Description: Completely block default admin user login attempts in WordPress. 5 Version: 1. 2.25 Version: 1.3.0 6 6 Author: Ben Yates 7 7 Author URI: http://bayates.host-ed.me/wordpress/ … … 60 60 if (isset($_REQUEST['log']) and isset($_REQUEST['pwd'])) { 61 61 if ($_REQUEST['log'] == 'admin') { 62 $attempts = get_option('block_default_login_attempts', 0); 63 update_option('block_default_login_attempts', $attempts + 1); 62 64 bdla_write_log('Default login attempt IP: ' . $_SERVER['REMOTE_ADDR'] 63 65 . ', HTTP_X_FORWARDED_FOR: ' . $_SERVER['HTTP_X_FORWARDED_FOR'] … … 74 76 function bdla_auth_cookie_bad_username($cookie_elements) { 75 77 if ($cookie_elements['username'] == 'admin') { 78 $attempts = get_option('block_default_login_attempts', 0); 79 update_option('block_default_login_attempts', $attempts + 1); 76 80 bdla_write_log('Default login attempt (cookie) IP: ' . $_SERVER['REMOTE_ADDR'] 77 81 . ', HTTP_X_FORWARDED_FOR: ' . $_SERVER['HTTP_X_FORWARDED_FOR'] … … 105 109 } 106 110 111 if (!function_exists('bdla_activation')) { 112 function bdla_activation() { 113 add_option('block_default_login_attempts', 0, '', 'no'); 114 } 115 register_activation_hook(__FILE__, 'bdla_activation'); 116 } 117 118 if (!function_exists('bdla_plugin_row_meta')) { 119 function bdla_plugin_row_meta($links, $file) { 120 if (strpos($file, 'block-default-login-attempts.php') === false) return $links; 121 $attempts = get_option('block_default_login_attempts', 0); 122 if ($attempts) { 123 $links_new = array('<b>' . $attempts . '</b> attempts blocked'); 124 } else { 125 $links_new = array('No attempts encountered'); 126 } 127 $links = array_merge($links, $links_new); 128 return $links; 129 } 130 add_filter('plugin_row_meta', 'bdla_plugin_row_meta', 10, 2); 131 } 132 107 133 ?> -
block-default-login-attempts/trunk/readme.txt
r915974 r916385 32 32 33 33 1. A screenshot of a typical log entry 34 2. Block attempt counter
Note: See TracChangeset
for help on using the changeset viewer.