/** * authorize cpanel * @param $testapi */ public function get_authorize($testapi = false) { if (!empty($this->host) && !empty($this->cpanelUser) && !empty($this->cpanelPass)) { try { $xmlapi = new xmlapi($this->host); #$xmlapi->hash_auth("root",$root_hash); $xmlapi->password_auth($this->cpanelUser, $this->cpanelPass); $xmlapi->set_port($this->port); $xmlapi->set_output("json"); $xmlapi->set_debug(1); $this->xmlapi = $xmlapi; if ($testapi) { return $xmlapi->listftp($this->cpanelUser); } } catch (Exception $e) { print_r($e); } } }