diff --git a/app/registrations/registrations.php b/app/registrations/registrations.php index 64ef5dbb4a..67ee17307f 100644 --- a/app/registrations/registrations.php +++ b/app/registrations/registrations.php @@ -145,14 +145,14 @@ //get the vendor $vendor = device::get_vendor_by_agent($row['agent']); //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") { $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; } - 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; } $response = event_socket_request($fp, "api ".$command);