mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Unset the prepared statements used in the app_defaults.php files.
This commit is contained in:
@@ -125,6 +125,7 @@
|
||||
$db->query($sql);
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +154,7 @@
|
||||
$db->query($sql);
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $result);
|
||||
}
|
||||
unset($prep_statement, $result);
|
||||
|
||||
//move the dynamic provision variables that from v_vars table to v_default_settings
|
||||
if (count($_SESSION['provision']) == 0 && $domains_processed == 1) {
|
||||
@@ -86,6 +86,7 @@
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement);
|
||||
//delete the provision variables from system -> variables
|
||||
//$sql = "delete from v_vars ";
|
||||
//$sql .= "where var_cat = 'Provision' ";
|
||||
|
||||
@@ -31,6 +31,7 @@ if (count($_SESSION['email']) == 0 && $domains_processed == 1) {
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_NAMED);
|
||||
unset($prep_statement);
|
||||
//set the variable
|
||||
$smtp[]['smtp_host'] = check_str($row['smtp_host']);
|
||||
$smtp[]['smtp_secure'] = check_str($row['smtp_secure']);
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($prep_statement);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,8 +108,8 @@ EOD;
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
unset($prep_statement, $result);
|
||||
}
|
||||
unset($prep_statement, $result);
|
||||
}
|
||||
|
||||
//adjust the variables required variables
|
||||
@@ -145,6 +145,7 @@ EOD;
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $row);
|
||||
}
|
||||
|
||||
//set the transfer_ringback
|
||||
@@ -178,6 +179,7 @@ EOD;
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $row);
|
||||
}
|
||||
|
||||
//set variables that depend on the number of domains
|
||||
@@ -221,6 +223,7 @@ EOD;
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $row);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
$message = $orm->message;
|
||||
//print_r($message);
|
||||
}
|
||||
unset($row);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ if ($domains_processed == 1) {
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $result);
|
||||
|
||||
//replace the backslash with a forward slash
|
||||
$db_path = str_replace("\\", "/", $db_path);
|
||||
@@ -62,6 +63,7 @@ if ($domains_processed == 1) {
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
unset($prep_statement);
|
||||
if ($row['num_rows'] > 0) {
|
||||
$odbc_num_rows = $row['num_rows'];
|
||||
|
||||
@@ -95,6 +97,7 @@ if ($domains_processed == 1) {
|
||||
foreach ($result as &$row) {
|
||||
$recordings_dir = $row["default_setting_value"];
|
||||
}
|
||||
unset($prep_statement, $result);
|
||||
}
|
||||
|
||||
//config.lua
|
||||
|
||||
@@ -60,6 +60,7 @@ if ($domains_processed == 1) {
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $row);
|
||||
}
|
||||
|
||||
//ensure that the default password length and strength are set
|
||||
@@ -109,6 +110,7 @@ if ($domains_processed == 1) {
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $row);
|
||||
}
|
||||
|
||||
//set the sip_profiles directory for older installs
|
||||
|
||||
@@ -116,6 +116,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($prep_statement);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -47,6 +47,7 @@ if (strlen($_SESSION['switch']['scripts']['dir']) > 0) {
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ if (strlen($_SESSION['switch']['scripts']['dir']) > 0) {
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
unset($prep_statement, $row);
|
||||
}
|
||||
|
||||
//ensure the login message is set, if new message exists
|
||||
@@ -84,6 +85,7 @@ if (strlen($_SESSION['switch']['scripts']['dir']) > 0) {
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
unset($prep_statement);
|
||||
if ($row['num_rows'] == 0) {
|
||||
|
||||
// insert message
|
||||
@@ -141,8 +143,8 @@ if (strlen($_SESSION['switch']['scripts']['dir']) > 0) {
|
||||
unset($sql);
|
||||
}
|
||||
}
|
||||
unset($prep_statement, $result);
|
||||
}
|
||||
unset($sql, $result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($prep_statement, $sub_result);
|
||||
}
|
||||
unset($prep_statement, $sub_result);
|
||||
|
||||
//if there are no permissions listed in v_group_permissions then set the default permissions
|
||||
$sql = "select count(*) as count from v_group_permissions ";
|
||||
@@ -129,13 +129,38 @@
|
||||
$sql .= "and user_uuid is null; ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach($result as $row) {
|
||||
if (strlen($row['username']) > 0) {
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach($result as $row) {
|
||||
if (strlen($row['username']) > 0) {
|
||||
//get the user_uuid
|
||||
$sql = "select user_uuid from v_users ";
|
||||
$sql .= "where username = '".$row['username']."' ";
|
||||
$sql .= "and user_enabled = 'true' ";
|
||||
$prep_statement_sub = $db->prepare($sql);
|
||||
$prep_statement_sub->execute();
|
||||
$sub_result = $prep_statement_sub->fetch(PDO::FETCH_ASSOC);
|
||||
unset ($prep_statement_sub);
|
||||
$user_uuid = $sub_result['user_uuid'];
|
||||
//set the user uuid
|
||||
$sql = "update v_group_users set ";
|
||||
$sql .= "user_uuid = '".$user_uuid."' ";
|
||||
$sql .= "where username = '".$row['username']."'; ";
|
||||
$db->exec($sql);
|
||||
unset($sql);
|
||||
}
|
||||
else {
|
||||
//get the number of users
|
||||
$sql = "select count(*) as num_rows from v_users ";
|
||||
$sql .= "where user_enabled = 'true' ";
|
||||
$prep_statement_sub = $db->prepare($sql);
|
||||
$prep_statement_sub->execute();
|
||||
$sub_result = $prep_statement_sub->fetch(PDO::FETCH_ASSOC);
|
||||
unset ($prep_statement_sub);
|
||||
$num_rows = $sub_result['num_rows'];
|
||||
if ($num_rows == 1) {
|
||||
//get the user_uuid
|
||||
$sql = "select user_uuid from v_users ";
|
||||
$sql .= "where username = '".$row['username']."' ";
|
||||
$sql .= "and user_enabled = 'true' ";
|
||||
$prep_statement_sub = $db->prepare($sql);
|
||||
$prep_statement_sub->execute();
|
||||
@@ -145,36 +170,12 @@
|
||||
//set the user uuid
|
||||
$sql = "update v_group_users set ";
|
||||
$sql .= "user_uuid = '".$user_uuid."' ";
|
||||
$sql .= "where username = '".$row['username']."'; ";
|
||||
$db->exec($sql);
|
||||
unset($sql);
|
||||
}
|
||||
else {
|
||||
//get the number of users
|
||||
$sql = "select count(*) as num_rows from v_users ";
|
||||
$sql .= "where user_enabled = 'true' ";
|
||||
$prep_statement_sub = $db->prepare($sql);
|
||||
$prep_statement_sub->execute();
|
||||
$sub_result = $prep_statement_sub->fetch(PDO::FETCH_ASSOC);
|
||||
unset ($prep_statement_sub);
|
||||
$num_rows = $sub_result['num_rows'];
|
||||
if ($num_rows == 1) {
|
||||
//get the user_uuid
|
||||
$sql = "select user_uuid from v_users ";
|
||||
$sql .= "and user_enabled = 'true' ";
|
||||
$prep_statement_sub = $db->prepare($sql);
|
||||
$prep_statement_sub->execute();
|
||||
$sub_result = $prep_statement_sub->fetch(PDO::FETCH_ASSOC);
|
||||
unset ($prep_statement_sub);
|
||||
$user_uuid = $sub_result['user_uuid'];
|
||||
//set the user uuid
|
||||
$sql = "update v_group_users set ";
|
||||
$sql .= "user_uuid = '".$user_uuid."' ";
|
||||
$db->exec($sql);
|
||||
unset($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset ($prep_statement);
|
||||
}
|
||||
|
||||
//if there are no permissions listed in v_group_permissions then set the default permissions
|
||||
|
||||
Reference in New Issue
Block a user