/** * RemoteApacheTool constructor * * @param string $host SSH Host * @param string $port SSH port * @param string $username SSH login * @param string $password SSH password */ function __construct ($host, $port, $authinfo) { parent::__construct(); $this->Authinfo = $authinfo; // SSH2 $this->SSH2 = new SSH2(); if ($this->Authinfo["type"] == "password") $this->SSH2->AddPassword($this->Authinfo["login"], $this->Authinfo["password"]); elseif ($this->Authinfo["type"] == "pubkey") $this->SSH2->AddPubkey($this->Authinfo["login"], $this->Authinfo["pubkey_path"], $this->Authinfo["privkey_path"], $this->Authinfo["key_pass"]); if (!$this->SSH2->Connect($host, $port, $username, $password)) Core::RaiseWarning("RemoteApacheTool: SSH2 connection failed"); /* $this->conf = $this->SSH2->Exec("/bin/cat {$this->ConfPath}"); if (!$this->conf || !strlen($this->conf)>0) { $this->RaiseError("Cannot open HTTPD conf!"); return false; } */ }
/** * Connect to SSH Server * * @access private * @return bool * @return bool */ private function Connect() { if (!$this->SSHConnection->Connect($this->SSHHost, $this->SSHPort)) Core::RaiseError(sprintf(_("Transports/SSHTransport: Cannot connect to %s:%s."), $this->SSHHost, $this->SSHPort)); else return true; }
/** * Constructor * * @param string $host * @param integer $port * @param array $authinfo * @param string $ventrilo_path * @param string $config_template * @param integer $vport * @return bool */ function __construct ($host, $port, $login, $password, $ventrilo_path, $config_template, $vport) { parent::__construct(); $this->VentriloPath = $ventrilo_path; $this->ConfigTemplate = $config_template; $this->SSH2 = new SSH2(); if (!$this->SSH2->Connect($host, $port, $login, $password)) { Core::RaiseWarning(_("Cannot connect to remote server")); return false; } $this->Port = $vport; return true; }
function __construct($host, $port, $login, $password, $sc_path, $accounts_dir, $skeleton_dir) { parent::__construct(); $this->ShoutcastDir = $sc_path; $this->AccountsDir = $accounts_dir; $this->SkeletonDir = $skeleton_dir; $this->SSH2 = new SSH2(); if (!$this->SSH2->Connect($host, $port, $login, trim($password))) { Core::RaiseWarning(_("Cannot connect to remote server")); return false; } $this->SSHHost = $host; $this->SSHPort = $port; $this->SSHLogin = $login; $this->SSHPassword = trim($password); }
/** * Ventrilo Constructor * * @param string $host * @param integer $port * @param array $authinfo * @param string $ventrilo_path * @param string $config_template * @return bool */ function __construct ($host, $port, $login, $password, $ventrilo_path, $config_template) { parent::__construct(); $this->VentriloPath = $ventrilo_path; $this->ConfigTemplate = $config_template; $this->SSH2 = new SSH2(); if (!$this->SSH2->TestConnection($host, $port)) { Core::RaiseWarning(_("Cannot connect to remote server")); die(_("Cannot connect to remote server")); return false; } if (!$this->SSH2->Connect($host, $port, $login, trim($password))) { Core::RaiseWarning(_("Cannot connect to remote server")); die(_("Cannot connect to remote server")); return false; } $this->SSHHost = $host; $this->SSHPort = $port; $this->SSHLogin = $login; $this->SSHPassword = trim($password); return true; }