-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fixed `create_radius_account()` method to make Tunnel Type and Medium optional parameters, reported by @CodeByJacob
- Loading branch information
1 parent
61bd2ed
commit 4fe1780
Showing
1 changed file
with
5 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
* | ||
* @package UniFi_Controller_API_Client_Class | ||
* @author Art of WiFi <[email protected]> | ||
* @version Release: 1.1.77 | ||
* @version Release: 1.1.78 | ||
* @license This class is subject to the MIT license that is bundled with this package in the file LICENSE.md | ||
* @example This directory in the package repository contains a collection of examples: | ||
* https://github.com/Art-of-WiFi/UniFi-API-client/tree/master/examples | ||
|
@@ -26,7 +26,7 @@ class Client | |
* NOTE: | ||
* do not modify the values here, instead use the constructor or the getter and setter functions/methods | ||
*/ | ||
const CLASS_VERSION = '1.1.77'; | ||
const CLASS_VERSION = '1.1.78'; | ||
protected $baseurl = 'https://127.0.0.1:8443'; | ||
protected $user = ''; | ||
protected $password = ''; | ||
|
@@ -3043,9 +3043,9 @@ public function list_radius_accounts() | |
*/ | ||
public function create_radius_account($name, $x_password, $tunnel_type = null, $tunnel_medium_type = null, $vlan = null) | ||
{ | ||
$tunnel_types = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]; | ||
$tunnel_medium_types = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; | ||
if ((!is_null($tunnel_type) && !in_array($tunnel_type, $tunnel_types)) || (!is_null($tunnel_medium_type) && !in_array($tunnel_medium_type, $tunnel_medium_types)) || ($tunnel_type ^ $tunnel_medium_type)) { | ||
$tunnel_type_values = [null, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]; | ||
$tunnel_medium_type_values = [null, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; | ||
if (!in_array($tunnel_type, $tunnel_type_values) || !in_array($tunnel_medium_type, $tunnel_medium_type_values) || ($tunnel_type xor $tunnel_medium_type)) { | ||
return false; | ||
} | ||
|
||
|