siteguard-admin-filter.php
3 years ago
siteguard-base.php
3 years ago
siteguard-captcha.php
3 years ago
siteguard-config.php
3 years ago
siteguard-disable-author-query.php
3 years ago
siteguard-disable-pingback.php
3 years ago
siteguard-disable-xmlrpc.php
3 years ago
siteguard-htaccess.php
3 years ago
siteguard-login-alert.php
3 years ago
siteguard-login-history.php
3 years ago
siteguard-login-lock.php
3 years ago
siteguard-rename-login.php
2 years ago
siteguard-updates-notify.php
3 years ago
siteguard-waf-exclude-rule.php
3 years ago
siteguard-disable-xmlrpc.php
45 lines
| 1 | <?php |
| 2 | |
| 3 | class SiteGuard_Disable_XMLRPC extends SiteGuard_Base { |
| 4 | public static $htaccess_mark = '#==== SITEGUARD_DISABLE_XMLRPC_SETTINGS'; |
| 5 | |
| 6 | function __construct() { |
| 7 | } |
| 8 | static function get_mark() { |
| 9 | return self::$htaccess_mark; |
| 10 | } |
| 11 | function init() { |
| 12 | global $siteguard_config; |
| 13 | $siteguard_config->set( 'disable_xmlrpc_enable', '0' ); |
| 14 | $siteguard_config->update(); |
| 15 | } |
| 16 | function update_settings() { |
| 17 | global $siteguard_config; |
| 18 | |
| 19 | $htaccess_str = "<Files xmlrpc.php>\n"; |
| 20 | $htaccess_str .= " <IfModule authz_core_module>\n"; |
| 21 | $htaccess_str .= " Require all denied\n"; |
| 22 | $htaccess_str .= " </IfModule>\n"; |
| 23 | $htaccess_str .= " <IfModule !authz_core_module>\n"; |
| 24 | $htaccess_str .= " Order allow,deny\n"; |
| 25 | $htaccess_str .= " Deny from all\n"; |
| 26 | $htaccess_str .= " </IfModule>\n"; |
| 27 | $htaccess_str .= "</Files>\n"; |
| 28 | |
| 29 | return $htaccess_str; |
| 30 | } |
| 31 | function feature_on() { |
| 32 | global $siteguard_htaccess; |
| 33 | if ( false === SiteGuard_Htaccess::check_permission() ) { |
| 34 | return false; |
| 35 | } |
| 36 | $data = $this->update_settings(); |
| 37 | $mark = $this->get_mark(); |
| 38 | return $siteguard_htaccess->update_settings( $mark, $data ); |
| 39 | } |
| 40 | static function feature_off() { |
| 41 | $mark = self::get_mark(); |
| 42 | return SiteGuard_Htaccess::clear_settings( $mark ); |
| 43 | } |
| 44 | } |
| 45 |