function antiddos_delete() { $appname = @mysql_escape_string($_REQUEST['appname']); if (!$appname) { die_(1, "'appname' is reruired"); } $retval = db_run_sql("delete from anti_ddos where appname='{$appname}'"); if ($retval === False) { die_(1, db_last_error()); } die_(0); }
header("Content-Type: application/json"); if ($status) { assert(is_string($message)); echo $rep = json_encode(array('code' => $status, 'message' => $message)); error_log("REQ: {$_SERVER['REQUEST_URI']} REP: {$rep}"); } else { echo json_encode(array('code' => 0, 'data' => $message)); } exit(0); } $mod = $_REQUEST['mod']; $action = str_replace('/', '_', $_REQUEST['action']); if (!$mod || !$action) { header("Location: /ui/index.php", True, 301); exit(0); } $mod_file = "{$API_ROOT}/{$mod}.mod.php"; if (!file_exists($mod_file)) { die_(1, 'api not found'); } require_once "{$API_ROOT}/config.php"; $func = "{$mod}_{$action}"; if (function_exists($func)) { die_(1, 'action not allowed'); } require $mod_file; if (function_exists($func)) { call_user_func($func); } else { die_(1, 'api not found'); }