| @@ -46,23 +46,23 @@ | ||
| 46 | 46 | 'update_enabled_user_enums' => 'update_enabled_user_enums', |
| 47 | 47 | 'check_xml_rpc' => 'check_xml_rpc', |
| 48 | 48 | ), |
| 49 | 49 | 'ip_lockout' => array( |
| 50 | - 'update_settings' => 'save_settings', | |
| 51 | - 'download_geo_db' => 'download_geo_db', | |
| 52 | - 'import_ips' => 'import_ips', | |
| 53 | - 'get_listed_ips' => 'get_listed_ips', | |
| 54 | - 'query_locked_ips' => 'query_locked_ips', | |
| 55 | - 'ip_action' => 'ip_action', | |
| 56 | - 'export_ips' => 'export_ips', | |
| 57 | - 'empty_logs' => 'empty_logs', | |
| 58 | - 'dashboard_activation' => 'dashboard_activation', | |
| 59 | - 'import_ua' => 'import_ua', | |
| 60 | - 'export_ua' => 'export_ua', | |
| 61 | - 'empty_lockouts' => 'empty_lockouts', | |
| 62 | - 'verify_blocked_user' => array( 'verify_blocked_user', true ), | |
| 63 | - 'send_again' => array( 'send_again', true ), | |
| 64 | - 'agf_unlock_user' => array( 'agf_unlock_user', true ), | |
| 50 | + 'update_settings' => 'save_settings', | |
| 51 | + 'download_geo_db' => 'download_geo_db', | |
| 52 | + 'import_ips' => 'import_ips', | |
| 53 | + 'get_listed_ips' => 'get_listed_ips', | |
| 54 | + 'query_locked_ips' => 'query_locked_ips', | |
| 55 | + 'ip_action' => 'ip_action', | |
| 56 | + 'export_ips' => 'export_ips', | |
| 57 | + 'empty_logs' => 'empty_logs', | |
| 58 | + 'toggle_lockout_modules' => 'toggle_lockout_modules', | |
| 59 | + 'import_ua' => 'import_ua', | |
| 60 | + 'export_ua' => 'export_ua', | |
| 61 | + 'empty_lockouts' => 'empty_lockouts', | |
| 62 | + 'verify_blocked_user' => array( 'verify_blocked_user', true ), | |
| 63 | + 'send_again' => array( 'send_again', true ), | |
| 64 | + 'agf_unlock_user' => array( 'agf_unlock_user', true ), | |
| 65 | 65 | ), |
| 66 | 66 | 'global_ip_lockout' => array( |
| 67 | 67 | 'refresh_global_ip_list' => 'refresh_global_ip_list', |
| 68 | 68 | 'redirect_hub_connection' => 'redirect_hub_connection', |
| @@ -75,14 +75,8 @@ | ||
| 75 | 75 | 'item_action' => 'item_action', |
| 76 | 76 | 'update_settings' => 'save_settings', |
| 77 | 77 | 'bulk_action' => 'bulk_action', |
| 78 | 78 | ), |
| 79 | - 'audit' => array( | |
| 80 | - 'update_settings' => 'save_settings', | |
| 81 | - 'pull_logs' => 'pull_logs', | |
| 82 | - 'summary' => 'summary', | |
| 83 | - 'export_as_csv' => 'export_as_csv', | |
| 84 | - ), | |
| 85 | 79 | 'notification' => array( |
| 86 | 80 | 'get_users' => 'get_users', |
| 87 | 81 | 'save_notification' => 'save_notification', |
| 88 | 82 | 'unscubscribe' => 'unsubscribe', |
| @@ -103,20 +97,8 @@ | ||
| 103 | 97 | 'settings' => array( |
| 104 | 98 | 'update_settings' => 'save_settings', |
| 105 | 99 | 'reset_settings' => 'reset_settings', |
| 106 | 100 | ), |
| 107 | - 'waf' => array( | |
| 108 | - 'recheck' => 'recheck', | |
| 109 | - ), | |
| 110 | - 'onboard' => array( | |
| 111 | - 'activating' => 'activating', | |
| 112 | - 'skip' => 'skip', | |
| 113 | - 'antibot_reminder' => 'antibot_reminder', | |
| 114 | - ), | |
| 115 | - 'blocklist_monitor' => array( | |
| 116 | - 'blacklist_status' => 'blacklist_status', | |
| 117 | - 'toggle_blacklist_status' => 'toggle_blacklist_status', | |
| 118 | - ), | |
| 119 | 101 | 'tracking' => array( |
| 120 | 102 | 'close_track_modal' => 'close_track_modal', |
| 121 | 103 | 'save_track_modal' => 'save_track_modal', |
| 122 | 104 | ), |
| @@ -127,19 +109,27 @@ | ||
| 127 | 109 | 'postpone_notice' => 'postpone_notice', |
| 128 | 110 | 'refuse_notice' => 'refuse_notice', |
| 129 | 111 | 'handle_notice' => 'handle_notice', |
| 130 | 112 | ), |
| 131 | - ); | |
| 132 | - | |
| 133 | - if ( class_exists( 'WP_Defender\Controller\Quarantine' ) ) { | |
| 134 | - $routes['quarantine'] = array( | |
| 113 | + 'blocklist_monitor' => array( | |
| 114 | + 'blacklist_status' => 'blacklist_status', | |
| 115 | + 'toggle_blacklist_status' => 'toggle_blacklist_status', | |
| 116 | + ), | |
| 117 | + 'activity_log' => array( | |
| 118 | + 'add_notification' => 'add_notification', | |
| 119 | + 'fetch_notifications' => 'fetch_notifications', | |
| 120 | + ), | |
| 121 | + 'quarantine' => array( | |
| 135 | 122 | 'restore_file' => 'restore_file', |
| 136 | 123 | 'quarantine_collection' => 'quarantine_collection', |
| 137 | 124 | 'delete_file' => 'delete_file', |
| 138 | - ); | |
| 139 | - } | |
| 140 | - | |
| 125 | + ), | |
| 126 | + ); | |
| 141 | 127 | foreach ( $routes as $module => $info ) { |
| 128 | + $controller = Array_Cache::get( $module ); | |
| 129 | + if ( null === $controller ) { | |
| 130 | + continue; | |
| 131 | + } | |
| 142 | 132 | foreach ( $info as $name => $func ) { |
| 143 | 133 | $nopriv = false; |
| 144 | 134 | if ( is_array( $func ) ) { |
| 145 | 135 | [ $func, $nopriv ] = $func; |
| @@ -147,12 +137,9 @@ | ||
| 147 | 137 | Route::register_route( |
| 148 | 138 | $name, |
| 149 | 139 | $module, |
| 150 | 140 | $name, |
| 151 | - array( | |
| 152 | - Array_Cache::get( $module ), | |
| 153 | - $func, | |
| 154 | - ), | |
| 141 | + array( $controller, $func ), | |
| 155 | 142 | $nopriv |
| 156 | 143 | ); |
| 157 | 144 | } |
| 158 | 145 | } |