Compare commits

...

11 Commits

Author SHA1 Message Date
malle-pietje
ca25c8ab52 re-added PHP_EOL in several places 2020-01-30 10:14:55 +01:00
malle-pietje
6754eb5041 API client class v1.1.45
- added function/method force_provision(), contributed by @VWT-Dan
- added example update_switch_poe-mode.php, contributed by @Kaltt
2020-01-30 10:09:34 +01:00
malle-pietje
2ac791a353 API client class v1.1.44
- added example script reconnect_client.php
- fixed typo in URL linking to UniFi section on the UI.com site
- add function/method reboot_cloudkey(), contributed by @leonardogyn
2020-01-27 13:19:49 +01:00
malle-pietje
3fd8e69b4a API client class v1.1.43
- updated code and instructions for `set_guestlogin_settings()`, thanks to @stoehrmark for reporting the issue
- added list_connected_users.php example contributed by @gahujipo
- added restart_device() which replaces restart_ap(), contributed by @leonardogyn
- code styling cleanup across `Client.php`
2019-12-13 09:15:10 +01:00
malle-pietje
c7d1eee3e3 fixed minor syntax error/typo in an example 2019-10-15 14:41:16 +02:00
malle-pietje
17bfe0087c clean up of example code based on feedback from scrutinizer-ci.com 2019-10-15 14:27:28 +02:00
malle-pietje
b3521d8c1d updated main README to include the newly added functions/methods
added example to demonstrate the use of set_super_mgmt_settings_base()
2019-10-15 14:16:23 +02:00
malle-pietje
727cd6dc9c API client class v1.1.42
changed variable name $url to $path in custom_api_request() for consistency and clarity
rearranged layout of Client.php
added check to verify whether $ch is a resource
renamed get_curl_obj() to get_curl_resource() to reflect the variable type it returns

Added the new functions/methods:
* set_super_mgmt_settings_base()
* set_super_smtp_settings_base()
* set_super_identity_settings_base()
2019-10-15 14:04:37 +02:00
malle-pietje
09db47affd API client class v1.1.41
changed create_wlan function/method to not include passphrase in payload when security = "open" and passphrase = null
fixed indentations in several places
added custom_api_request() function/method which allows a programmer to issue custom API requests that may not yet be supported by this client (to be used with care!)
added example to demonstrate use of custom_api_request()
removed repetitive code and optimized exec_curl() when creating the final payload, resulting in 10-20% performance increase and slightly lower memory consumption by PHP
2019-04-29 17:35:09 +02:00
malle-pietje
55867197e3 fixed functions assign_existing_admin() and invite_admin() to support controller versions 5.9 and higher because of changes in controller behavior 2019-01-21 09:41:47 +01:00
malle-pietje
78bed0895d minor code tweaks for improved readability
added function/method assign_existing_admin()
fixed code for function/method invite_admin()
2019-01-19 15:17:53 +01:00
13 changed files with 1213 additions and 672 deletions

View File

