Commit Graph

46 Commits

Author SHA1 Message Date
malle-pietje
8acaa694ca - updated the README file
- updated @throws tags in the doc blocks to reflect the correct exception classes where necessary, in other cases "Exception" is mentioned
- minor changes
- bumped version to 2.0.2
2024-11-28 12:11:08 +01:00
malle-pietje
d81a371239 further improvements to the README.md file and the list_alarms.php example 2024-11-26 12:04:10 +01:00
malle-pietje
1f19891d90 updated the README file
updated the `examples/list_alarms.php` file to demonstrate Exception handling
2024-11-25 17:56:06 +01:00
malle-pietje
54ec631d4b added a new example demonstrating the change of site settings 2024-08-04 15:35:26 +02:00
malle-pietje
d66c3ddd75 API client class v1.1.81
- hotfix to address cookie issues in UniFi OS 3.2.7, reported by @tflatebo
- fixed minor typos
- minor code reformatting of the examples
- starting with this release, cookies are no longer supported when connecting to a UniFi OS-based controller
- added set_vlan_to_port.php example, contributed by @SamuelSchnelly, #203
- allow additional parameters in `create_wlan()`'s payload, contributed by @sgrodzicki, #191
2023-12-18 11:11:27 +01:00
malle-pietje
67d318ca91 - bumped version to class v1.1.80
- added generate_backup_site() method, contributed by @labo-jad
2023-03-28 12:19:29 +02:00
malle-pietje
310abc43b5 API client class v1.1.73
- minor spacing changes based on Scrutinizer feedback
- updated create_wlan() method/function to work with the new way of assigning a VLAN which now requires passing the _id value
of the VLAN, reported by @BeneReuthlinger
- merged #132, README update, contributed by @pauloboc
- merged #133, adds edit_client_name() method, contributed by @pauloboc
2021-10-23 11:14:25 +02:00
malle-pietje
13b6699889 API client class v1.1.71
- modified `create_radius_account()` method to make Tunnel Type and Medium optional parameters, contributed by @mreho
- added `advanced_adopt_device()` method for more advanced adoption capabilities, contributed by @Sarrus
- refactored several code sections
- updated connection test script
2021-09-29 10:41:39 +02:00
malle-pietje
bf3446bba0 API client class v1.1.64
- added information to several docblocks
- changed handling of request headers, added private property for this
- applied changes for improved use of require_once in the README and examples
- added `list_sites()` example
- *potential breaking changes:*
    renamed `get_request_type()` and `set_request_type()` functions/methods to `get_request_method()` and `set_request_method()` respectively
