Prevent duplicate values from being saved in the vars.xml file and remove some trailing spaces and fix some of the indentation.
This commit is contained in:
@@ -129,7 +129,7 @@ EOD;
|
|||||||
if(isset($countries[$country_iso])){
|
if(isset($countries[$country_iso])){
|
||||||
$country = $countries[$country_iso];
|
$country = $countries[$country_iso];
|
||||||
|
|
||||||
// Set default Country ISO code
|
// Set default Country ISO code
|
||||||
$sql = "select count(*) as num_rows from v_vars ";
|
$sql = "select count(*) as num_rows from v_vars ";
|
||||||
$sql .= "where var_name = 'default_country' ";
|
$sql .= "where var_name = 'default_country' ";
|
||||||
$sql .= "and var_cat = 'Defaults' ";
|
$sql .= "and var_cat = 'Defaults' ";
|
||||||
@@ -166,7 +166,7 @@ EOD;
|
|||||||
}
|
}
|
||||||
unset($prep_statement, $sql);
|
unset($prep_statement, $sql);
|
||||||
|
|
||||||
// Set default Country code
|
//Set default Country code
|
||||||
$sql = "select count(*) as num_rows from v_vars ";
|
$sql = "select count(*) as num_rows from v_vars ";
|
||||||
$sql .= "where var_name = 'default_countrycode' ";
|
$sql .= "where var_name = 'default_countrycode' ";
|
||||||
$sql .= "and var_cat = 'Defaults' ";
|
$sql .= "and var_cat = 'Defaults' ";
|
||||||
@@ -202,7 +202,7 @@ EOD;
|
|||||||
}
|
}
|
||||||
unset($prep_statement, $sql);
|
unset($prep_statement, $sql);
|
||||||
|
|
||||||
// Set default International Direct Dialing code
|
// Set default International Direct Dialing code
|
||||||
$sql = "select count(*) as num_rows from v_vars ";
|
$sql = "select count(*) as num_rows from v_vars ";
|
||||||
$sql .= "where var_name = 'default_exitcode' ";
|
$sql .= "where var_name = 'default_exitcode' ";
|
||||||
$sql .= "and var_cat = 'Defaults' ";
|
$sql .= "and var_cat = 'Defaults' ";
|
||||||
@@ -283,11 +283,9 @@ EOD;
|
|||||||
$db->exec($sql);
|
$db->exec($sql);
|
||||||
unset($sql);
|
unset($sql);
|
||||||
$x++;
|
$x++;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($prep_statement, $row2);
|
unset($prep_statement, $row2);
|
||||||
|
|
||||||
}
|
}
|
||||||
unset($result, $row);
|
unset($result, $row);
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-10
@@ -410,17 +410,12 @@ function save_var_xml() {
|
|||||||
$xml .= "<!-- ".base64_decode($row['var_description'])." -->\n";
|
$xml .= "<!-- ".base64_decode($row['var_description'])." -->\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($row['var_cat'] == 'Exec-Set') { $var_cmd = 'exec-set'; } else { $var_cmd = 'set'; }
|
||||||
if (strlen($row['var_hostname']) == 0) {
|
if (strlen($row['var_hostname']) == 0) {
|
||||||
$xml .= "<X-PRE-PROCESS cmd=\"set\" data=\"".$row['var_name']."=".$row['var_value']."\"/>\n";
|
$xml .= "<X-PRE-PROCESS cmd=\"".$var_cmd."\" data=\"".$row['var_name']."=".$row['var_value']."\" />\n";
|
||||||
} elseif ($row['var_hostname'] == $hostname) {
|
} elseif ($row['var_hostname'] == $hostname) {
|
||||||
$xml .= "<X-PRE-PROCESS cmd=\"set\" data=\"".$row['var_name']."=".$row['var_value']."\"/>\n";
|
$xml .= "<X-PRE-PROCESS cmd=\"".$var_cmd."\" data=\"".$row['var_name']."=".$row['var_value']."\" />\n";
|
||||||
}
|
|
||||||
$var_cmd = 'set';
|
|
||||||
if ($row['var_cat'] == 'Exec-Set') { $var_cmd = 'exec-set'; }
|
|
||||||
if (strlen($row['var_hostname']) == 0) {
|
|
||||||
$xml .= "<X-PRE-PROCESS cmd=\"".$var_cmd."\" data=\"".$row['var_name']."=".$row['var_value']."\"/>\n";
|
|
||||||
} elseif ($row['var_hostname'] == $hostname) {
|
|
||||||
$xml .= "<X-PRE-PROCESS cmd=\"".$var_cmd."\" data=\"".$row['var_name']."=".$row['var_value']."\"/>\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$prev_var_cat = $row['var_cat'];
|
$prev_var_cat = $row['var_cat'];
|
||||||
@@ -1484,7 +1479,7 @@ if(!function_exists('path_join')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!function_exists('find_php_by_extension')) {
|
if(!function_exists('find_php_by_extension')) {
|
||||||
/*Tesetd on WAMP and OpenServer*/
|
// Tested on WAMP and OpenServer
|
||||||
function find_php_by_extension(){
|
function find_php_by_extension(){
|
||||||
$bin_dir = get_cfg_var('extension_dir');
|
$bin_dir = get_cfg_var('extension_dir');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user