I am trying to user the CyberPanel API and PHP wrapper to delete a user.
I am able to create a new account using the create_new_account() member function. This automatically creates a new user if necessary. I can also delete that account with terminate_account().
Here is the code I am using, with the api.php file that has the CyberApi class.
$cyber = new CyberApi(); $params = array('serverusername'=>'admin', 'serverpassword'=>'[password]', 'serversecure'=>TRUE, 'serverhostname'=>'[IP]', 'serverport'=>'8090'); $params_more = array('domain'=>'somedomainname.com', 'clientsdetails'=>array('email'=>'[email]'), 'configoption1'=>'Default', 'username'=>'somedoma', 'password'=>'[userpassword]', 'configoption2'=>'user'); $params = array_merge($params, $params_more); //$result = $cyber->verify_connection($params); //$result = $cyber->create_new_account($params); $result = $cyber->terminate_account($params); print_r($result);
However, I couldn’t figure out if there’s an API function to delete the user. ‘somedoma’ in this case. I didn’t see anything about deleting users in the documentation, don’t see a delete user function in api.php.
Is there a way to delete users using the API?