From 1b95cbf38cfd0f173d101efbdf45ceceab9195b9 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 17 Feb 2020 08:51:21 -0700 Subject: [PATCH] Domains: Supress warnings when deleting missing xml files in delete() method. Fix recordings directory session variable index. --- resources/classes/domains.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/classes/domains.php b/resources/classes/domains.php index e31cea28e2..766458db0f 100644 --- a/resources/classes/domains.php +++ b/resources/classes/domains.php @@ -189,19 +189,19 @@ if (!class_exists('domains')) { } //delete the dialplan - unlink($_SESSION['switch']['dialplan']['dir'].'/'.$domain_name.'.xml'); + @unlink($_SESSION['switch']['dialplan']['dir'].'/'.$domain_name.'.xml'); if (strlen($_SESSION['switch']['dialplan']['dir']) > 0) { system('rm -rf '.$_SESSION['switch']['dialplan']['dir'].'/'.$domain_name); } //delete the dialplan public - unlink($_SESSION['switch']['dialplan']['dir'].'/public/'.$domain_name.'.xml'); + @unlink($_SESSION['switch']['dialplan']['dir'].'/public/'.$domain_name.'.xml'); if (strlen($_SESSION['switch']['dialplan']['dir']) > 0) { system('rm -rf '.$_SESSION['switch']['dialplan']['dir'].'/public/'.$domain_name); } //delete the extension - unlink($_SESSION['switch']['extensions']['dir'].'/'.$domain_name.'.xml'); + @unlink($_SESSION['switch']['extensions']['dir'].'/'.$domain_name.'.xml'); if (strlen($_SESSION['switch']['extensions']['dir']) > 0) { system('rm -rf '.$_SESSION['switch']['extensions']['dir'].'/'.$domain_name); } @@ -221,7 +221,7 @@ if (!class_exists('domains')) { } else { //check if file extension is xml if (strpos($file, $v_needle) !== false && substr($file,-4) == '.xml') { - unlink($_SESSION['switch']['sip_profiles']['dir']."/".$file); + @unlink($_SESSION['switch']['sip_profiles']['dir']."/".$file); } } } @@ -238,7 +238,7 @@ if (!class_exists('domains')) { //this is a directory } else { if (strpos($file, $v_needle) !== false && substr($file,-4) == '.xml') { - unlink($_SESSION['switch']['conf']['dir']."/ivr_menus/".$file); + @unlink($_SESSION['switch']['conf']['dir']."/ivr_menus/".$file); } } } @@ -247,7 +247,7 @@ if (!class_exists('domains')) { } //delete the recordings - if (strlen($_SESSION['switch'][recordings]['dir']) > 0) { + if (strlen($_SESSION['switch']['recordings']['dir']) > 0) { system('rm -rf '.$_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$domain_name); }