Update cmd.php

This commit is contained in:
FusionPBX 2019-06-23 14:51:28 -06:00 committed by GitHub
parent f44ed4370c
commit 63876aa86c
1 changed files with 15 additions and 16 deletions

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2013 Portions created by the Initial Developer are Copyright (C) 2008-2019
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@ -39,43 +39,43 @@
} }
//set the variables //set the variables
$cmd = check_str($_GET['cmd']); $command = $_GET['cmd'];
//create the event socket connection //create the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) { if ($fp) {
//if reloadxml then run reloadacl, reloadxml and rescan the external profile for new gateways //if reloadxml then run reloadacl, reloadxml and rescan the external profile for new gateways
if ($cmd == "api reloadxml") { if ($command == "api reloadxml") {
//reloadxml //reloadxml
if ($cmd == "api reloadxml") { if ($command == "api reloadxml") {
message::add(rtrim(event_socket_request($fp, $cmd)), 'alert'); message::add(rtrim(event_socket_request($fp, $command)), 'alert');
unset($cmd); unset($command);
} }
//clear the apply settings reminder //clear the apply settings reminder
$_SESSION["reload_xml"] = false; $_SESSION["reload_xml"] = false;
//rescan the external profile to look for new or stopped gateways //rescan the external profile to look for new or stopped gateways
$tmp_cmd = 'api sofia profile external rescan'; $command = 'api sofia profile external rescan';
message::add(rtrim(event_socket_request($fp, $tmp_cmd)), 'alert'); message::add(rtrim(event_socket_request($fp, $command)), 'alert');
unset($tmp_cmd); unset($command);
} }
//cache flush //cache flush
if ($cmd == "api cache flush") { if ($command == "api cache flush") {
$cache = new cache; $cache = new cache;
$cache->flush(); $cache->flush();
} }
//reloadacl //reloadacl
if ($cmd == "api reloadacl") { if ($command == "api reloadacl") {
message::add(rtrim(event_socket_request($fp, $cmd)), 'alert'); message::add(rtrim(event_socket_request($fp, $command)), 'alert');
unset($cmd); unset($command);
} }
//sofia profile //sofia profile
if (substr($cmd, 0, 17) == "api sofia profile") { if (substr($command, 0, 17) == "api sofia profile") {
message::add(rtrim(event_socket_request($fp, $cmd)), 'alert'); message::add(rtrim(event_socket_request($fp, $command)), 'alert');
} }
//close the connection //close the connection
@ -85,5 +85,4 @@
//redirect the user //redirect the user
header("Location: sip_status.php"); header("Location: sip_status.php");
?> ?>