[Easymod-cvs] easymod2/mods/easymod easymod_install.php,1.4,1.5
Status: Beta
Brought to you by:
wgeric
From: Jim W. <ter...@us...> - 2005-05-01 07:18:52
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21268/mods/easymod Modified Files: easymod_install.php Log Message: Added FTP Port option. Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** easymod_install.php 29 Apr 2005 00:50:26 -0000 1.4 --- easymod_install.php 1 May 2005 07:18:42 -0000 1.5 *************** *** 22,47 **** define('IN_PHPBB', 1); $phpbb_root_path = './../../../'; ! $script_path = 'admin/mods/easymod/' ; //// $easymod_install_version = '0.1.13' ; //// - // PHP5 with register_long_arrays off? - if (!isset($HTTP_POST_VARS) && isset($_POST)) - { - $HTTP_POST_VARS = $_POST; - $HTTP_GET_VARS = $_GET; - $HTTP_SERVER_VARS = $_SERVER; - $HTTP_COOKIE_VARS = $_COOKIE; - $HTTP_ENV_VARS = $_ENV; - $HTTP_POST_FILES = $_FILES; - - // _SESSION is the only superglobal which is conditionally set - if (isset($_SESSION)) - { - $HTTP_SESSION_VARS = $_SESSION; - } - } - include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'config.'.$phpEx); --- 22,30 ---- define('IN_PHPBB', 1); $phpbb_root_path = './../../../'; ! $script_path = 'admin/mods/easymod' ; //// $easymod_install_version = '0.1.13' ; //// include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'config.'.$phpEx); *************** *** 273,276 **** --- 256,260 ---- $ftp_pass = (isset($HTTP_POST_VARS['ftp_pass'])) ? htmlspecialchars( $HTTP_POST_VARS['ftp_pass']) : '' ; $ftp_host = (isset($HTTP_POST_VARS['ftp_host'])) ? htmlspecialchars( $HTTP_POST_VARS['ftp_host']) : 'localhost' ; + $ftp_port = (isset($HTTP_POST_VARS['ftp_port'])) ? htmlspecialchars( $HTTP_POST_VARS['ftp_port']) : 21 ; $ftp_debug = (isset($HTTP_POST_VARS['ftp_debug'])) ? intval( $HTTP_POST_VARS['ftp_debug']) : false ; $ftp_type = (isset($HTTP_POST_VARS['ftp_type'])) ? htmlspecialchars( $HTTP_POST_VARS['ftp_type']) : 'fsock' ; *************** *** 336,339 **** --- 320,324 ---- $ftp_pass = (isset($HTTP_GET_VARS['ftp_pass'])) ? htmlspecialchars( $HTTP_GET_VARS['ftp_pass']) : $ftp_pass ; $ftp_host = (isset($HTTP_GET_VARS['ftp_host'])) ? htmlspecialchars( $HTTP_GET_VARS['ftp_host']) : $ftp_host ; + $ftp_port = (isset($HTTP_GET_VARS['ftp_port'])) ? htmlspecialchars( $HTTP_GET_VARS['ftp_port']) : $ftp_port ; $ftp_debug = (isset($HTTP_GET_VARS['ftp_debug'])) ? intval( $HTTP_GET_VARS['ftp_debug']) : $ftp_debug ; $ftp_type = (isset($HTTP_GET_VARS['ftp_type'])) ? htmlspecialchars( $HTTP_GET_VARS['ftp_type']) : $ftp_type ; *************** *** 542,546 **** { // test the FTP connection ! if (!test_ftp( $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_debug, $ftp_type, $ftp_cache)) { // FTP failed; print RESCAN button and then exit --- 527,531 ---- { // test the FTP connection ! if (!test_ftp( $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_port, $ftp_debug, $ftp_type, $ftp_cache)) { // FTP failed; print RESCAN button and then exit *************** *** 626,630 **** { // test the FTP connection ! if (!test_ftp( $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_debug, $ftp_type, $ftp_cache)) { // FTP failed; print RESCAN button and then exit --- 611,615 ---- { // test the FTP connection ! if (!test_ftp( $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_port, $ftp_debug, $ftp_type, $ftp_cache)) { // FTP failed; print RESCAN button and then exit *************** *** 692,695 **** --- 677,681 ---- $hidden .= "<input type=\"hidden\" name=\"ftp_pass\" value=\"$ftp_pass\">\n" ; $hidden .= "<input type=\"hidden\" name=\"ftp_host\" value=\"$ftp_host\">\n" ; + $hidden .= "<input type=\"hidden\" name=\"ftp_port\" value=\"$ftp_port\">\n" ; $hidden .= "<input type=\"hidden\" name=\"ftp_dir\" value=\"$ftp_dir\">\n" ; $hidden .= "<input type=\"hidden\" name=\"ftp_debug\" value=\"$ftp_debug\">\n" ; *************** *** 721,725 **** // we will keep the command file as an array for now and then write it out later; we will reuse the settings data ! $command_file = new mod_io( 'post_process.sh', '', $read, $write, $move, $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_type, $ftp_cache) ; --- 707,711 ---- // we will keep the command file as an array for now and then write it out later; we will reuse the settings data ! $command_file = new mod_io( 'post_process.sh', '', $read, $write, $move, $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_port, $ftp_type, $ftp_cache) ; *************** *** 945,948 **** --- 931,935 ---- $hidden .= "<input type=\"hidden\" name=\"ftp_dir\" value=\"$ftp_dir\">\n" ; $hidden .= "<input type=\"hidden\" name=\"ftp_host\" value=\"$ftp_host\">\n" ; + $hidden .= "<input type=\"hidden\" name=\"ftp_port\" value=\"$ftp_port\">\n" ; $hidden .= "<input type=\"hidden\" name=\"ftp_debug\" value=\"$ftp_debug\">\n" ; $hidden .= "<input type=\"hidden\" name=\"ftp_type\" value=\"$ftp_type\">\n" ; *************** *** 997,1002 **** case 'mysql4': $sql[] = "CREATE TABLE " . EASYMOD_TABLE . " ( ! mod_id mediumint(8) NOT NULL auto_increment, ! mod_title varchar(255) NULL DEFAULT '', mod_file varchar(255) NULL DEFAULT '', mod_version varchar(15) NULL DEFAULT '', --- 984,989 ---- case 'mysql4': $sql[] = "CREATE TABLE " . EASYMOD_TABLE . " ( ! mod_id mediumint(8) NOT NULL DEFAULT '0' auto_increment, ! mod_title varchar(50) NULL DEFAULT '', mod_file varchar(255) NULL DEFAULT '', mod_version varchar(15) NULL DEFAULT '', *************** *** 1190,1195 **** // we will keep the command file as an array for now and then write it out later; we will reuse the settings data ! $command_file = new mod_io( 'post_process.sh', '', $read, $write, $move, $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_type, $ftp_cache) ; ! $command_bat = new mod_io( 'post_process.bat', '', $read, $write, $move, $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_type, $ftp_cache) ; // open the command file: config=true,command=true --- 1177,1182 ---- // we will keep the command file as an array for now and then write it out later; we will reuse the settings data ! $command_file = new mod_io( 'post_process.sh', '', $read, $write, $move, $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_port, $ftp_type, $ftp_cache) ; ! $command_bat = new mod_io( 'post_process.bat', '', $read, $write, $move, $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_port, $ftp_type, $ftp_cache) ; // open the command file: config=true,command=true *************** *** 1362,1365 **** --- 1349,1353 ---- $hidden .= "<input type=\"hidden\" name=\"ftp_dir\" value=\"$ftp_dir\">\n" ; $hidden .= "<input type=\"hidden\" name=\"ftp_host\" value=\"$ftp_host\">\n" ; + $hidden .= "<input type=\"hidden\" name=\"ftp_port\" value=\"$ftp_port\">\n" ; $hidden .= "<input type=\"hidden\" name=\"ftp_debug\" value=\"$ftp_debug\">\n" ; $hidden .= "<input type=\"hidden\" name=\"ftp_type\" value=\"$ftp_type\">\n" ; *************** *** 1388,1392 **** header('Content-disposition: attachment; filename="privmsg.'.$phpEx . '"'); ! $file_test = new mod_io( 'privmsg.'.$phpEx, '', 'server', 'local', 'ftpm', '', '', '', $ftp_host, $ftp_type, $ftp_cache) ; $file_test->modio_open() ; --- 1376,1380 ---- header('Content-disposition: attachment; filename="privmsg.'.$phpEx . '"'); ! $file_test = new mod_io( 'privmsg.'.$phpEx, '', 'server', 'local', 'ftpm', '', '', '', $ftp_host, $ftp_port, $ftp_type, $ftp_cache) ; $file_test->modio_open() ; *************** *** 1519,1523 **** else { ! $command_file = new mod_io( 'temp.sh', '', 'server', 'local', 'ftpm', '', '', '', $ftp_host, $ftp_type, $ftp_cache) ; --- 1507,1511 ---- else { ! $command_file = new mod_io( 'temp.sh', '', 'server', 'local', 'ftpm', '', '', '', $ftp_host, $ftp_port, $ftp_type, $ftp_cache) ; *************** *** 1664,1668 **** // let 'em know what we are doing ! echo '<br><br><b>' . $lang['EM_confirm_admin'] . ":</b> admin_easymod.php<br>\n" ; // open admin_easymod.php for reading --- 1652,1656 ---- // let 'em know what we are doing ! echo '<br><br><b>' . $lang['EM_confirm_admin'] . ':</b> admin_easymod.php,v ' . $easymod_install_version . "<br>\n" ; // open admin_easymod.php for reading *************** *** 1675,1679 **** // read a line and see if it contains our key $line = fgets( $fin, 4096) ; ! if (strstr($line, 'admin_easymod.php')) { // print success and break out --- 1663,1667 ---- // read a line and see if it contains our key $line = fgets( $fin, 4096) ; ! if (strstr($line, 'admin_easymod.php,v ' . $easymod_install_version)) { // print success and break out *************** *** 1688,1692 **** if (!$found) { ! $error = $lang['EM_err_find'] . ' <b>admin_easymod.php</b> in [admin/admin_easymod.php].' ; display_error( $error) ; } --- 1676,1680 ---- if (!$found) { ! $error = $lang['EM_err_find'] . ' <b>admin_easymod.php,v ' . $easymod_install_version . '</b> in [admin/admin_easymod.php].' ; display_error( $error) ; } *************** *** 1768,1772 **** // added security starting in 0.0.11, blowfish encrypt the ftp_pass ! include($phpbb_root_path . $script_path . 'em_includes/em_cipher.php') ; $cipher = new Cipher_BlockMode_cbc(); $cipher->blowfish->setKey( $em_pass); --- 1756,1760 ---- // added security starting in 0.0.11, blowfish encrypt the ftp_pass ! include($phpbb_root_path . $script_path . '/em_includes/em_cipher.php') ; $cipher = new Cipher_BlockMode_cbc(); $cipher->blowfish->setKey( $em_pass); *************** *** 1785,1788 **** --- 1773,1777 ---- em_db_insert( 'EM_ftp_pass', $ftp_cipher) ; em_db_insert( 'EM_ftp_host', $ftp_host) ; + em_db_insert( 'EM_ftp_port', $ftp_port) ; em_db_insert( 'EM_ftp_type', $ftp_type) ; em_db_insert( 'EM_ftp_cache', $ftp_cache) ; *************** *** 1807,1810 **** --- 1796,1805 ---- } + // 0.0.14 and later see if we have already made the EM_ftp_port field + if (!add_new_config('EM_ftp_port', $ftp_port)) + { + handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_config_table']) ; + } + // 0.0.10c and later see if we have already made the EM_ftp_type field if (!add_new_config('EM_ftp_type', $ftp_type)) |