/** * Kill an Account * * Remove an account from the server * * @param ServerDBO $server The server the account is on * @param string $username The account's username */ public function killAccount(ServerDBO $server, $username) { $CPServerDBO = $this->getCPanelServerDBO($server); $result = killacct($server->getHostName(), $CPServerDBO->getUsername(), $CPServerDBO->getAccessHash(), false, $username); if (null == stristr($result, "Ftp vhost passwords synced")) { if (stristr($result, sprintf("Warning!.. system user %s does not exist!", $username))) { throw new SWUserException("[CPANEL_ACCOUNT_DOES_NOT_EXIST]"); } else { throw new SWUserException("[CPANEL_FAILED_TO_TERMINATE_ACCOUNT]: " . $result); } } }
function p_delete() { $result = killacct($this->server_cfg['host'], $this->server_cfg['account'], $this->server_cfg['accesshash'], $this->usessl, $this->service['host_username']); if ($this->server['debug']) { echo "<pre> {$result} </pre>"; } if (eregi("done", @$result)) { return true; } else { return false; } }