Gateway Edit/Delete: Removes gateway xml file, if present, on delete and/or disable.
This commit is contained in:
parent
4dfb7a824e
commit
eccf7ec85d
|
|
@ -59,14 +59,11 @@ if (strlen($_GET["id"])>0) {
|
||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
|
|
||||||
//delete the xml file
|
//delete the xml file
|
||||||
if (count($_SESSION["domains"]) > 1) {
|
if ($_SESSION['switch']['sip_profiles']['dir'] != '') {
|
||||||
$gateway_xml_file = $_SESSION['switch']['sip_profiles']['dir']."/".$profile."/v_".$_SESSION['domain_name'].'-'.$gateway.".xml";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$gateway_xml_file = $_SESSION['switch']['sip_profiles']['dir']."/".$profile."/v_".$gateway_uuid.".xml";
|
$gateway_xml_file = $_SESSION['switch']['sip_profiles']['dir']."/".$profile."/v_".$gateway_uuid.".xml";
|
||||||
}
|
if (file_exists($gateway_xml_file)) {
|
||||||
if (file_exists($gateway_xml_file)) {
|
unlink($gateway_xml_file);
|
||||||
unlink($gateway_xml_file);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//create the event socket connection and stop the gateway
|
//create the event socket connection and stop the gateway
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
$db->exec(check_sql($sql));
|
$db->exec(check_sql($sql));
|
||||||
unset($sql);
|
unset($sql);
|
||||||
|
|
||||||
} //if ($action == "add")
|
} //if ($action == "add")
|
||||||
|
|
||||||
if ($action == "update" && permission_exists('gateway_edit')) {
|
if ($action == "update" && permission_exists('gateway_edit')) {
|
||||||
|
|
@ -244,9 +243,16 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
$sql .= "and gateway_uuid = '$gateway_uuid'";
|
$sql .= "and gateway_uuid = '$gateway_uuid'";
|
||||||
$db->exec(check_sql($sql));
|
$db->exec(check_sql($sql));
|
||||||
unset($sql);
|
unset($sql);
|
||||||
|
|
||||||
} //if ($action == "update")
|
} //if ($action == "update")
|
||||||
|
|
||||||
|
//remove xml file (if any) if not enabled
|
||||||
|
if ($enabled != 'true' && $_SESSION['switch']['sip_profiles']['dir'] != '') {
|
||||||
|
$gateway_xml_file = $_SESSION['switch']['sip_profiles']['dir']."/".$profile."/v_".$gateway_uuid.".xml";
|
||||||
|
if (file_exists($gateway_xml_file)) {
|
||||||
|
unlink($gateway_xml_file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//syncrhonize configuration
|
//syncrhonize configuration
|
||||||
save_gateway_xml();
|
save_gateway_xml();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue