forked from Art-of-WiFi/UniFi-API-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version 1.0.3, API client version 1.0.7
added ability to optionally configure multiple controllers in `config.php` general code and comments cleanup added `stat_sites()` function to the API client class (supported on UniFi controllers 5.2.9 and higher)
- Loading branch information
1 parent
ce2b6b4
commit d5c9fbd
Showing
4 changed files
with
889 additions
and
738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,81 @@ | ||
<?php | ||
/* | ||
The MIT License (MIT) | ||
/** | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2016, Slooffmaster | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
* | ||
*/ | ||
|
||
Copyright (c) 2016, Slooffmaster | ||
/** | ||
* Single controller configuration | ||
* =============================== | ||
* Update this section with your UniFi controller details and credentials | ||
* Remove or comment out this section when using the Multi controller configuration method | ||
*/ | ||
$controlleruser = ''; // the user name for access to the UniFi Controller | ||
$controllerpassword = ''; // the password for access to the UniFi Controller | ||
$controllerurl = ''; // full url to the UniFi Controller, eg. 'https://22.22.11.11:8443' | ||
$controllerversion = ''; // the version of the Controller software, eg. '4.6.6' (must be at least 4.0.0) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
/** | ||
* Multi controller configuration | ||
* ============================== | ||
* Only modify and uncomment this section when NOT using the above Single controller configuration method. | ||
* The number of controllers that can be added is unlimited, just take care to correctly increment the | ||
* index values (0,1,2 etc.) | ||
* | ||
* Please remember to only have one of either two methods active! | ||
*/ | ||
/* | ||
$controllers[0] = [ | ||
'user' => '', // the user name for access to the UniFi Controller | ||
'password' => '', // the password for access to the UniFi Controller | ||
'url' => '', // full url to the UniFi Controller, eg. 'https://22.22.11.11:8443' | ||
'name' => '', | ||
'version' => '' // the version of the Controller software, eg. '4.6.6' (must be at least 4.0.0) | ||
]; | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
$controllers[1] = [ | ||
'user' => '', // the user name for access to the UniFi Controller | ||
'password' => '', // the password for access to the UniFi Controller | ||
'url' => '', // full url to the UniFi Controller, eg. 'https://22.22.11.11:8443' | ||
'name' => '', | ||
'version' => '' // the version of the Controller software, eg. '4.6.6' (must be at least 4.0.0) | ||
]; | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
$controllers[2] = [ | ||
'user' => '', // the user name for access to the UniFi Controller | ||
'password' => '', // the password for access to the UniFi Controller | ||
'url' => '', // full url to the UniFi Controller, eg. 'https://22.22.11.11:8443' | ||
'name' => '', | ||
'version' => '' // the version of the Controller software, eg. '4.6.6' (must be at least 4.0.0) | ||
]; | ||
*/ | ||
|
||
$controlleruser = ''; // the user name for access to the Unifi Controller | ||
$controllerpassword = ''; // the password for access to the Unifi Controller | ||
$controllerurl = ''; // full url to the Unifi Controller, eg. 'https://22.22.11.11:8443' | ||
$controllerversion = ''; // the version of the Controller software, eg. '4.6.6' (must be at least 4.0.0) | ||
$cookietimeout = '3600'; // time of inactivity in seconds, after which the PHP session cookie will be refreshed | ||
// after the cookie refresh the site and data collection will need to be selected again | ||
$theme = 'bootstrap'; /* your default theme of choice, pick one from the list below | ||
bootstrap, cerulean, cosmo, cyborg, darkly, flatly, journal, lumen, paper | ||
readable, sandstone, simplex, slate, spacelab, superhero, united, yeti | ||
*/ | ||
|
||
$theme = 'bootstrap'; // your default theme of choice, pick one from the list below: | ||
// bootstrap, cerulean, cosmo, cyborg, darkly, flatly, journal, lumen, paper | ||
// readable, sandstone, simplex, slate, spacelab, superhero, united, yeti | ||
|
||
$debug = false; // set to true (without quotes) to enable debug output to the browser and the PHP error log | ||
?> |
Oops, something went wrong.