| @@ -59,8 +59,11 @@ | ||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function do_exit($admin_area = false) { |
| 62 | 62 | |
| 63 | + if (in_array($_SERVER['REMOTE_ADDR'], $this->getWhiteList())) { | |
| 64 | + return; | |
| 65 | + } | |
| 63 | 66 | $this->basic_auth_action_failed_access(); |
| 64 | 67 | do_action('basic_auth_before_401'); |
| 65 | 68 | |
| 66 | 69 | if($admin_area) { |
| @@ -73,8 +76,12 @@ | ||
| 73 | 76 | header( 'HTTP/1.1 401 Unauthorized' ); |
| 74 | 77 | header( 'WWW-Authenticate: Basic realm="Admin Area"' ); |
| 75 | 78 | exit; |
| 76 | 79 | } |
| 80 | + } | |
| 81 | + | |
| 82 | + public function getWhiteList() { | |
| 83 | + return get_option( 'basic_auth_plugin_whitelist' )?explode(',',get_option( 'basic_auth_plugin_whitelist' )):[]; | |
| 77 | 84 | } |
| 78 | 85 | |
| 79 | 86 | public function basic_auth_plugin_menu() { |
| 80 | 87 | add_menu_page( |