| @@ -6,9 +6,9 @@ | ||
| 6 | 6 | class BVWatchCallback extends BVCallbackBase { |
| 7 | 7 | public $db; |
| 8 | 8 | public $settings; |
| 9 | 9 | |
| 10 | - const WATCH_WING_VERSION = 1.4; | |
| 10 | + const WATCH_WING_VERSION = 1.0; | |
| 11 | 11 | |
| 12 | 12 | public function __construct($callback_handler) { |
| 13 | 13 | $this->db = $callback_handler->db; |
| 14 | 14 | $this->settings = $callback_handler->settings; |
| @@ -79,41 +79,8 @@ | ||
| 79 | 79 | |
| 80 | 80 | return $result; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - public function getDomainInfo($params) { | |
| 84 | - $domain = $params["domain"]; | |
| 85 | - if (empty($domain)) { | |
| 86 | - return array('domainData' => "DOMAIN_NOT_PRESENT"); | |
| 87 | - } | |
| 88 | - | |
| 89 | - $whoisServer = $params["host"]; | |
| 90 | - if (empty($whoisServer)) { | |
| 91 | - return array('domainData' => "WHOIS_SERVER_NOT_PRESENT : $domain"); | |
| 92 | - } | |
| 93 | - | |
| 94 | - $conn = @fsockopen($whoisServer, $params["port"], $errno, $errstr, $params["timeout"]); | |
| 95 | - if (!$conn) { | |
| 96 | - return array('domainData' => "UNABLE_TO_CONNECT_TO_WHOIS_SERVER : $whoisServer : DOMAIN : $domain : ERROR : $errstr ($errno)"); | |
| 97 | - } | |
| 98 | - | |
| 99 | - try { | |
| 100 | - fwrite($conn, "$domain\r\n"); | |
| 101 | - | |
| 102 | - $response = ''; | |
| 103 | - while (!feof($conn)) { | |
| 104 | - $response .= fgets($conn, 1024); | |
| 105 | - } | |
| 106 | - | |
| 107 | - fclose($conn); | |
| 108 | - } catch (Exception $e) { | |
| 109 | - fclose($conn); | |
| 110 | - return array('domainData' => "ERROR_WHILE_FETCHING_DATA : " . $e->getMessage()); | |
| 111 | - } | |
| 112 | - | |
| 113 | - return array('domainData' => $response); | |
| 114 | - } | |
| 115 | - | |
| 116 | 83 | public function process($request) { |
| 117 | 84 | $db = $this->db; |
| 118 | 85 | $settings = $this->settings; |
| 119 | 86 | $this->setWatchTime(); |
| @@ -122,20 +89,16 @@ | ||
| 122 | 89 | switch ($request->method) { |
| 123 | 90 | case "getdata": |
| 124 | 91 | $resp = array(); |
| 125 | 92 | |
| 126 | - if (isset($params['domain_params']) && is_array($params['domain_params'])) { | |
| 127 | - $resp = array_merge($resp, $this->getDomainInfo($params['domain_params'])); | |
| 128 | - } | |
| 129 | - | |
| 130 | 93 | if (array_key_exists('lp', $params)) { |
| 131 | - require_once dirname( __FILE__ ) . '/../../protect/lp.php'; | |
| 94 | + require_once dirname( __FILE__ ) . '/../../protect/wp/lp/config.php'; | |
| 132 | 95 | $lp_params = $params['lp']; |
| 133 | - if (!isset($lp_params['bv_check_table']) || $db->isTablePresent($db->getBVTable(WPRProtectLP_V573::TABLE_NAME))) { | |
| 134 | - $limit = intval($lp_params['limit']); | |
| 135 | - $filter = $lp_params['filter']; | |
| 136 | - $db->deleteBVTableContent(WPRProtectLP_V573::TABLE_NAME, $lp_params['rmfilter']); | |
| 137 | - $table = $db->getBVTable(WPRProtectLP_V573::TABLE_NAME); | |
| 96 | + if (!isset($lp_params['bv_check_table']) || $db->isTablePresent($db->getBVTable(BVWPLPConfig::$requests_table))) { | |
| 97 | + $limit = intval(urldecode($lp_params['limit'])); | |
| 98 | + $filter = urldecode($lp_params['filter']); | |
| 99 | + $db->deleteBVTableContent(BVWPLPConfig::$requests_table, $lp_params['rmfilter']); | |
| 100 | + $table = $db->getBVTable(BVWPLPConfig::$requests_table); | |
| 138 | 101 | $resp["lplogs"] = $this->getData($table, $limit, $filter); |
| 139 | 102 | } else { |
| 140 | 103 | $resp["lplogs"] = array("status" => "TABLE_NOT_PRESENT"); |
| 141 | 104 | } |
| @@ -146,15 +109,15 @@ | ||
| 146 | 109 | $resp["prelog"] = $this->getFWPrependLog($prelog_params); |
| 147 | 110 | } |
| 148 | 111 | |
| 149 | 112 | if (array_key_exists('fw', $params)) { |
| 150 | - require_once dirname( __FILE__ ) . '/../../protect/fw.php'; | |
| 113 | + require_once dirname( __FILE__ ) . '/../../protect/fw/config.php'; | |
| 151 | 114 | $fw_params = $params['fw']; |
| 152 | - if (!isset($fw_params['bv_check_table']) || $db->isTablePresent($db->getBVTable(WPRProtectFW_V573::TABLE_NAME))) { | |
| 153 | - $limit = intval($fw_params['limit']); | |
| 154 | - $filter = $fw_params['filter']; | |
| 155 | - $db->deleteBVTableContent(WPRProtectFW_V573::TABLE_NAME, $fw_params['rmfilter']); | |
| 156 | - $table = $db->getBVTable(WPRProtectFW_V573::TABLE_NAME); | |
| 115 | + if (!isset($fw_params['bv_check_table']) || $db->isTablePresent($db->getBVTable(BVFWConfig::$requests_table))) { | |
| 116 | + $limit = intval(urldecode($fw_params['limit'])); | |
| 117 | + $filter = urldecode($fw_params['filter']); | |
| 118 | + $db->deleteBVTableContent(BVFWConfig::$requests_table, $fw_params['rmfilter']); | |
| 119 | + $table = $db->getBVTable(BVFWConfig::$requests_table); | |
| 157 | 120 | $resp["fwlogs"] = $this->getData($table, $limit, $filter); |
| 158 | 121 | } else { |
| 159 | 122 | $resp["fwlogs"] = array("status" => "TABLE_NOT_PRESENT"); |
| 160 | 123 | } |
| @@ -164,10 +127,10 @@ | ||
| 164 | 127 | require_once dirname( __FILE__ ) . '/../../wp_dynsync.php'; |
| 165 | 128 | $isdynsyncactive = $settings->getOption('bvDynSyncActive'); |
| 166 | 129 | if ($isdynsyncactive == 'yes') { |
| 167 | 130 | if (!isset($params['bv_check_table']) || $db->isTablePresent($db->getBVTable(BVWPDynSync::$dynsync_table))) { |
| 168 | - $limit = intval($params['limit']); | |
| 169 | - $filter = $params['filter']; | |
| 131 | + $limit = intval(urldecode($params['limit'])); | |
| 132 | + $filter = urldecode($params['filter']); | |
| 170 | 133 | $this->deleteBvDynamicEvents($params['rmfilter']); |
| 171 | 134 | $table = $db->getBVTable(BVWPDynSync::$dynsync_table); |
| 172 | 135 | $data = $this->getData($table, $limit, $filter); |
| 173 | 136 | $resp['last_id'] = $data['last_id']; |
| @@ -181,10 +144,10 @@ | ||
| 181 | 144 | if (array_key_exists('actlog', $params)) { |
| 182 | 145 | require_once dirname( __FILE__ ) . '/../../wp_actlog.php'; |
| 183 | 146 | $actlog_params = $params['actlog']; |
| 184 | 147 | if (!isset($actlog_params['bv_check_table']) || $db->isTablePresent($db->getBVTable(BVWPActLog::$actlog_table))) { |
| 185 | - $limit = intval($actlog_params['limit']); | |
| 186 | - $filter = $actlog_params['filter']; | |
| 148 | + $limit = intval(urldecode($actlog_params['limit'])); | |
| 149 | + $filter = urldecode($actlog_params['filter']); | |
| 187 | 150 | $db->deleteBVTableContent(BVWPActLog::$actlog_table, $actlog_params['rmfilter']); |
| 188 | 151 | $table = $db->getBVTable(BVWPActLog::$actlog_table); |
| 189 | 152 | $resp["actlogs"] = $this->getData($table, $limit, $filter); |
| 190 | 153 | } else { |
| @@ -191,41 +154,13 @@ | ||
| 191 | 154 | $resp["actlogs"] = array("status" => "TABLE_NOT_PRESENT"); |
| 192 | 155 | } |
| 193 | 156 | } |
| 194 | 157 | |
| 195 | - if (array_key_exists('airlift_stats', $params)) { | |
| 196 | - $airlift_stats_table = "airlift_stats"; | |
| 197 | - $airlift_stats_params = $params['airlift_stats']; | |
| 198 | - $table = $db->getBVTable($airlift_stats_table); | |
| 199 | - if (!isset($airlift_stats_params['bv_check_table']) || $db->isTablePresent($table)) { | |
| 200 | - $limit = intval($airlift_stats_params['limit']); | |
| 201 | - $filter = $airlift_stats_params['filter']; | |
| 202 | - $db->deleteBVTableContent($airlift_stats_table, $airlift_stats_params['rmfilter']); | |
| 203 | - $resp["airlift_stats"] = $this->getData($table, $limit, $filter); | |
| 204 | - } else { | |
| 205 | - $resp["airlift_stats"] = array("status" => "TABLE_NOT_PRESENT"); | |
| 206 | - } | |
| 207 | - } | |
| 208 | - | |
| 209 | - if (array_key_exists('php_error_monitoring', $params)) { | |
| 210 | - require_once dirname( __FILE__ ) . '/../../php_error_monitoring/monitoring.php'; | |
| 211 | - $php_error_monit_params = $params['php_error_monitoring']; | |
| 212 | - $table = $db->getBVTable(WPRWPPHPErrorMonitoring::ERROR_TABLE); | |
| 213 | - if (!isset($php_error_monit_params['bv_check_table']) || $db->isTablePresent($table)) { | |
| 214 | - $limit = intval($php_error_monit_params['limit']); | |
| 215 | - $filter = $php_error_monit_params['filter']; | |
| 216 | - $db->deleteBVTableContent(WPRWPPHPErrorMonitoring::ERROR_TABLE, $php_error_monit_params['rmfilter']); | |
| 217 | - $resp["php_error_monitoring"] = $this->getData($table, $limit, $filter); | |
| 218 | - } else { | |
| 219 | - $resp["php_error_monitoring"] = array("status" => "TABLE_NOT_PRESENT"); | |
| 220 | - } | |
| 221 | - } | |
| 222 | - | |
| 223 | 158 | $resp["status"] = "done"; |
| 224 | 159 | break; |
| 225 | 160 | case "rmdata": |
| 226 | 161 | require_once dirname( __FILE__ ) . '/../../wp_dynsync.php'; |
| 227 | - $filter = $params['filter']; | |
| 162 | + $filter = urldecode($params['filter']); | |
| 228 | 163 | $resp = array("status" => $this->deleteBvDynamicEvents($filter)); |
| 229 | 164 | break; |
| 230 | 165 | default: |
| 231 | 166 | $resp = false; |