2021-01-21 10:59:27 +01:00
malle-pietje
c82481a28a API client class v1.1.62
- added several monthly stats methods: `stat_monthly_gateway()`, `stat_monthly_site()`, `stat_monthly_aps()`, `stat_monthly_user()`, thanks go to @Roel Janssens for spotting these MongoDB collections
- test for `object` or `resource` in `get_curl_resource()`, closes PR #82 submitted by @banakito
- applied change to comments in `example/modify_smartpower_pdu_outlet.php` based on a suggestion by @thesohoguy
- removed unnecessary variable from `list_apgroups()`, thanks go to Stephen Davies for reporting
- added an optional parameter $ap_group_ids to the `create_wlan()` function/method for UniFi controller versions 6.0.X and higher, thanks go to Stephen Davies for contributing
2020-12-10 14:52:39 +01:00
malle-pietje
d26cba1f66 API client class v1.1.58
- changed several references from UniFi SDN controller to UniFi Network controller
- added optional payload parameter to the list_alarms() method/function, contributed by @MikeSiekkinen through PR #68
- added example showing how to disable/enable a UniFi switch port
- updated restart_device() function/method, thanks go to @leonardogyn for reporting this
- added example to modify outlet settings on a UniFi SmartPower PDU Pro, thanks go to @panthergm for providing access
2020-10-22 14:23:29 +02:00
malle-pietje
49d0986bd7 API client class v1.1.51
- updated README with all getter and setter methods/functions
- updated get_cookies() and get_cookie() for consistency
- get_cookie() remains for backward compatibility only, should not be used in new code
- fix rare cases where the client would end up in a loop, e.g. issuing a request for a site the cached credentials have no
access to
2020-03-19 16:07:31 +01:00
malle-pietje
903d3e47d5 API client class v1.1.49
- improvements to internal use of $_SESSION['unificookie']
- other minor code improvements
- applies several applied patches as suggested by scrutinizer-ci.com
2020-02-07 08:27:39 +01:00
malle-pietje
17d895076f API client class v1.1.47
- applied patches to update_switch_poe-mode.php as suggested by scrutinizer-ci.com
- code clean up and improvements in preparation of support for UniFi OS-based controllers
- added support for UniFi OS-based controllers, thanks to @Scyto for providing access
- adapt login route and method, and base URL for UniFi OS-based controllers
- automatically identify UniFi OS-based controllers, thanks to @TwitchCaptain for this and several other suggestions
- relaxed URL validation to allow UniFi OS-based controllers to pass
- changed default HTTP method to GET
- many improvements throughout the code
2020-02-06 08:52:49 +01:00
malle-pietje
796ad9a82d code cleanup and improvements in preparation of support for UniFi OS-based controllers 2020-02-04 07:41:43 +01:00
malle-pietje
a3fc0732e2 API client class v1.1.46
- applied patches to update_switch_poe-mode.php as suggested by scrutinizer-ci.com
- placed warning that UniFI OS is not (yet) supported
2020-01-31 12:14:52 +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
5389f3a486 API client class v1.1.37
updated both READMEs
added cmd_stat() function, can currently only be used to reset DPI counters for the current site
added optional group_id parameter to list_firewallgroups() which allows you to select a single firewall group, thanks to @VWT-Dan for the suggestion
2018-11-05 12:18:10 +01:00
malle-pietje
7c6cd4eb85 removed and added spaces, and changed brackets usage following PSR-2 guidelines 2018-10-02 13:16:48 +02:00
malle-pietje
2c035878ed - added stat_speedtest_results() method/function to collect results from scheduled speed tests
- added list_backups() method/function to list auto backups
2018-08-28 14:44:49 +02:00
malle-pietje
6f1b75b89a updated comments for stats-related methods/function to make clear start/end values must be provided in milliseconds
changed use of objects as payload input for json_encode, to associative arrays for consistency
added functions/methods for firewall groups: list_firewallgroups(), create_firewallgroup(), edit_firewallgroup(), delete_firewallgroup()
added checks for required boolean parameters
2018-08-19 12:00:19 +02:00
malle-pietje
871ab82608 added user/client device stats methods/functions:
stat_5minutes_user()
stat_hourly_user()
stat_daily_user()
added example to demonstrate use of these new functions
2018-07-02 15:06:31 +02:00
malle-pietje
4dddd08d8b added unblock_list.php and block_list.php examples, contributed by @malcolmcif
added create_user() method/function
added forget_sta() method/function which is supported on controller version 5.9.* and higher
2018-05-21 13:06:50 +02:00
malle-pietje
d7827fdbf1 General code cleanup (replace tabs by spaces, etc.)
Finalised merge of PRs #10, #11, #12 and #13
Methods/functions added:
- list_country_codes()
- set_guestlogin_settings_base()
- set_site_connectivity()
- set_site_country()
- set_site_guest_access()
- set_site_locale()
- set_site_mgmt()
- set_site_name()
- set_site_ntp()
- set_site_snmp()
Examples added:
- ap_upgrade_firmware.php
- site_provisioning_example
- update_ac-iw_ports.php
2018-03-24 10:46:42 +01:00
malle-pietje
2c45d95965 Merge branch 'master' of github.com:Art-of-WiFi/UniFi-API-client
merge PRs
2018-03-24 09:29:50 +01:00
malle-pietje
ad21ebaad8 added example to change AC-IW port config
renamed update_wlan_settings_5.5.X.php to update_device_wlan_settings_5.5.X.php
2018-03-24 09:28:25 +01:00
Seth Mos
4532df8eac - Foreach the array to verify if we really need to update the settings so we only trigger for real updates. (#13)
- Move Test array settings down so you don't accidentally delete sites
- Don't delete sites in debug mode.
- Automatically adopt device if it matches the configured LAN settings, ofcourse this only works correctly when LAN settings are unique between sites.
2018-03-19 23:22:24 +01:00
4oo4
93d78b2f22 Add ap_upgrade_firmware.php to Examples (#12)
- add ap_upgrade_firmware.php, contributed by @4oo4
2018-03-18 14:28:40 +01:00
Seth Mos
9f5aaa9838 Add a few more function for setting site specific parameters. It was neccesary to create several setting functions
for setting the information, although the site configuration is returned whole as one object.

I also added a provisioning example that I use with our internal ERP that automatically creates, updates and deletes sites according to internal ERP
site information. I added a settings template that has a couple of the most useful defaults, like auto upgrade, country and locale.
2018-03-13 13:39:38 +01:00
malle-pietje
14f4d58b02 minor bugs removed from two examples 2018-02-01 17:11:05 +01:00
malle-pietje
f6201ec21c minor changes
added an example to update WLAN settings for recent controllers (5.5.X and higher)
2018-02-01 16:56:17 +01:00
malle-pietje
c25f4d1937 Update disable_device.php 2017-10-20 09:25:59 +02:00
malle-pietje
e3e70cce72 fixed bug caused by typo with "if (in_array()..." 2017-10-19 11:53:04 +02:00
malle-pietje
cc486f652d fixed typo in examples/change_wlan_password.php 2017-10-06 12:55:44 +02:00
malle-pietje
008280e870 minor code cleanup and various changes:
- added a 6th parameter to the constructor to enable SSL cert verification, recommended for production environments
- added examples/change_wlan_password.php to demonstrate WLAN password/PSK change
- updated main README accordingly
2017-10-06 12:46:07 +02:00
malle-pietje
971c77ab5f various tweaks and an addition
- more relaxed handling of $site in set_site(), now we only issue an error message when provided (short) site name is probably incorrect and debug mode is
true
- added test_connection.php, a command line script which can be used to quickly test the connection to your controller with various cURL options which you can
quickly change
2017-09-14 12:15:21 +02:00
malle-pietje
efa6704c97 minor changes to examples and README for consistency 2017-09-07 12:31:47 +02:00
Erik Slooff
cd24ef1c2c updated examples to use the composer autoloader 2017-09-05 13:04:11 +02:00
Erik Slooff
508dde33f0 initial commit 2017-09-05 11:48:35 +02:00