Browse Source

Update sql_query_result.php

FusionPBX 6 years ago
parent
commit
46c04096ea
1 changed files with 13 additions and 1 deletions
  1. 13 1
      sql_query_result.php

+ 13 - 1
sql_query_result.php

@@ -47,7 +47,19 @@
 		require_once "sql_query_pdo.php";
 		require_once "sql_query_pdo.php";
 	}
 	}
 
 
-if (count($_POST)>0) {
+//set the variables
+	$code = trim($_REQUEST["code"]);
+//check the captcha
+	$command_authorized = false;
+	if (strtolower($_SESSION['captcha']) == strtolower($code)) {
+		$command_authorized = true;
+	}
+	if (!$command_authorized) {
+		//not authorized
+		exit;
+	}
+
+if (is_array($_POST)) {
 	$sql_type = trim($_POST["sql_type"]);
 	$sql_type = trim($_POST["sql_type"]);
 	$sql_cmd = trim($_POST["cmd"]);
 	$sql_cmd = trim($_POST["cmd"]);
 	$table_name = trim($_POST["table_name"]);
 	$table_name = trim($_POST["table_name"]);