public function testSFTP() { $config = array('host' => $this->getState('host'), 'port' => $this->getState('port'), 'user' => $this->getState('user'), 'pass' => $this->getState('pass'), 'privkey' => $this->getState('privkey'), 'pubkey' => $this->getState('pubkey'), 'initdir' => $this->getState('initdir')); // Perform the FTP connection test $test = new AEArchiverDirectsftp(); $test->initialize('', $config); $errors = $test->getWarnings(); if (empty($errors) || $test->connect_ok) { $result = true; } else { $result = $errors; } return $result; }
public function testSFTP() { $config = array('host' => $this->getState('host'), 'port' => $this->getState('port'), 'user' => $this->getState('user'), 'pass' => $this->getState('pass'), 'privkey' => $this->getState('privkey'), 'pubkey' => $this->getState('pubkey'), 'initdir' => $this->getState('initdir')); // Check for bad settings if (substr($config['host'], 0, 7) == 'sftp://') { return JText::_('CONFIG_SFTPTEST_BADPREFIX'); } // Perform the FTP connection test $test = new AEArchiverDirectsftp(); $test->initialize('', $config); $errors = $test->getWarnings(); if (empty($errors) || $test->connect_ok) { $result = true; } else { $result = $errors; } return $result; }