From a67ba8fff355822b21df327b9c673f70c817dbf6 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 24 Jun 2016 10:13:25 -0600 Subject: [PATCH] Update cmd.php Add Applied response message and fix the referrer. --- app/devices/cmd.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/app/devices/cmd.php b/app/devices/cmd.php index 8b6c206b06..f40d857e83 100644 --- a/app/devices/cmd.php +++ b/app/devices/cmd.php @@ -51,13 +51,13 @@ else { //create the event socket connection $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if ($fp) { + //prepare the command if ($cmd == "unregister") { $command = "sofia profile ".$profile." flush_inbound_reg ".$user." reboot"; } else { $command = "lua app.lua event_notify ".$profile." ".$cmd." ".$user." ".$vendor; - //if ($cmd == "check_sync") { // $command = "sofia profile ".$profile." check_sync ".$user; //} @@ -65,8 +65,10 @@ else { //send the command $response = event_socket_request($fp, "api ".$command); $response = event_socket_request($fp, "api log notice ".$command); + //show the response $_SESSION['message'] = $text['label-event']." ".ucwords($cmd)."     ".$text['label-response'].$response; + //close the connection fclose($fp); } @@ -77,7 +79,15 @@ else { echo $response; } else { - header("Location: status_registrations.php?profile=".$profile."&show=".$show); + //send the message + $_SESSION["message_delay"] = 3500; + $_SESSION["message_mood"] = 'positive'; + $_SESSION["message"] = $text['button-applied']; + + //send the redirect + if (isset($_SERVER['HTTP_REFERER'])) { + header("Location: ".$_SERVER['HTTP_REFERER']); + } } -?> \ No newline at end of file +?>