Browse Source

Add sql column names and cast user_setting_enabled as text

FusionPBX 5 years ago
parent
commit
41e959cae2
1 changed files with 7 additions and 5 deletions
  1. 7 5
      core/user_settings/user_setting_edit.php

+ 7 - 5
core/user_settings/user_setting_edit.php

@@ -317,13 +317,15 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
 }
 
 //pre-populate the form
-	if (is_uuid($_GET["id"]) && count($_GET)>0 && $_POST["persistformvar"] != "true") {
+	if (is_uuid($_GET["id"]) && count($_GET) > 0 && $_POST["persistformvar"] != "true") {
 		$user_setting_uuid = $_GET["id"];
+		$sql = "select user_setting_category, user_setting_subcategory, user_setting_name, user_setting_value, cast(user_setting_enabled as text), user_setting_description ";
 		$sql = "select * from v_user_settings ";
-		$sql .= "where user_uuid = :user_uuid ";
-		$sql .= "and user_setting_uuid = :user_setting_uuid ";
-		$parameters['user_uuid'] = $user_uuid;
+		$sql .= "from v_user_settings ";
+		$sql .= "where user_setting_uuid = :user_setting_uuid ";
+		$sql .= "and user_uuid = :user_uuid ";
 		$parameters['user_setting_uuid'] = $user_setting_uuid;
+		$parameters['user_uuid'] = $user_uuid;
 		$database = new database;
 		$row = $database->select($sql, $parameters, 'row');
 		if (is_array($row) && sizeof($row) != 0) {
@@ -764,4 +766,4 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
 //include the footer
 	require_once "resources/footer.php";
 
-?>
+?>