@@ -1,12 +1,12 @@
## UniFi Controller API client class ## UniFi Controller API client class
A PHP class which provides access to Ubiquiti's **UniFi Controller API**, versions 4.X.X and 5.X.X of the UniFi Controller software are supported (version 5.9.29 has been confirmed to work). It's a standalone version of the class which is used in our API browser tool which can be found [here](https://github.com/Art-of-WiFi/UniFi-API-browser). A PHP class which provides access to Ubiquiti's [**UniFi SDN Controller**](https://unifi-sdn.ui.com/) API, versions 4.X.X and 5.X.X of the UniFi SDN Controller software are supported (version 5.12.35 has been confirmed to work). It's a standalone version of the class which is used in our API browser tool which can be found [here](https://github.com/Art-of-WiFi/UniFi-API-browser).
This class can be installed manually or using composer/[packagist](https://packagist.org/packages/art-of-wifi/unifi-api-client) for easy inclusion in your projects. This class can be installed manually or using composer/[packagist](https://packagist.org/packages/art-of-wifi/unifi-api-client) for easy inclusion in your projects.
## Requirements ## Requirements
- a web server with PHP and cURL modules installed (tested on apache2 with PHP Version 5.6.1 and cURL 7.42.1 and with PHP 7.0.7 and cURL 7.37.0) - a web server with PHP and cURL modules installed (tested on Apache 2.4 with PHP Version 5.6.1 and cURL 7.42.1 and with PHP 7.2.24 and cURL 7.58.0)
- network connectivity between this web server and the server and port (normally TCP port 8443) where the UniFi Controller is running - network connectivity between this web server and the server and port (normally TCP port 8443) where the UniFi Controller is running
## Installation ## ## Installation ##
@@ -84,17 +84,17 @@ Please refer to the `examples/` directory for some more detailed examples which
#### IMPORTANT NOTES: #### IMPORTANT NOTES:
1. The last optional parameter that is passed to the constructor in the above example (`true`), enables validation of the controller's SSL certificate which is otherwise **disabled** by default. It is highly recommended to enable this feature in production environments where you have a valid SSL cert installed on the UniFi Controller, and which is associated with the FQDN of the server as used in the `controller_url` parameter. This option was added with API client version 1.1.16. 1. In the above example, `$site_id` is the short site "name" (usually 8 characters long) that is visible in the URL when managing the site in the UniFi SDN Controller. For example with this URL:
2. In the example above, `$site_id` is the 8 character short site "name" which is visible in the URL when managing the site in the UniFi Controller:
`https://<controller IP address or FQDN>:8443/manage/site/jl3z2shm/dashboard` `https://<controller IP address or FQDN>:8443/manage/site/jl3z2shm/dashboard`
In this case, `jl3z2shm` is the value required for $site_id. `jl3z2shm` is the short site "name" and the value to assign to $site_id.
## Methods and functions supported 2. The last optional parameter that is passed to the constructor in the above example (`true`), enables validation of the controller's SSL certificate which is otherwise **disabled** by default. It is highly recommended to enable this feature in production environments where you have a valid SSL cert installed on the UniFi Controller that is associated with the FQDN in the `controller_url` parameter. This option was added with API client version 1.1.16.
The class currently supports the following functions/methods to get/post/put/delete data through the UniFi Controller API: ## Functions/methods supported
The class currently supports the following functions/methods to GET/POST/PUT/DELETE data through the UniFi Controller API. Please refer to the source code for more details on the functions/methods and their respective parameters.
- login() - login()
- logout() - logout()
@@ -112,6 +112,7 @@ The class currently supports the following functions/methods to get/post/put/del
- create_user() - create_user()
- create_voucher() - create_voucher()
- create_wlan() - create_wlan()
- custom_api_request()
- delete_device() - delete_device()
- delete_firewallgroup() - delete_firewallgroup()
- delete_network() - delete_network()
@@ -126,6 +127,7 @@ The class currently supports the following functions/methods to get/post/put/del
- extend_guest_validity() - extend_guest_validity()
- forget_sta() (supported on controller version 5.9.X and higher) - forget_sta() (supported on controller version 5.9.X and higher)
- invite_admin() - invite_admin()
- assign_existing_admin()
- revoke_admin() - revoke_admin()
- led_override() - led_override()
- list_admins() - list_admins()
@@ -167,7 +169,9 @@ The class currently supports the following functions/methods to get/post/put/del
- power_cycle_switch_port() - power_cycle_switch_port()
- reconnect_sta() - reconnect_sta()
- rename_ap() - rename_ap()
- restart_ap() - restart_ap() (deprecated but still available as alias)
- restart_device()
- reboot_cloudkey()
- revoke_voucher() - revoke_voucher()
- set_ap_radiosettings() - set_ap_radiosettings()
- set_device_settings_base() - set_device_settings_base()
@@ -185,6 +189,9 @@ The class currently supports the following functions/methods to get/post/put/del
- set_site_name() - set_site_name()
- set_site_ntp() - set_site_ntp()
- set_site_snmp() - set_site_snmp()
- set_super_mgmt_settings_base()
- set_super_smtp_settings_base()
- set_super_identity_settings_base()
- set_sta_name() - set_sta_name()
- set_sta_note() - set_sta_note()
- set_usergroup() - set_usergroup()
@@ -239,8 +246,6 @@ Internal functions, getters/setters:
- get_last_results_raw() - get_last_results_raw()
- get_last_error_message() - get_last_error_message()
Please refer to the source code for more details on the functions/methods and their parameters.
## Need help or have suggestions? ## Need help or have suggestions?
There is still work to be done to add functionality and further improve the usability of this class, so all suggestions/comments are welcome. Please use the GitHub [issue list](https://github.com/Art-of-WiFi/UniFi-API-client/issues) or the Ubiquiti Community forums (https://community.ubnt.com/t5/UniFi-Wireless/PHP-class-to-access-the-UniFi-controller-API-updates-and/td-p/1512870) to share your suggestions and questions. There is still work to be done to add functionality and further improve the usability of this class, so all suggestions/comments are welcome. Please use the GitHub [issue list](https://github.com/Art-of-WiFi/UniFi-API-client/issues) or the Ubiquiti Community forums (https://community.ubnt.com/t5/UniFi-Wireless/PHP-class-to-access-the-UniFi-controller-API-updates-and/td-p/1512870) to share your suggestions and questions.
@@ -251,10 +256,14 @@ If you would like to contribute code (improvements), please open an issue and in
## Credits ## Credits
This class is based on the work done by the following developers: This class is based on the initial work by the following developers:
- domwo: http://community.ubnt.com/t5/UniFi-Wireless/little-php-class-for-unifi-api/m-p/603051 - domwo: http://community.ubnt.com/t5/UniFi-Wireless/little-php-class-for-unifi-api/m-p/603051
- fbagnol: https://github.com/fbagnol/class.unifi.php - fbagnol: https://github.com/fbagnol/class.unifi.php
- and the API as published by Ubiquiti: https://dl.ubnt.com/unifi/5.8.24/unifi_sh_api
and the API as published by Ubiquiti:
- https://dl.ui.com/unifi/5.12.35/unifi_sh_api
## Important Disclaimer ## Important Disclaimer

View File

@@ -19,6 +19,7 @@ require_once('config.php');
/** /**
* site id and MAC address of AP to query * site id and MAC address of AP to query
* https://github.com/Art-of-WiFi/UniFi-API-client#important-notes
*/ */
$site_id = '<enter your site id here>'; $site_id = '<enter your site id here>';
$ap_mac = '<enter MAC address of Access Point to check>'; $ap_mac = '<enter MAC address of Access Point to check>';

View File

@@ -3,7 +3,7 @@
* PHP API usage example * PHP API usage example
* *
* contributed by: @4oo4 * contributed by: @4oo4
* description: example script to check and upgrade device firmware (can be scheduled with systemd/cron) * description: example script to upgrade device firmware (can be scheduled with systemd/cron)
* to the most current version * to the most current version
*/ */
require_once('vendor/autoload.php'); require_once('vendor/autoload.php');
@@ -11,6 +11,7 @@ require_once('config.php');
/** /**
* site id of the AP to update * site id of the AP to update
* https://github.com/Art-of-WiFi/UniFi-API-client#important-notes
*/ */
$site_id = '<enter your site id here>'; $site_id = '<enter your site id here>';

View File

@@ -3,7 +3,7 @@
* PHP API usage example * PHP API usage example
* *
* contributed by: Art of WiFi * contributed by: Art of WiFi
* description: example basic PHP script to perform a basic auth of a guest device * description: example PHP script to perform a basic auth of a guest device
*/ */
/** /**
@@ -22,6 +22,16 @@ require_once('config.php');
*/ */
$mac = '<enter MAC address of guest device to auth>'; $mac = '<enter MAC address of guest device to auth>';
/**
* the MAC address of the Access Point the guest is currently connected to, enter null (without quotes)
* if not known or unavailable
*
* NOTE:
* although the AP MAC address is not a required parameter for the authorize_guest() function,
* adding this parameter will speed up the initial authorization process
*/
$ap_mac = '<enter MAC address of Access Point>';
/** /**
* the duration to authorize the device for in minutes * the duration to authorize the device for in minutes
*/ */
@@ -42,7 +52,7 @@ $loginresults = $unifi_connection->login();
/** /**
* then we authorize the device for the requested duration * then we authorize the device for the requested duration
*/ */
$auth_result = $unifi_connection->authorize_guest($mac, $duration); $auth_result = $unifi_connection->authorize_guest($mac, $duration, null, null, null, $ap_mac);
/** /**
* provide feedback in json format * provide feedback in json format

View File

@@ -24,12 +24,12 @@ require_once('vendor/autoload.php');
* see the config.template.php file for an example * see the config.template.php file for an example
*/ */
require_once('config.php'); require_once('config.php');
$debug = false; $debug = false;
/** /**
* the MAC address(es) of the device(s) to block * the MAC address(es) of the device(s) to block
*/ */
$macs_to_block = explode(',',$argv[1]); $macs_to_block = explode(',', $argv[1]);
/** /**
* The site to authorize the device with * The site to authorize the device with
@@ -49,7 +49,7 @@ $loginresults = $unifi_connection->login(); // always true regardless of sit
foreach ($macs_to_block as &$mac) { foreach ($macs_to_block as &$mac) {
// block_result is always true even if mac address does not exist :( // block_result is always true even if mac address does not exist :(
$block_result = $unifi_connection->block_sta($mac); $block_result = $unifi_connection->block_sta($mac);
/** /**
* NOTE: * NOTE:
@@ -61,7 +61,7 @@ foreach ($macs_to_block as &$mac) {
*/ */
sleep(1); sleep(1);
$getid_result = $unifi_connection->stat_client($mac); $getid_result = $unifi_connection->stat_client($mac);
if (property_exists($getid_result[0], "oui")) { if (property_exists($getid_result[0], "oui")) {
// this field(manufacturer) seems to exist on valid mac addresses // this field(manufacturer) seems to exist on valid mac addresses

65
examples/change_super_mgmt.php Executable file
View File

@@ -0,0 +1,65 @@
<?php
/**
* PHP API usage example
*
* contributed by: Art of WiFi
* description: example basic PHP script to modify the super_mgmt settings for UniFi controller and output results
* in json format
*/
/**
* using the composer autoloader
*/
require_once('vendor/autoload.php');
/**
* UniFi controller credentials and the site to use, in this case since we are modifying global settings you can select
* any site here that is available on the UniFi controller
*
* NOTE: in this case you need to enter Super Administrator account credentials in config.php
*/
require_once('config.php');
$site_id = 'default';
$debug = false;
/**
* initialize the UniFi API connection class and log in to the controller and do our thing
*/
$unifi_connection = new UniFi_API\Client($controlleruser, $controllerpassword, $controllerurl, $site_id, $controllerversion, true);
$set_debug_mode = $unifi_connection->set_debug($debug);
$loginresults = $unifi_connection->login();
$site_settings = $unifi_connection->list_settings();
$super_mgmt_settings = [];
$super_mgmt_settings_id = '';
if (!empty($site_settings)) {
foreach($site_settings as $section) {
echo 'section key: ' . $section->key . PHP_EOL;
if ($section->key === 'super_mgmt') {
$super_mgmt_settings = $section;
$super_mgmt_settings_id = $section->_id;
}
}
}
/**
* modify the super_mgmt settings, in this example we only modify the Live Chat settings
* uncomment the required new value below:
*/
//$super_mgmt_settings->live_chat = 'disabled';
//$super_mgmt_settings->live_chat = 'enabled';
$super_mgmt_settings->live_chat = 'super-only';
/**
* we echo the parameters which we will be passing to the UniFi controller API
*/
echo $super_mgmt_settings_id . PHP_EOL;
echo json_encode($super_mgmt_settings, JSON_PRETTY_PRINT) . PHP_EOL . PHP_EOL;
$update_results = $unifi_connection->set_super_mgmt_settings_base($super_mgmt_settings_id, $super_mgmt_settings);
/**
* provide feedback in json format
*/
echo json_encode($update_results, JSON_PRETTY_PRINT);

View File

@@ -0,0 +1,47 @@
<?php
/**
* PHP API usage example
*
* contributed by: Art of WiFi
* description: example basic PHP script to execute a custom API request using the
* custom_api_request() function/method
*/
/**
* using the composer autoloader
*/
require_once('vendor/autoload.php');
/**
* include the config file (place your credentials etc. there if not already present)
* see the config.template.php file for an example
*/
require_once('config.php');
/**
* The site to authorize the device with
* https://github.com/Art-of-WiFi/UniFi-API-client#important-notes
*/
$site_id = '<enter your site id here>';
/**
* parameters
*/
$url = '/api/s/' . $site_id . '/stat/fwupdate/latest-version';
$request_type = 'GET';
$payload = null;
$return = 'array';
/**
* initialize the UniFi API connection class and log in to the controller and do our thing
*/
$unifi_connection = new UniFi_API\Client($controlleruser, $controllerpassword, $controllerurl, $site_id, $controllerversion);
$set_debug_mode = $unifi_connection->set_debug($debug);
$loginresults = $unifi_connection->login();
$results = $unifi_connection->custom_api_request($url, $request_type, $payload, $return);
/**
* provide feedback in JSON format or as PHP Object
*/
echo json_encode($results, JSON_PRETTY_PRINT);
//print_r($results);

View File

@@ -17,7 +17,9 @@ require_once('vendor/autoload.php');
*/ */
require_once('config.php'); require_once('config.php');
// must be adapted to your site! /**
* must be adapted to your site!
*/
$site_id = "default"; $site_id = "default";
$site_name = "*enter your site name*"; $site_name = "*enter your site name*";
@@ -29,18 +31,39 @@ if ($loginresults === 400) {
print "UniFi controller login failure, please check your credentials in config.php.\n"; print "UniFi controller login failure, please check your credentials in config.php.\n";
} else { } else {
$guestlist = $unifi_connection->list_guests(); $guestlist = $unifi_connection->list_guests();
// loop thru all known guests
/**
* loop thru all known guests
*/
foreach ($guestlist as $guest) { foreach ($guestlist as $guest) {
print "<pre>" . $guest->_id . " (" . $guest->mac . "), valid until " . date(DATE_ATOM, $guest->end) . " (" . $guest->end . ")</pre>"; print "<pre>" . $guest->_id . " (" . $guest->mac . "), valid until " . date(DATE_ATOM, $guest->end) . " (" . $guest->end . ")</pre>";
// just a sample: only extend validity of guests which have end date after 2017-04-02 /**
* just a sample: only extend validity of guests which have end date after 2017-04-02
*/
if ($guest->end > 1491166482) { if ($guest->end > 1491166482) {
// extend clients five times = five days /**
if (!$unifi_connection->extend_guest_validity($guest->_id)) print "Extend failed for guest with id " . $guest->_id . "\n"; * extend clients five times = five days
if (!$unifi_connection->extend_guest_validity($guest->_id)) print "Extend failed for guest with id " . $guest->_id . "\n"; */
if (!$unifi_connection->extend_guest_validity($guest->_id)) print "Extend failed for guest with id " . $guest->_id . "\n"; if (!$unifi_connection->extend_guest_validity($guest->_id)) {
if (!$unifi_connection->extend_guest_validity($guest->_id)) print "Extend failed for guest with id " . $guest->_id . "\n"; print "Extend failed for guest with id " . $guest->_id . "\n";
if (!$unifi_connection->extend_guest_validity($guest->_id)) print "Extend failed for guest with id " . $guest->_id . "\n"; }
if (!$unifi_connection->extend_guest_validity($guest->_id)) {
print "Extend failed for guest with id " . $guest->_id . "\n";
}
if (!$unifi_connection->extend_guest_validity($guest->_id)) {
print "Extend failed for guest with id " . $guest->_id . "\n";
}
if (!$unifi_connection->extend_guest_validity($guest->_id)) {
print "Extend failed for guest with id " . $guest->_id . "\n";
}
if (!$unifi_connection->extend_guest_validity($guest->_id)) {
print "Extend failed for guest with id " . $guest->_id . "\n";
}
} }
} }

View File

@@ -0,0 +1,37 @@
<?php
/**
* PHP API usage example
*
* contributed by: @gahujipo
* description: example to pull connected users and their details from the UniFi controller and output the results
* in JSON format
*/
/**
* using the composer autoloader
*/
require_once('vendor/autoload.php');
/**
* include the config file (place your credentials etc there if not already present)
* see the config.template.php file for an example
*/
require_once('config.php');
/**
* the short name of the site which you wish to query
*/
$site_id = '<enter your site id here>';
/**
* initialize the UniFi API connection class and log in to the controller and pull the requested data
*/
$unifi_connection = new UniFi_API\Client($controlleruser, $controllerpassword, $controllerurl, $site_id, $controllerversion);
$set_debug_mode = $unifi_connection->set_debug($debug);
$loginresults = $unifi_connection->login();
$clients_array = $unifi_connection->list_clients();
/**
* output the results in JSON format
*/
header('Content-Type: application/json; charset=utf-8');
echo json_encode($clients_array);

45
examples/reconnect_client.php Executable file
View File

@@ -0,0 +1,45 @@
<?php
/**
* PHP API usage example
*
* contributed by: Art of WiFi
* description: example basic PHP script to force a client device to reconnect
*/
/**
* using the composer autoloader
*/
require_once('vendor/autoload.php');
/**
* include the config file (place your credentials etc. there if not already present)
* see the config.template.php file for an example
*/
require_once('config.php');
/**
* the MAC address to reconnect
*/
$mac_to_reconnect = '<MAC address>';
/**
* site where the above MAC address is connected
*/
$site_id = '<enter your site id here>';
/**
* initialize the UniFi API connection class and log in to the controller
*/
$unifi_connection = new UniFi_API\Client($controlleruser, $controllerpassword, $controllerurl, $site_id, $controllerversion);
$set_debug_mode = $unifi_connection->set_debug($debug);
$loginresults = $unifi_connection->login();
/**
* then we force the device to reconnect
*/
$reconnect_result = $unifi_connection->reconnect_sta($mac_to_reconnect);
/**
* provide feedback in json format
*/
echo json_encode($reconnect_result, JSON_PRETTY_PRINT);

View File

@@ -24,8 +24,8 @@ require_once('vendor/autoload.php');
* see the config.template.php file for an example * see the config.template.php file for an example
*/ */
require_once('config.php'); require_once('config.php');
$debug = false;
$debug=false;
/** /**
* the MAC addresses of the device(s) to unblock * the MAC addresses of the device(s) to unblock
*/ */

View File

@@ -0,0 +1,93 @@
<?php
/**
* PHP API usage example to turn the PoE of the selected switch ports to "off" or "auto"
*
* contributed by: @Kaltt
* description: A use case for this script is to turn off the PoE of the port where a camera is connected in order to turn off the camera
*
* usage: If the file is called via a web URL, it should be called like: update_switch_poe-mode.php?poe_mode=off
* If the file is called via the command line, it should be called like: php update_switch_poe-mode.php off
* The values can be "off" or "auto"
*/
/**
* using the composer autoloader
*/
require_once('vendor/autoload.php');
/**
* include the config file (place your credentials etc. there if not already present)
* see the config.template.php file for an example
*/
require_once('config.php');
/**
* the site to use to log in to the controller
*/
$site_id = '<short site name of a site the credentials used have access to>';
/**
* the MAC address of the AC-IW device to re-configure
*/
$device_mac = '<enter MAC address>';
/**
* $lanports is an array that defines which ports should be changed
*/
$lanports = [6];
/**
* This is the function that reads out the current port configuration and changes the value for the poe_mode for the ports defined in $lanports
*/
function update_ports($running_config, $ports, $poe_mode){
/**
* Update already non-default ports
*/
for($i = 0; $i < count($running_config); $i++){
if(in_array($running_config[$i]->port_idx, $ports)){
$running_config[$i]->poe_mode = $poe_mode;
unset($ports[array_search($running_config[$i]->port_idx, $ports)]);
}
}
$add_conf = [];
foreach($ports as $port){
$add_conf[] = [
'port_idx' => $port,
'poe_mode' => $poe_mode
];
}
return array_merge($running_config, $add_conf);
}
$unifi_connection = new UniFi_API\Client($controlleruser, $controllerpassword, $controllerurl, $site_id, $controllerversion, false);
$set_debug_mode = $unifi_connection->set_debug(false);
$loginresults = $unifi_connection->login();
$data = $unifi_connection->list_devices($device_mac);
$device_id = $data[0]->device_id;
$current_conf = $data[0]->port_overrides;
/**
* This reads in the values provided via URL or in the command line, if nothing is set than it will poe_mode will be set to "auto"
*/
if (isset($_GET[poe_mode])) {
$poe_mode = $_GET[poe_mode];
} elseif (isset($argv[1])) {
$poe_mode = $argv[1];
} else {
$poe_mode = 'auto';
}
$new_ports_config = [
'port_overrides' => update_ports($current_conf, $lanports, $poe_mode)
];
$update_device = $unifi_connection->set_device_settings_base($device_id, $new_ports_config);
if (!$update_device) {
$error = $unifi_connection->get_last_results_raw();
echo json_encode($error, JSON_PRETTY_PRINT);
}
echo json_encode($update_device, JSON_PRETTY_PRINT);

File diff suppressed because it is too large Load Diff