sql_query($sql) ) { message_die(GENERAL_ERROR, $lang['EM_err_config_info'], '', __LINE__, __FILE__, $sql); } // loop through all the settings and assign the EM ones as appropriate while ( $row = $db->sql_fetchrow($result)) { if ( $row['config_name'] == 'EM_read') { $read = $row['config_value'] ; } else if ( $row['config_name'] == 'EM_write') { $write = $row['config_value'] ; } else if ( $row['config_name'] == 'EM_move') { $move = $row['config_value'] ; } else if ( $row['config_name'] == 'EM_ftp_dir') { $ftp_dir = $row['config_value'] ; } else if ( $row['config_name'] == 'EM_ftp_user') { $ftp_user = $row['config_value'] ; } else if ( $row['config_name'] == 'EM_ftp_pass') { $ftp_pass = $row['config_value'] ; } else if ( $row['config_name'] == 'EM_ftp_host') { $ftp_host = $row['config_value'] ; } else if ( $row['config_name'] == 'EM_ftp_type') { $ftp_type = $row['config_value'] ; } } // 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->decrypt($ftp_pass) ; // if we are in preview mode, then no matter what we will set to display to screen if ($preview) { $write = 'screen' ; $move = 'ftpm' ; } // easiest thing to do is return a mod_io object return new mod_io( $filename, $path, $read, $write, $move, $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_type) ; } // get our values $password = ( !empty($HTTP_POST_VARS['password']) ) ? htmlspecialchars($HTTP_POST_VARS['password']) : '' ; $mode = ( !empty($HTTP_POST_VARS['mode']) ) ? htmlspecialchars($HTTP_POST_VARS['mode']) : '' ; // use the SS css file to pretty things up; should work fine even if the css file is not found echo '' . "\n" ; // // update the EM settings; they already filled out the settings page and hit submit // if ($mode == 'update') { // password settings $em_pass = (isset($HTTP_POST_VARS['em_pass'])) ? htmlspecialchars( $HTTP_POST_VARS['em_pass']) : '' ; $em_pass_confirm = (isset($HTTP_POST_VARS['em_pass_confirm'])) ? htmlspecialchars( $HTTP_POST_VARS['em_pass_confirm']) : '' ; // ftp settings $ftp_pass = (isset($HTTP_POST_VARS['ftp_pass'])) ? htmlspecialchars( $HTTP_POST_VARS['ftp_pass']) : '' ; // confirm passwords match and update pw if needed if ( $em_pass == $em_pass_confirm) { // update the password; starting with 0.0.11 store as MD5 hash em_db_update( 'EM_password', md5($em_pass)) ; $pass_msg = ($em_pass == '') ? '(EM password disabled)' : '(EM password updated)' ; // 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 em_db_update( 'EM_ftp_pass', $ftp_pass) ; ?>
| Success |
|---|
|
Your EasyMOD settings have been updated successfully. You should now rename or delete empw.php to prevent unauthorized use. |
Try to remember it next time, ok? ;-)