/** * Connect to FTP * * @return Object */ function _connect() { if ($this->ftp_info->ftp_host) { $ftp_host = $this->ftp_info->ftp_host; } else { $ftp_host = "127.0.0.1"; } $this->oFtp = new ftp(); if (!$this->oFtp->ftp_connect($ftp_host, $this->ftp_info->ftp_port)) { return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_host)); } if (!$this->oFtp->ftp_login($this->ftp_info->ftp_user, $this->ftp_password)) { $this->_close(); return new Object(-1, 'msg_ftp_invalid_auth_info'); } $_SESSION['ftp_password'] = $this->ftp_password; return new Object(); }