cleanup of merge conflicts
This commit is contained in:
@@ -784,18 +784,6 @@ class Client
|
||||
return $this->process_response($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* List user groups
|
||||
* ----------------
|
||||
* returns an array of user group objects
|
||||
*/
|
||||
public function list_usergroups()
|
||||
{
|
||||
if (!$this->is_loggedin) return false;
|
||||
$response = $this->exec_curl('/api/s/'.$this->site.'/list/usergroup');
|
||||
return $this->process_response($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign client device to another group
|
||||
* -------------------------------------
|
||||
@@ -811,6 +799,43 @@ class Client
|
||||
return $this->process_response_boolean($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update client fixedip (using REST)
|
||||
* ------------------------------
|
||||
* returns an array containing a single object with attributes of the updated client on success
|
||||
* required parameter <client_id> = id of the client
|
||||
* required parameter <use_fixedip> = boolean defining whether if use_fixedip is true or false
|
||||
* optional parameter <network_id> = network id where the ip belongs to
|
||||
* optional parameter <fixed_ip> = value of client's fixed_ip field
|
||||
*
|
||||
*/
|
||||
public function edit_client_fixedip($client_id, $use_fixedip, $network_id = null, $fixed_ip = null)
|
||||
{
|
||||
if (!$this->is_loggedin) return false;
|
||||
if (!is_bool($use_fixedip)) return false;
|
||||
$this->request_type = 'PUT';
|
||||
$data = ['_id' => $client_id, 'use_fixedip' => $use_fixedip];
|
||||
if($use_fixedip){
|
||||
if($network_id){ $data["network_id"] = $network_id; }
|
||||
if($fixed_ip){ $data["fixed_ip"] = $fixed_ip; }
|
||||
}
|
||||
$json = json_encode($data);
|
||||
$response = $this->exec_curl('/api/s/'.$this->site.'/rest/user/'.trim($client_id), $json);
|
||||
return $this->process_response($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* List user groups
|
||||
* ----------------
|
||||
* returns an array of user group objects
|
||||
*/
|
||||
public function list_usergroups()
|
||||
{
|
||||
if (!$this->is_loggedin) return false;
|
||||
$response = $this->exec_curl('/api/s/'.$this->site.'/list/usergroup');
|
||||
return $this->process_response($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create user group (using REST)
|
||||
* ---------------------------
|
||||
@@ -829,7 +854,7 @@ class Client
|
||||
}
|
||||
|
||||
/**
|
||||
* Update user group (using REST)
|
||||
* Modify user group (using REST)
|
||||
* ------------------------------
|
||||
* returns an array containing a single object with attributes of the updated usergroup on success
|
||||
* required parameter <group_id> = id of the user group
|
||||
@@ -837,7 +862,6 @@ class Client
|
||||
* required parameter <group_name> = name of the user group
|
||||
* optional parameter <group_dn> = limit download bandwidth in Kbps (default = -1, which sets bandwidth to unlimited)
|
||||
* optional parameter <group_up> = limit upload bandwidth in Kbps (default = -1, which sets bandwidth to unlimited)
|
||||
*
|
||||
*/
|
||||
public function edit_usergroup($group_id, $site_id, $group_name, $group_dn = -1, $group_up = -1)
|
||||
{
|
||||
@@ -849,43 +873,10 @@ class Client
|
||||
}
|
||||
|
||||
/**
|
||||
<<<<<<< HEAD
|
||||
* Delete user group (using REST)
|
||||
* ------------------------------
|
||||
* returns true on success
|
||||
* required parameter <group_id> = id of the user group
|
||||
=======
|
||||
* Update client fixedip (using REST)
|
||||
* ------------------------------
|
||||
* returns an array containing a single object with attributes of the updated client on success
|
||||
* required parameter <client_id> = id of the client
|
||||
* required parameter <use_fixedip> = boolean defining whether if use_fixedip is true or false
|
||||
* optional parameter <network_id> = network id where the ip belongs to
|
||||
* optional parameter <fixed_ip> = value of client's fixed_ip field
|
||||
*
|
||||
*/
|
||||
public function edit_client_fixedip($client_id, $use_fixedip, $network_id = null, $fixed_ip = null)
|
||||
{
|
||||
if (!$this->is_loggedin) return false;
|
||||
$this->request_type = 'PUT';
|
||||
$data = ['_id' => $client_id, 'use_fixedip' => $use_fixedip];
|
||||
if($use_fixedip){
|
||||
if($network_id){ $data["network_id"] = $network_id; }
|
||||
if($fixed_ip){ $data["fixed_ip"] = $fixed_ip; }
|
||||
}
|
||||
$json = json_encode($data);
|
||||
$response = $this->exec_curl('/api/s/'.$this->site.'/rest/user/'.trim($client_id), $json);
|
||||
return $this->process_response($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create user group (using REST)
|
||||
* ---------------------------
|
||||
* returns an array containing a single object with attributes of the new usergroup ("_id", "name", "qos_rate_max_down", "qos_rate_max_up", "site_id") on success
|
||||
* required parameter <group_name> = name of the user group
|
||||
* optional parameter <group_dn> = limit download bandwidth in Kbps (default = -1, which sets bandwidth to unlimited)
|
||||
* optional parameter <group_up> = limit upload bandwidth in Kbps (default = -1, which sets bandwidth to unlimited)
|
||||
>>>>>>> 287c67c39e9480e0d2edc5635f9c2c820dedbe92
|
||||
*/
|
||||
public function delete_usergroup($group_id)
|
||||
{
|
||||
@@ -927,7 +918,7 @@ class Client
|
||||
}
|
||||
|
||||
/**
|
||||
* Update firewall group (using REST)
|
||||
* Modify firewall group (using REST)
|
||||
* ----------------------------------
|
||||
* returns an array containing a single object with attributes of the updated firewall group on success
|
||||
* required parameter <group_id> = _id value of the firewall group
|
||||
@@ -1876,9 +1867,9 @@ class Client
|
||||
* List network settings (using REST)
|
||||
* ----------------------------------
|
||||
* returns an array of (non-wireless) networks and their settings
|
||||
* optional parameter <network_id> = string; network id to get specific network data
|
||||
* optional parameter <network_id> = string; network id to get specific network data for
|
||||
*/
|
||||
public function list_networkconf($network_id = "")
|
||||
public function list_networkconf($network_id = '')
|
||||
{
|
||||
if (!$this->is_loggedin) return false;
|
||||
$response = $this->exec_curl('/api/s/'.$this->site.'/rest/networkconf/'.trim($network_id));
|
||||
|
||||
Reference in New Issue
Block a user