$host"; return $error; } $login = @ftp_login($conn, $name, $pass); if(!$login) { $error = "Invalid username or password for FTP connection to $host"; return $error; } } return true; } function store_server_login($type, $name, $pass, $host) { if(!defined('DB_PASSWORD')) return; $key = DB_PASSWORD; $bf = new Crypt_Blowfish($key); $data = base64_encode($bf->encrypt(serialize(array('type' => $type, 'name' => $name, 'pass' => $pass, 'host' => $host)))); alky_update_option('server_login', $data); } function get_server_login() { $bf = new Crypt_Blowfish(DB_PASSWORD); $login = unserialize($bf->decrypt(base64_decode(alky_get_option('server_login')))); return $login; } function connection_form() { $ftpchecked = ''; $sshchecked = ''; $uservalue = ''; $passvalue = ''; $hostvalue = $_SERVER['HTTP_HOST']; if(isset($_POST['server_login_type'])) { if($_POST['server_login_type'] == 'SSH') { $sshchecked = "checked='checked'"; } else { $ftpchecked = "checked='checked'"; } $uservalue = $_POST['server_login_user']; $passvalue = $_POST['server_login_pass']; $hostvalue = $_POST['server_login_host']; } elseif(!is_null($login = Alky_Admin_Options::get_server_login())) { if($login['type'] == 'SSH') { $sshchecked = "checked='checked'"; } else { $ftpchecked = "checked='checked'"; } $uservalue = $login['name']; $passvalue = $login['pass']; $hostvalue = $login['host']; } ?>

To manage permissions, Alchemy requires access to your account.
(You can chmod manually to avoid this.)

Type of Connection:

"; } else { echo "

FTP Details:

"; } ?> "; ?> "; ?> "; ?>
Username:
Password:
Host

Alchemy Options

Connection Details

connection_form(); ?>