Update registrations.php
This commit is contained in:
parent
aede2f209f
commit
de48b4ce03
|
|
@ -145,14 +145,14 @@
|
||||||
//get the vendor
|
//get the vendor
|
||||||
$vendor = device::get_vendor_by_agent($row['agent']);
|
$vendor = device::get_vendor_by_agent($row['agent']);
|
||||||
//prepare and send the command
|
//prepare and send the command
|
||||||
if (strlen($vendor) > 0 && strlen($profile) > 0 && strlen($user) > 0) {
|
if (strlen($profile) > 0 && strlen($user) > 0) {
|
||||||
if ($action == "unregister") {
|
if ($action == "unregister") {
|
||||||
$command = "sofia profile ".$profile." flush_inbound_reg ".$user." reboot";
|
$command = "sofia profile ".$profile." flush_inbound_reg ".$user." reboot";
|
||||||
}
|
}
|
||||||
if ($action == "provision" && strlen($host) > 0) {
|
if (strlen($vendor) > 0 && $action == "provision" && strlen($host) > 0) {
|
||||||
$command = "lua app.lua event_notify ".$profile." check_sync ".$user." ".$vendor." ".$host;
|
$command = "lua app.lua event_notify ".$profile." check_sync ".$user." ".$vendor." ".$host;
|
||||||
}
|
}
|
||||||
if ($action == "reboot" && strlen($host) > 0) {
|
if (strlen($vendor) > 0 && $action == "reboot" && strlen($host) > 0) {
|
||||||
$command = "lua app.lua event_notify ".$profile." reboot ".$user." ".$vendor." ".$host;
|
$command = "lua app.lua event_notify ".$profile." reboot ".$user." ".$vendor." ".$host;
|
||||||
}
|
}
|
||||||
$response = event_socket_request($fp, "api ".$command);
|
$response = event_socket_request($fp, "api ".$command);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue