[Easymod-cvs] easymod2/mods/easymod/em_includes em_ftp.php,1.1,1.2
Status: Beta
Brought to you by:
wgeric
From: Jim W. <ter...@us...> - 2005-05-01 07:21:23
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22901/mods/easymod/em_includes Modified Files: em_ftp.php Log Message: Can now use arbitrary ports. Index: em_ftp.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_ftp.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** em_ftp.php 24 Apr 2005 14:59:53 -0000 1.1 --- em_ftp.php 1 May 2005 07:21:14 -0000 1.2 *************** *** 32,36 **** // used in step 2 of the installer to test the connection and also used in the debug feature; could be // used in the main proggie to check settings some day; it will need to be de-HTML'ed though ;-) ! function test_ftp( $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_debug, $ftp_type, $ftp_cache) { global $lang, $phpbb_root_path, $easymod_install_version ; --- 32,36 ---- // used in step 2 of the installer to test the connection and also used in the debug feature; could be // used in the main proggie to check settings some day; it will need to be de-HTML'ed though ;-) ! function test_ftp( $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_port, $ftp_debug, $ftp_type, $ftp_cache) { global $lang, $phpbb_root_path, $easymod_install_version ; *************** *** 42,52 **** // connect to the FTP server ! if (!$emftp->ftp_connect( $ftp_host)) { // failed to connect! echo "<br>\n" ; ! echo '<b>' . sprintf($lang['EM_ftp_fail_conn'], $ftp_host) . "</b><br>\n" ; ! // they made need to specify the host if ($ftp_host == 'localhost') { --- 42,52 ---- // connect to the FTP server ! if (!$emftp->ftp_connect( $ftp_host, $ftp_port)) { // failed to connect! echo "<br>\n" ; ! echo '<b>' . sprintf($lang['EM_ftp_fail_conn'], $ftp_host, $ftp_port) . "</b><br>\n" ; ! // they may need to specify the host if ($ftp_host == 'localhost') { *************** *** 54,57 **** --- 54,63 ---- } + // they may need to specify the port + else if ($ftp_port == 21) + { + echo $lang['EM_ftp_fail_conn_21'] . "<br>\n"; + } + // the host the entered failed to connect else *************** *** 64,67 **** --- 70,79 ---- } + // if they have anything other than an integer in the port then... + else if (intval($ftp_port) == $ftp_port) + { + echo $lang['EM_ftp_fail_conn_invalid2'] . "<br>\n"; + echo "<br>\n"; + } // give them options *************** *** 92,96 **** // check user/pass echo '<li>' . $lang['EM_fail_login_op1'] . "\n" ; ! if ( $ftp_host == 'localhost') { // change from localhost --- 104,108 ---- // check user/pass echo '<li>' . $lang['EM_fail_login_op1'] . "\n" ; ! if ( $ftp_host == 'localhost' || $ftp_port == 21) { // change from localhost *************** *** 151,155 **** echo '<li>' . $lang['EM_fail_cd_op4'] . "\n" ; ! if ($ftp_host == 'localhost') { echo '<li>' . $lang['EM_fail_cd_op5'] . "\n" ; --- 163,167 ---- echo '<li>' . $lang['EM_fail_cd_op4'] . "\n" ; ! if ($ftp_host == 'localhost' || $ftp_port == 21) { echo '<li>' . $lang['EM_fail_cd_op5'] . "\n" ; *************** *** 936,948 **** } ! function ftp_connect( $ftp_host) { if ($this->ftp_type == 'fsock') { ! return $this->ftp->ftp_connect( $ftp_host) ; } else { ! $this->ftp_conn_id = @ftp_connect( $ftp_host); return $this->ftp_conn_id ; } --- 948,960 ---- } ! function ftp_connect( $ftp_host, $ftp_port) { if ($this->ftp_type == 'fsock') { ! return $this->ftp->ftp_connect( $ftp_host, $ftp_port) ; } else { ! $this->ftp_conn_id = @ftp_connect( $ftp_host, $ftp_port); return $this->ftp_conn_id ; } |