Skip to content

Commit

Permalink
Merge branch 'pr58'
Browse files Browse the repository at this point in the history
fix merge conflicts
  • Loading branch information
malle-pietje committed Nov 20, 2018
2 parents 4d95ba9 + 5d78988 commit 45fb5a2
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 63 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -112,8 +112,9 @@ Alternatively you may choose to download the zip file and unzip it in your direc

### Configuration

- credentials for access to the UniFi Controller API need to be configured in the file named `config.template.php` which should be copied/renamed to `config.php` before using the UniFi API browser tool
- starting with API browser tool version 1.0.3 you can store **multiple controller configurations** in a single `config.php` file
- credentials for access to the UniFi Controller API can be configured, in part or in whole, in the file named `config.template.php` which should be copied/renamed to `config.php`
- starting with API browser tool version 1.0.34, if all or a portion of the credentials are not specified in the `config.php` file or this file is not present, then a login form will ask for the missing credential information
- starting with version 1.0.3, you can store **multiple controller configurations** in an array inside the `config.php` file
- please refer to the comments in the `config.template.php` file for further instructions
- after following these steps, you can open the tool in your browser (assuming you installed it in the root folder of your web server as suggested above) by going to this url: `http(s)://<server IP address>/UniFi-API-browser/`

Expand Down
6 changes: 3 additions & 3 deletions TODO.md
Expand Up @@ -11,9 +11,9 @@
- could be combined with the DataTables output option
- will require "flattening" of multidimensional arrays/objects

3. Add simple user/password login
- consider setting user name/password in the config file, though not very secure
- avoid dependencies such as MySQL etc. as much as possible
3. ~~Add simple user/password login~~
- ~~consider setting user name/password in the config file, though not very secure~~
- ~~avoid dependencies such as MySQL etc. as much as possible~~

### Call for suggestions

Expand Down
39 changes: 27 additions & 12 deletions config.template.php
Expand Up @@ -7,15 +7,24 @@
*
*/

/**
* Optionally copy/rename this configuration template file to config.php and store all or part of your credentials
*
* IMPORTANT NOTE:
* If credential information is not specified in this file, or the file is not copied to config.php,
* or only part of the credentials are provided, then the API browser will show a form to complete the login
*/

/**
* 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'
//$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'
//$controllername = ''; // name for this controller

/**
* Multi controller configuration
Expand All @@ -25,35 +34,41 @@
* index values (0,1,2 etc.)
*
* Please remember to only have one of either two methods active!
*
* IMPORTANT NOTE:
* If you use the multi controller method, then at least the 'name' value is required for each controller entry
*/
/*
$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' => '' // name for this controller which will be used in the dropdown menu
'name' => '' // REQUIRED: name for this controller which will be used in the dropdown menu
];
$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' => '' // name for this controller which will be used in the dropdown menu
'name' => '' // REQUIRED: name for this controller which will be used in the dropdown menu
];
$controllers[2] = [
'user' => 'demo', // the user name for access to the Unifi Controller
'password' => 'demo', // the password for access to the Unifi Controller
'url' => 'https://demo.ubnt.com:443', // full url to the Unifi Controller, eg. 'https://22.22.11.11:8443'
'name' => 'demo.ubnt.com'
'name' => 'demo.ubnt.com' // REQUIRED: name for this controller which will be used in the dropdown menu
];
*/

$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
/**
* Optionally uncomment and change the default options below
*/
//$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
//$debug = false; // set to true (without quotes) to enable debug output to the browser and the PHP error log

0 comments on commit 45fb5a2

Please sign in to comment.