[Easymod-cvs] easymod2/mods/easymod/includes admin_easymod.php.txt,1.20,1.21
Status: Beta
Brought to you by:
wgeric
From: Eric F. <wg...@us...> - 2005-07-08 00:23:06
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5248/mods/easymod/includes Modified Files: admin_easymod.php.txt Log Message: ftp bug fixes, ended up making it so that it deletes the file before moving it into place, this could cause problems Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** admin_easymod.php.txt 3 Jul 2005 02:42:19 -0000 1.20 --- admin_easymod.php.txt 8 Jul 2005 00:22:56 -0000 1.21 *************** *** 46,49 **** --- 46,50 ---- // $phpbb_root_path = './../'; + $script_path = 'admin/'; require($phpbb_root_path . 'extension.inc'); *************** *** 944,948 **** // ftp settings $ftp_user = (isset($HTTP_POST_VARS['ftp_user'])) ? htmlspecialchars( $HTTP_POST_VARS['ftp_user']) : '' ; ! $ftp_pass = (isset($HTTP_POST_VARS['ftp_pass']) && !empty($HTTP_POST_VARS['ftp_pass'])) ? htmlspecialchars( $HTTP_POST_VARS['ftp_pass']) : $command_file->ftp_pass ; $ftp_host = (isset($HTTP_POST_VARS['ftp_host'])) ? htmlspecialchars( $HTTP_POST_VARS['ftp_host']) : '' ; $ftp_port = (isset($HTTP_POST_VARS['ftp_port'])) ? intval( $HTTP_POST_VARS['ftp_port']) : 0 ; --- 945,949 ---- // ftp settings $ftp_user = (isset($HTTP_POST_VARS['ftp_user'])) ? htmlspecialchars( $HTTP_POST_VARS['ftp_user']) : '' ; ! $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']) : '' ; $ftp_port = (isset($HTTP_POST_VARS['ftp_port'])) ? intval( $HTTP_POST_VARS['ftp_port']) : 0 ; *************** *** 952,959 **** $ftp_dir == ( $ftp_dir == '') ? '/' : $ftp_dir ; - // if user is removing ftp server, then remove the password as well - $ftp_pass = ( !empty($ftp_host) ) ? $ftp_pass : ''; - - // confirm passwords match and update pw if needed if ( $em_pass == $em_pass_confirm) --- 953,956 ---- *************** *** 962,965 **** --- 959,963 ---- em_db_update( 'EM_password', md5($em_pass)) ; $pass_msg = ($em_pass == '') ? $lang['EM_pass_disabled'] : $lang['EM_pass_updated'] ; + $force_ftp_pass = true; } // the confirm is empty so they are not trying to update the pw, so don't *************** *** 967,970 **** --- 965,969 ---- { $pass_msg = $lang['EM_pass_not_updated'] ; + $force_ftp_pass = false; } // passwords do not match so throw an error *************** *** 974,982 **** } - // decrypt the FTP password - include($phpbb_root_path . '/admin/em_includes/em_cipher.php') ; - $cipher = new Cipher_BlockMode_cbc(); - $cipher->blowfish->setKey( $em_pass); - $ftp_pass = $cipher->encrypt( $ftp_pass) ; // update the settings --- 973,976 ---- *************** *** 986,990 **** em_db_update( 'EM_ftp_dir', $ftp_dir) ; em_db_update( 'EM_ftp_user', $ftp_user) ; ! em_db_update( 'EM_ftp_pass', $ftp_pass) ; em_db_update( 'EM_ftp_host', $ftp_host) ; em_db_update( 'EM_ftp_port', $ftp_port) ; --- 980,995 ---- em_db_update( 'EM_ftp_dir', $ftp_dir) ; em_db_update( 'EM_ftp_user', $ftp_user) ; ! ! if ( $force_ftp_pass || !empty($ftp_pass) ) ! { ! // decrypt the FTP password ! include($phpbb_root_path . '/admin/em_includes/em_cipher.php') ; ! $cipher = new Cipher_BlockMode_cbc(); ! $cipher->blowfish->setKey( $em_pass); ! $ftp_pass = $cipher->encrypt( $ftp_pass) ; ! ! em_db_update( 'EM_ftp_pass', $ftp_pass) ; ! } ! em_db_update( 'EM_ftp_host', $ftp_host) ; em_db_update( 'EM_ftp_port', $ftp_port) ; *************** *** 1197,1201 **** { // display confirm and move the backups into place ! message_die(GENERAL_MESSAGE, $lang['Coming_soon']); } --- 1202,1206 ---- { // display confirm and move the backups into place ! message_die(GENERAL_ERROR, $lang['Coming_soon']); } *************** *** 1207,1211 **** { // list which languages so user can choose and go through install process ! message_die(GENERAL_MESSAGE, $lang['Coming_soon']); } --- 1212,1216 ---- { // list which languages so user can choose and go through install process ! message_die(GENERAL_ERROR, $lang['Coming_soon']); } *************** *** 1217,1221 **** { // list which themes so user can choose and go through install process ! message_die(GENERAL_MESSAGE, $lang['Coming_soon']); } --- 1222,1226 ---- { // list which themes so user can choose and go through install process ! message_die(GENERAL_ERROR, $lang['Coming_soon']); } *************** *** 1224,1228 **** // uninstall the mod // ! else if ( $mode == 'uninstall_mod' ) { message_die(GENERAL_MESSAGE, $lang['Coming_soon']); --- 1229,1233 ---- // uninstall the mod // ! else if ( $mode == 'unistall_mod' ) { message_die(GENERAL_MESSAGE, $lang['Coming_soon']); *************** *** 2147,2153 **** { // check to see if the file exists ! if ( !file_exists($targ['path'] . $targ['file']) ) { ! display_error( '<b>' . $lang['EM_err_error'] . "</b><br /><br />\n" . sprintf($lang['EM_err_comm_copy'], $targ['path'], $targ['file']) . '<br />' . trim($body[$i][$j]) . "<br />\n" . $lang['EM_line_num'] .$commands[$i]['line']); $bad_copy = true ; } --- 2152,2158 ---- { // check to see if the file exists ! if ( !file_exists($install_path . $targ['path'] . $targ['file']) ) { ! display_error( '<b>' . $lang['EM_err_critical_error'] . "</b><br /><br />\n" . sprintf($lang['EM_err_comm_copy'], $install_path . $targ['path'], $targ['file']) . '<br />' . trim($body[$i][$j]) . "<br />\n" . $lang['EM_line_num'] .$commands[$i]['line']); $bad_copy = true ; } *************** *** 2965,2969 **** // write the command files $command_file = get_em_settings( 'post_process.sh', '', $password, $preview) ; ! $command_bat = new mod_io( 'post_process.bat', '', $command_file->read_method, $command_file->write_method, $command_file->move_method, $command_file->ftp_user, $command_file->ftp_pass, $command_file->ftp_dir, $command_file->ftp_host, $command_file->ftp_port, $command_file->ftp_type, $command_file->ftp_cache) ; // open the command file: config=true,command=true --- 2970,2974 ---- // write the command files $command_file = get_em_settings( 'post_process.sh', '', $password, $preview) ; ! $command_bat = new mod_io( 'post_process.bat', '', $command_file->read_method, $command_file->write_method, $command_file->move_method, $command_file->ftp_user, $command_file->ftp_pass, $command_file->ftp_path, $command_file->ftp_host, $command_file->ftp_port, $command_file->ftp_type, $command_file->ftp_cache) ; // open the command file: config=true,command=true |