src/Users.php
public function assignGroup($username, $add = null, $remove = null, $reason = null)
	{
		// Get the token.
		$token = $this->getToken($username, 'unblock');

		// Build the request path.
		$path = '?action=userrights';

		// Build the request data.
		$data = array(
			'username' => $username,
			'token'    => $token,
			'add'      => $add,
			'remove'   => $remove,
			'reason'   => $reason,
		);

		// Send the request.
		$response = $this->client->post($this->fetchUrl($path), $data);

		return $this->validateResponse($response);
	}
public function assignGroup($username, $add = null, $remove = null, $reason = null)
	{
		// Get the token.
		$token = $this->getToken($username, 'unblock');

		// Build the request path.
		$path = '?action=userrights';

		// Build the request data.
		$data = array(
			'username' => $username,
			'token'    => $token,
			'add'      => $add,
			'remove'   => $remove,
			'reason'   => $reason,
		);

		// Send the request.
		$response = $this->client->post($this->fetchUrl($path), $data);

		return $this->validateResponse($response);
	}
public function assignGroup ( $ username , $ add = null , $ remove = null , $ reason = null ) { // Get the token. $ token = $ this -> getToken ( $ username , 'unblock' ) ; // Build the request path. $ path = '?action=userrights' ; // Build the request data. $ data = array ( 'username' => $ username , 'token' => $ token , 'add' => $ add , 'remove' => $ remove , 'reason' => $ reason , ) ; // Send the request. $ response = $ this -> client -> post ( $ this -> fetchUrl ( $ path ) , $ data ) ; return $ this -> validateResponse ( $ response ) ; }
Method to assign a user to a group.

@param   string  $username  User name.
@param   array   $add       Add the user to these groups.
@param   array   $remove    Remove the user from these groups.
@param   string  $reason    Reason for the change.

@return  object

@since   1.0
Method to assign a user to a group .