diff --git a/examples/ap_scanning_state.php b/examples/ap_scanning_state.php new file mode 100644 index 0000000..c97e51c --- /dev/null +++ b/examples/ap_scanning_state.php @@ -0,0 +1,35 @@ +'; +$ap_mac = ''; + +/** + * load the Unifi API connection class and log in to the controller and do our thing + * spectrum_scan_state() + */ +require_once('phpapi/class.unifi.php'); +$unifidata = new unifiapi($controlleruser, $controllerpassword, $controllerurl, $site_id, $controllerversion); +$loginresults = $unifidata->login(); +$data = $unifidata->spectrum_scan_state($ap_mac); + +/** + * provide feedback in json format + */ +echo json_encode($data, JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/auth_guest_basic.php b/examples/auth_guest_basic.php new file mode 100644 index 0000000..7b97398 --- /dev/null +++ b/examples/auth_guest_basic.php @@ -0,0 +1,48 @@ +'; + +/** + * the duration to authorize the device for in minutes + */ +$duration = 2000; + +/** + * The site to authorize the device with + */ +$site_id = ''; + +/** + * load the Unifi API connection class and log in to the controller + */ +require_once('../phpapi/class.unifi.php'); +$unifidata = new unifiapi($controlleruser, $controllerpassword, $controllerurl, $site_id, $controllerversion); +$set_debug_mode = $unifidata->set_debug($debug); +$loginresults = $unifidata->login(); + +/** + * then we authorize the device for the requested duration + */ +$auth_result = $unifidata->authorize_guest($mac, $duration); + +/** + * provide feedback in json format + */ +echo json_encode($auth_result, JSON_PRETTY_PRINT); \ No newline at end of file diff --git a/examples/auth_guest_with_note.php b/examples/auth_guest_with_note.php index d26f523..cbfc55d 100644 --- a/examples/auth_guest_with_note.php +++ b/examples/auth_guest_with_note.php @@ -3,11 +3,11 @@ * PHP API usage example * * contributed by: slooffmaster - * description: example basic PHP script to auth a guest device and attach a note to it + * description: example basic PHP script to auth a guest device and attach a note to it, this method would normally be used for offline authorization only! */ /** - * include the config file (place you credentials etc. there if not already present) + * include the config file (place your credentials etc. there if not already present) * * NOTE: * this example will only work out of the box with a single controller config file! diff --git a/examples/list_alarms.php b/examples/list_alarms.php index ef251bb..baf9c70 100644 --- a/examples/list_alarms.php +++ b/examples/list_alarms.php @@ -7,7 +7,7 @@ */ /** - * include the config file (place you credentials etc. there if not already present) + * include the config file (place your credentials etc. there if not already present) * * NOTE: * this example will only work out of the box with a single controller config file! diff --git a/examples/list_site_health.php b/examples/list_site_health.php index 1926155..f8c1912 100644 --- a/examples/list_site_health.php +++ b/examples/list_site_health.php @@ -8,7 +8,7 @@ */ /** - * include the config file (place you credentials etc. there if not already present) + * include the config file (place your credentials etc. there if not already present) * * NOTE: * this example will only work out of the box with a single controller config file! diff --git a/examples/list_social_auth_details.php b/examples/list_social_auth_details.php index 320b12e..8c3037a 100644 --- a/examples/list_social_auth_details.php +++ b/examples/list_social_auth_details.php @@ -8,7 +8,7 @@ */ /** - * include the config file (place you credentials etc. there if not already present) + * include the config file (place your credentials etc. there if not already present) * * NOTE: * this example will only work out of the box with a single controller config file! diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index 2c1c01d..0000000 Binary files a/favicon.ico and /dev/null differ diff --git a/index.php b/index.php index 0428728..b5f3e84 100644 --- a/index.php +++ b/index.php @@ -10,7 +10,7 @@ * the currently supported data collections/API endpoints in the README.md file * - this tool currently supports versions 4.x and 5.x of the UniFi Controller software * - * VERSION: 1.0.14 + * VERSION: 1.0.15 * * ------------------------------------------------------------------------------------ * @@ -20,7 +20,7 @@ * with this package in the file LICENSE.md * */ -define('API_BROWSER_VERSION', '1.0.14'); +define('API_BROWSER_VERSION', '1.0.15'); /** * in order to use the PHP $_SESSION array for temporary storage of variables, session_start() is required @@ -511,11 +511,15 @@ function sites_sort($a, $b) + - + + + + + @@ -755,7 +768,9 @@ function sites_sort($a, $b)
  • United
  • Yeti
  • -
  • Reset PHP session
  • +
  • + Reset PHP session +
  • About UniFi API browser
  • @@ -817,6 +832,9 @@ function sites_sort($a, $b) + + +