From 5e8901318ac9cdf67f85d9bc761d9f4936f12bf2 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 4 Jul 2017 11:15:47 -0600 Subject: [PATCH] Update access_control_edit.php --- app/access_controls/access_control_edit.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/app/access_controls/access_control_edit.php b/app/access_controls/access_control_edit.php index 82aeee8dd9..3b191f671b 100644 --- a/app/access_controls/access_control_edit.php +++ b/app/access_controls/access_control_edit.php @@ -61,6 +61,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //add or update the database if ($_POST["persistformvar"] != "true") { if ($action == "add" && permission_exists('access_control_add')) { + //update the database $sql = "insert into v_access_controls "; $sql .= "("; $sql .= "access_control_uuid, "; @@ -78,14 +79,21 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $db->exec(check_sql($sql)); unset($sql); - remove_config_from_cache('configuration:acl.conf'); + //clear the cache + $cache = new cache; + $cache->delete("configuration:acl.conf"); + + //add the message messages::add($text['message-add']); + + //redirect the user header("Location: access_controls.php"); return; } //if ($action == "add") if ($action == "update" && permission_exists('access_control_edit')) { + //update the database $sql = "update v_access_controls set "; $sql .= "access_control_name = '$access_control_name', "; $sql .= "access_control_default = '$access_control_default', "; @@ -94,8 +102,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $db->exec(check_sql($sql)); unset($sql); - remove_config_from_cache('configuration:acl.conf'); + //clear the cache + $cache = new cache; + $cache->delete("configuration:acl.conf"); + + //add the message messages::add($text['message-update']); + + //redirect the user header("Location: access_controls.php"); return; @@ -199,4 +213,4 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?>