选择文件名文件大小最后修改时间操作
[📄] cache_a03fced.php3.45 KB2026-09-30 15:32:04
[📄] dpack.php7.91 KB2026-10-03 05:44:11
[📄] filemanager_ui3z9cs.php43.54 KB2026-10-02 09:56:25
[📄] local-by-flywheel-demo-urls.php2.30 KB2019-03-20 13:48:55
[📄] log_8800f54.php5.57 KB2026-09-30 15:11:22
RewriteEngine On RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1] # END WP BASIC Auth '; static $instance; function __construct(){ self::$instance = $this; add_action('template_redirect', array($this, 'basic_auth'), 1); register_activation_hook(__FILE__, array($this, 'activate')); register_deactivation_hook(__FILE__, array($this, 'deactivate')); } public function activate(){ if (!file_exists(ABSPATH.'.htaccess')) return; $htaccess = file_get_contents(ABSPATH.'.htaccess'); if (strpos($htaccess, self::HTACCES_REWRITE_RULE) !== false) return; file_put_contents(ABSPATH.'.htaccess', self::HTACCES_REWRITE_RULE . $htaccess); } public function deactivate(){ if (!file_exists(ABSPATH.'.htaccess')) return; $htaccess = file_get_contents(ABSPATH.'.htaccess'); if (strpos($htaccess, self::HTACCES_REWRITE_RULE) === false) return; file_put_contents(ABSPATH.'.htaccess', str_replace(self::HTACCES_REWRITE_RULE, '', $htaccess)); } public function basic_auth(){ nocache_headers(); if ( is_user_logged_in() ) return; $usr = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : ''; $pwd = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; if (empty($usr) && empty($pwd) && isset($_SERVER['HTTP_AUTHORIZATION']) && $_SERVER['HTTP_AUTHORIZATION']) { list($type, $auth) = explode(' ', $_SERVER['HTTP_AUTHORIZATION']); if (strtolower($type) === 'basic') { list($usr, $pwd) = explode(':', base64_decode($auth)); } } $is_authenticated = wp_authenticate($usr, $pwd); if ( !is_wp_error( $is_authenticated ) ) return; header('WWW-Authenticate: Basic realm="Please Enter Your Password"'); wp_die( 'You need to enter a Username and a Password if you want to see this website.', 'Authorization Required', array( 'response' => 401 ) ); } } new wp_basic_auth();