[Easymod-cvs] easymod2/mods/easymod/includes admin_easymod.php.txt,1.27,1.28 mod_complete.tpl,1.3,1.
Status: Beta
Brought to you by:
wgeric
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12963/mods/easymod/includes Modified Files: admin_easymod.php.txt mod_complete.tpl mod_history_details.tpl mod_install.tpl mod_preview.tpl mod_process.tpl mod_sql_body.tpl Log Message: A lot of little and not so little bug fixes affecting almost all files of the package. There is still a bit more work left to do on the ACP script to check correct use of stripslashes and also some issues related to the implementation of the new SQL Parser. Note the version number has already been changed to 0.2.2 Index: mod_process.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/mod_process.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mod_process.tpl 24 Apr 2005 14:59:53 -0000 1.1 --- mod_process.tpl 31 Oct 2005 17:57:15 -0000 1.2 *************** *** 6,10 **** <!-- BEGIN error --> ! <br> <table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0"> <tr> --- 6,10 ---- <!-- BEGIN error --> ! <br /> <table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0"> <tr> *************** *** 72,83 **** <input type="hidden" name="mode" value="SQL_view" /> {success.HIDDEN} ! <input type="hidden" name="themes" value="{THEMES}"> ! <input type="hidden" name="languages" value="{LANGUAGES}"> ! <input type="hidden" name="files" value="{FILES}"> ! <input type="hidden" name="num_proc" value="{PROCESSED}"> ! <input type="hidden" name="num_unproc" value="{UNPROCESSED}"> ! <input type="hidden" name="install_file" value="{success.MOD_FILE}"> ! <input type="hidden" name="install_path" value="{success.MOD_PATH}"> ! <input type="hidden" name="password" value="{EM_PASS}"> <input class="mainoption" type="submit" value="{success.L_NEXT_STEP}" /> </td> --- 72,83 ---- <input type="hidden" name="mode" value="SQL_view" /> {success.HIDDEN} ! <input type="hidden" name="themes" value="{THEMES}" /> ! <input type="hidden" name="languages" value="{LANGUAGES}" /> ! <input type="hidden" name="files" value="{FILES}" /> ! <input type="hidden" name="num_proc" value="{PROCESSED}" /> ! <input type="hidden" name="num_unproc" value="{UNPROCESSED}" /> ! <input type="hidden" name="install_file" value="{success.MOD_FILE}" /> ! <input type="hidden" name="install_path" value="{success.MOD_PATH}" /> ! <input type="hidden" name="password" value="{EM_PASS}" /> <input class="mainoption" type="submit" value="{success.L_NEXT_STEP}" /> </td> *************** *** 97,101 **** <!-- BEGIN unprocessed --> <tr> ! <td class="{unprocessed.ROW_CLASS}" align="left" height=25><span class="gen">{unprocessed.LINE}</span></td> </tr> <!-- END unprocessed --> --- 97,101 ---- <!-- BEGIN unprocessed --> <tr> ! <td class="{unprocessed.ROW_CLASS}" align="left" height="25"><div class="gen">{unprocessed.LINE}</div></td> </tr> <!-- END unprocessed --> *************** *** 114,121 **** <!-- BEGIN processed --> <tr> ! <td class="{processed.ROW_CLASS}" align="left" height=25><span class="gen">{processed.LINE}</span></td> </tr> <!-- END processed --> </table> </td></tr></table> ! <br> --- 114,121 ---- <!-- BEGIN processed --> <tr> ! <td class="{processed.ROW_CLASS}" align="left" height="25"><div class="gen">{processed.LINE}</div></td> </tr> <!-- END processed --> </table> </td></tr></table> ! <br /> Index: mod_sql_body.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/mod_sql_body.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mod_sql_body.tpl 12 Jun 2005 08:18:35 -0000 1.3 --- mod_sql_body.tpl 31 Oct 2005 17:57:15 -0000 1.4 *************** *** 61,72 **** </tr> <tr> ! <td width="100%" align="center"><span class="gen"><b>{L_SQL_HALTED}</b><br /> <br />{L_SQL_ERROR_EXPLAIN}<br /> <br /> {L_FAILED_LINE}:<br /> ! {sql_error.LINE}<br /> <br /> {L_SQL_ERROR}: {sql_error.ERROR_CODE}<br /> ! {sql_error.ERROR_MSG}</span></td> </tr> <tr> --- 61,72 ---- </tr> <tr> ! <td width="100%" align="center"><div class="gen"><b>{L_SQL_HALTED}</b><br /> <br />{L_SQL_ERROR_EXPLAIN}<br /> <br /> {L_FAILED_LINE}:<br /> ! <table cellpadding="4" border="0"><tr><td><pre style="text-align:left;">{sql_error.LINE}</pre></td></tr></table> <br /> {L_SQL_ERROR}: {sql_error.ERROR_CODE}<br /> ! {sql_error.ERROR_MSG}</div></td> </tr> <tr> *************** *** 156,160 **** <!-- BEGIN sql_row --> <tr> ! <td width="90%" class="{sql_row.ROW_CLASS}"> <span class="gen">{sql_row.DISPLAY_SQL}</span> </td> <td width="10%" align="center" class="{sql_row.ROW_CLASS}"> {sql_row.HIDDEN_SQL} --- 156,160 ---- <!-- BEGIN sql_row --> <tr> ! <td width="90%" class="{sql_row.ROW_CLASS}"><pre>{sql_row.DISPLAY_SQL}</pre></td> <td width="10%" align="center" class="{sql_row.ROW_CLASS}"> {sql_row.HIDDEN_SQL} *************** *** 167,181 **** <td class="catBottom" colspan="2" align="center" height="28"> {HIDDEN} ! <input type="hidden" name="mode" value="{MODE}"> ! <input type="hidden" name="SQL_lines" value="{SQL_LINES}"> ! <input type="hidden" name="themes" value="{THEMES}"> ! <input type="hidden" name="languages" value="{LANGUAGES}"> ! <input type="hidden" name="files" value="{FILES}"> ! <input type="hidden" name="num_proc" value="{PROCESSED}"> ! <input type="hidden" name="num_unproc" value="{UNPROCESSED}"> ! <input type="hidden" name="install_file" value="{MOD_FILE}"> ! <input type="hidden" name="install_path" value="{MOD_PATH}"> ! <input type="hidden" name="password" value="{EM_PASS}"> ! <input type="submit" name="post" class="mainoption" value="{L_COMPLETE}" /></center> </td> </tr> --- 167,181 ---- <td class="catBottom" colspan="2" align="center" height="28"> {HIDDEN} ! <input type="hidden" name="mode" value="{MODE}" /> ! <input type="hidden" name="SQL_lines" value="{SQL_LINES}" /> ! <input type="hidden" name="themes" value="{THEMES}" /> ! <input type="hidden" name="languages" value="{LANGUAGES}" /> ! <input type="hidden" name="files" value="{FILES}" /> ! <input type="hidden" name="num_proc" value="{PROCESSED}" /> ! <input type="hidden" name="num_unproc" value="{UNPROCESSED}" /> ! <input type="hidden" name="install_file" value="{MOD_FILE}" /> ! <input type="hidden" name="install_path" value="{MOD_PATH}" /> ! <input type="hidden" name="password" value="{EM_PASS}" /> ! <input type="submit" name="post" class="mainoption" value="{L_COMPLETE}" /> </td> </tr> Index: mod_preview.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/mod_preview.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mod_preview.tpl 24 Apr 2005 14:59:53 -0000 1.1 --- mod_preview.tpl 31 Oct 2005 17:57:15 -0000 1.2 *************** *** 9,14 **** <!-- BEGIN files --> <tr> ! <td class="row1" align="left" height=25><span class="gen">{files.NAME}</span> </td> ! <td class="row2" align="left" height=25><span class="gen"> <a href="{files.URL}" target="_blank">{L_VIEW}</a> </span></td> </tr> --- 9,14 ---- <!-- BEGIN files --> <tr> ! <td class="row1" align="left" height="25"><span class="gen">{files.NAME}</span> </td> ! <td class="row2" align="left" height="25"><span class="gen"> <a href="{files.URL}" target="_blank">{L_VIEW}</a> </span></td> </tr> *************** *** 18,24 **** <tr> <td class="row1" align="center" colspan="2" width="300"> ! <br> ! <span class="gen">{files.L_NO_FILES}</span><br> ! <br> </td> </tr> --- 18,24 ---- <tr> <td class="row1" align="center" colspan="2" width="300"> ! <br /> ! <span class="gen">{files.L_NO_FILES}</span><br /> ! <br /> </td> </tr> *************** *** 26,28 **** <!-- END nofiles --> </table> ! <br> --- 26,28 ---- <!-- END nofiles --> </table> ! <br /> Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** admin_easymod.php.txt 29 Jul 2005 17:33:08 -0000 1.27 --- admin_easymod.php.txt 31 Oct 2005 17:57:15 -0000 1.28 *************** *** 21,36 **** ***************************************************************************/ - define('IN_PHPBB', 1); - // entries to be displayed in the ACP index if (!empty($setmodules)) { ! if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_easymod.' . $phpEx)) ) ! { ! include($phpbb_root_path . 'language/lang_english/lang_easymod.' . $phpEx); ! } else ! { ! include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_easymod.' . $phpEx); ! } $file = basename(__FILE__); --- 21,35 ---- ***************************************************************************/ // entries to be displayed in the ACP index if (!empty($setmodules)) { ! if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_easymod.' . $phpEx)) ) ! { ! include($phpbb_root_path . 'language/lang_english/lang_easymod.' . $phpEx); ! } ! else ! { ! include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_easymod.' . $phpEx); ! } $file = basename(__FILE__); *************** *** 45,50 **** // Let's set the root dir for phpBB // $phpbb_root_path = './../'; - $script_path = 'admin/'; require($phpbb_root_path . 'extension.inc'); --- 44,49 ---- // Let's set the root dir for phpBB // + define('IN_PHPBB', 1); $phpbb_root_path = './../'; require($phpbb_root_path . 'extension.inc'); *************** *** 81,88 **** $mode = '' ; // make sure em_functions is where it needs to be or else the user will get a blank screen :roll: if (!file_exists($phpbb_root_path . 'admin/em_includes/em_functions.' . $phpEx)) { ! die('CRITICAL ERROR: could not find [' . $phpbb_root_path . 'admin/em_includes/em_functions.' . $phpEx . ']. Aborting.') ; } --- 80,97 ---- $mode = '' ; + // We need to set this one just after common.php has been loaded, otherwise it gets unset by the unregister_globals code in it! + $script_path = 'admin/'; + // make sure em_functions is where it needs to be or else the user will get a blank screen :roll: if (!file_exists($phpbb_root_path . 'admin/em_includes/em_functions.' . $phpEx)) { ! $message = 'CRITICAL ERROR: could not find [' . $phpbb_root_path . 'admin/em_includes/em_functions.' . $phpEx . ']. Aborting.'; ! if( !defined('IN_ADMIN') ) ! { ! // We can reach this point if pagestart has not been called, therefore we better close the DB and do a plain PHP die. ! $db->sql_close(); ! die($message); ! } ! message_die(GENERAL_ERROR, $message); } *************** *** 95,99 **** /// /// ! define('EASYMOD_VER', 'beta1 (0.2.1a)') ; define('FAQ_LINK', '<a href="http://area51.phpbb.com/phpBB/viewtopic.php?t=12141" target="_blank">') ; define('REPORT_LINK', '<a href="http://area51.phpbb.com/phpBB/viewtopic.php?t=12143" target="_blank">') ; --- 104,108 ---- /// /// ! define('EASYMOD_VER', 'beta1 (0.2.2)') ; define('FAQ_LINK', '<a href="http://area51.phpbb.com/phpBB/viewtopic.php?t=12141" target="_blank">') ; define('REPORT_LINK', '<a href="http://area51.phpbb.com/phpBB/viewtopic.php?t=12143" target="_blank">') ; *************** *** 189,204 **** if ( !($result = $db->sql_query($sql)) ) { ! return true ; ! } ! ! $row = $db->sql_fetchrow($result) ; ! if ( $row['mod_phpBB_version'] == $phpbb_version) ! { ! return false ; } ! else { ! return true ; } } --- 198,208 ---- if ( !($result = $db->sql_query($sql)) ) { ! return true; } ! if ( !$db->sql_fetchrow($result) ) { ! return true; } + return false; } *************** *** 629,634 **** // important! we are writing the file output to screen so the PRE tag will format it nicely for us ! echo '<style type="text/css"><!-- .preview {color:red; margin: 0px; padding: 0px} --></style>' . "\n" ; ! echo "<PRE>\n" ; } --- 633,647 ---- // important! we are writing the file output to screen so the PRE tag will format it nicely for us ! echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' . "\n" ! . '<html>' . "\n" ! . '<head>' . "\n" ! . '<title>' . $lang['EM_Title'] . '</title>' . "\n" ! . '<style type="text/css"><!--' . "\n" ! . 'pre.normal {color:black; margin:0px; padding:0px;}' . "\n" ! . 'pre.preview {color:red; margin:0px; padding:0px; font-weight:bold;}' . "\n" ! . '--></style>' . "\n" ! . '</head>' . "\n" ! . '<body>' . "\n" ! . '<pre class="normal">'; } *************** *** 751,755 **** if ( $process_file == '') { ! message_die(GENERAL_ERROR, $lang['EM_err_no_process_file'], '', __LINE__, __FILE__, $sql); } --- 764,768 ---- if ( $process_file == '') { ! message_die(GENERAL_ERROR, $lang['EM_err_no_process_file']); } *************** *** 798,802 **** if ( $process_file == '') { ! message_die(GENERAL_ERROR, $lang['EM_err_no_process_file'], '', __LINE__, __FILE__, $sql); } } --- 811,815 ---- if ( $process_file == '') { ! message_die(GENERAL_ERROR, $lang['EM_err_no_process_file']); } } *************** *** 934,939 **** { // 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']) : '' ; $em_version = (isset($HTTP_POST_VARS['em_version'])) ? htmlspecialchars( $HTTP_POST_VARS['em_version']) : '' ; --- 947,952 ---- { // password settings ! $em_pass = (isset($HTTP_POST_VARS['em_pass'])) ? stripslashes( $HTTP_POST_VARS['em_pass']) : '' ; ! $em_pass_confirm = (isset($HTTP_POST_VARS['em_pass_confirm'])) ? stripslashes( $HTTP_POST_VARS['em_pass_confirm']) : '' ; $em_version = (isset($HTTP_POST_VARS['em_version'])) ? htmlspecialchars( $HTTP_POST_VARS['em_version']) : '' ; *************** *** 954,958 **** // 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 --- 967,971 ---- // 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 *************** *** 968,972 **** } // passwords do not match so throw an error ! else if ( $em_pass != $em_pass_confirm) { message_die( GENERAL_ERROR, $lang['EM_err_set_pw']) ; --- 981,985 ---- } // passwords do not match so throw an error ! else if ( $em_pass !== $em_pass_confirm) { message_die( GENERAL_ERROR, $lang['EM_err_set_pw']) ; *************** *** 1096,1100 **** 'S_ACTION' => append_sid('admin_easymod.' . $phpEx), ! 'S_HIDDEN_FIELDS' => '<input type="hidden" name="mod_id" value="' . $row['mod_id'] . '"><input type="hidden" name="mode" value="history_details"><input type="hidden" name="password" value="' . $password . '"><input type="hidden" name="filter_option" value="' . $filter_option . '" />', ///////////////// --- 1109,1113 ---- 'S_ACTION' => append_sid('admin_easymod.' . $phpEx), ! 'S_HIDDEN_FIELDS' => '<input type="hidden" name="mod_id" value="' . $row['mod_id'] . '" /><input type="hidden" name="mode" value="history_details" /><input type="hidden" name="password" value="' . $password . '" /><input type="hidden" name="filter_option" value="' . $filter_option . '" />', ///////////////// *************** *** 1181,1186 **** 'L_GO' => $lang['Go'], ! 'S_ACTION' => append_sid($phpbb_root_path . 'admin/admin_easymod.'.$phpEx), ! 'S_HIDDEN_FIELDS' => '<input type="hidden" name="mod_id" value="' . $mod_id . '"><input type="hidden" name="password" value="' . $password . '"><input type="hidden" name="filter_option" value="' . $HTTP_POST_VARS['filter_option'] . '" />') ); --- 1194,1199 ---- 'L_GO' => $lang['Go'], ! 'S_ACTION' => append_sid('admin_easymod.' . $phpEx), ! 'S_HIDDEN_FIELDS' => '<input type="hidden" name="mod_id" value="' . $mod_id . '" /><input type="hidden" name="password" value="' . $password . '" /><input type="hidden" name="filter_option" value="' . $HTTP_POST_VARS['filter_option'] . '" />') ); *************** *** 1299,1303 **** $template->assign_vars(array( 'L_INDEX' => '', // Not really necessary here ! 'MESSAGE_TITLE' => $lang['EM_del_record'], 'MESSAGE_TEXT' => $lang['EM_are_you_sure'], 'L_YES' => $lang['Yes'], --- 1312,1316 ---- $template->assign_vars(array( 'L_INDEX' => '', // Not really necessary here ! 'MESSAGE_TITLE' => $lang['EN_del_record'], 'MESSAGE_TEXT' => $lang['EM_are_you_sure'], 'L_YES' => $lang['Yes'], *************** *** 1332,1337 **** $message .= '<br />' . $lang['EM_warning_deldir'] . '<br /><br /><b>' . $mod_folder . '</b><br /><br /><br />'; } ! $message .= '<input type="submit" name="submit" class="liteoption" value="' . $lang['MOD_history'] . '">'; ! $message .= '<input type="hidden" name="password" value="' . $password . '">'; $message .= '</form>'; message_die(GENERAL_MESSAGE, $message); --- 1345,1350 ---- $message .= '<br />' . $lang['EM_warning_deldir'] . '<br /><br /><b>' . $mod_folder . '</b><br /><br /><br />'; } ! $message .= '<input type="submit" name="submit" class="liteoption" value="' . $lang['MOD_history'] . '" />'; ! $message .= '<input type="hidden" name="password" value="' . $password . '" />'; $message .= '</form>'; message_die(GENERAL_MESSAGE, $message); *************** *** 1409,1419 **** { $command_line = 'copy ' . $command_ary[$i][0] . ' ' . $command_ary[$i][1]; ! $s_hidden_fields .= '<input type="hidden" name="command_step'.$i.'" value="' . $command_line . "\">\n"; } ! $s_hidden_fields .= '<input type="hidden" name="num_command_steps" value="' . $i . "\">\n" ; foreach( $hidden_vars_ary as $key => $val ) { ! $s_hidden_fields .= '<input type="hidden" name="' . $key . '" value="' . $val . "\">\n"; } --- 1422,1432 ---- { $command_line = 'copy ' . $command_ary[$i][0] . ' ' . $command_ary[$i][1]; ! $s_hidden_fields .= '<input type="hidden" name="command_step'.$i.'" value="' . $command_line . "\" />\n"; } ! $s_hidden_fields .= '<input type="hidden" name="num_command_steps" value="' . $i . "\" />\n"; foreach( $hidden_vars_ary as $key => $val ) { ! $s_hidden_fields .= '<input type="hidden" name="' . $key . '" value="' . $val . "\" />\n"; } *************** *** 1496,1499 **** --- 1509,1513 ---- 'L_ALL_PROCESSED' => $lang['EM_All_Processed'], + 'S_ACTION' => append_sid('admin_easymod.' . $phpEx), 'EM_PASS' => $password) ); *************** *** 1654,1658 **** for ($i=0; $i<count($files); $i++) { ! $link = append_sid('admin_easymod.' . $phpEx) . '&mode=display_file&file=../../../' . $files[$i] . "&password=$password&install_file=$install_file&install_path=$install_path" ; $template->assign_block_vars('files', array( --- 1668,1672 ---- for ($i=0; $i<count($files); $i++) { ! $link = append_sid('admin_easymod.' . $phpEx . '?mode=display_file&file=../../../' . $files[$i] . "&password=$password&install_file=$install_file&install_path=$install_path"); $template->assign_block_vars('files', array( *************** *** 1705,1709 **** if ($mode == 'display_backup') { ! echo "</PRE>\n" ; } --- 1719,1723 ---- if ($mode == 'display_backup') { ! echo "</pre>\n</body>\n</html>\n"; } *************** *** 2199,2202 **** --- 2213,2217 ---- // perform the increment / throw an error as appropriate + $err_level = FIND_OK; for ( $file_count = 0; $file_count < count($file_list); $file_count++ ) { *************** *** 2409,2413 **** if ( !$split_line = copy_check_basic_form( $body[$i][$j])) { ! //echo "1<br>\n" ; display_error( '<b>' . $lang['EM_err_critical_error'] . "</b><br /><br />\n" . $lang['EM_err_copy_format'] . '<br />' . trim($body[$i][$j]) . "<br />\n" . $lang['EM_line_num'] .$commands[$i]['line']); $bad_copy = true ; --- 2424,2428 ---- if ( !$split_line = copy_check_basic_form( $body[$i][$j])) { ! //echo "1<br />\n" ; display_error( '<b>' . $lang['EM_err_critical_error'] . "</b><br /><br />\n" . $lang['EM_err_copy_format'] . '<br />' . trim($body[$i][$j]) . "<br />\n" . $lang['EM_line_num'] .$commands[$i]['line']); $bad_copy = true ; *************** *** 2419,2423 **** (!$dest = copy_check_file( trim( $split_line[3])))) { ! //echo "2<br>\n" ; display_error( '<b>' . $lang['EM_err_critical_error'] . "</b><br /><br />\n" . $lang['EM_err_copy_format'] . '<br />' . trim($body[$i][$j]) . "<br />\n" . $lang['EM_line_num'] .$commands[$i]['line']); $bad_copy = true ; --- 2434,2438 ---- (!$dest = copy_check_file( trim( $split_line[3])))) { ! //echo "2<br />\n" ; display_error( '<b>' . $lang['EM_err_critical_error'] . "</b><br /><br />\n" . $lang['EM_err_copy_format'] . '<br />' . trim($body[$i][$j]) . "<br />\n" . $lang['EM_line_num'] .$commands[$i]['line']); $bad_copy = true ; *************** *** 2519,2523 **** if ( !$tmp_handle = @opendir( $install_path . $tmp_from_dir ) ) { ! //echo "3 [$install_path][$tmp_from_dir]<br>\n" ; display_error( '<b>' . $lang['EM_err_critical_error'] . "</b><br /><br />\n" . $lang['EM_err_copy_format'] . '<br />' . trim($body[$i][$j]) . "<br />\n" . $lang['EM_line_num'] .$commands[$i]['line']); $bad_copy = true ; --- 2534,2538 ---- if ( !$tmp_handle = @opendir( $install_path . $tmp_from_dir ) ) { ! //echo "3 [$install_path][$tmp_from_dir]<br />\n" ; display_error( '<b>' . $lang['EM_err_critical_error'] . "</b><br /><br />\n" . $lang['EM_err_copy_format'] . '<br />' . trim($body[$i][$j]) . "<br />\n" . $lang['EM_line_num'] .$commands[$i]['line']); $bad_copy = true ; *************** *** 2576,2580 **** $command_file->afile[] = 'copy ' . $final[$x]['from_path'] . $final[$x]['from_file'] . ' ../../../' . $final[$x]['to_path'] . $final[$x]['to_file'] ; ! //echo 'copy ' . $final[$x]['from_path'] . $final[$x]['from_file'] . ' ../../../' . $final[$x]['to_path'] . $final[$x]['to_file'] . "<br>\n" ; } } --- 2591,2595 ---- $command_file->afile[] = 'copy ' . $final[$x]['from_path'] . $final[$x]['from_file'] . ' ../../../' . $final[$x]['to_path'] . $final[$x]['to_file'] ; ! //echo 'copy ' . $final[$x]['from_path'] . $final[$x]['from_file'] . ' ../../../' . $final[$x]['to_path'] . $final[$x]['to_file'] . "<br />\n" ; } } *************** *** 2684,2688 **** // write out the lines $preview_display = false ; ! for ($i=0; $i<count($file_list[$file]->afile); $i++) { // writing to file, so do NOT use htmlspecial chars --- 2699,2704 ---- // write out the lines $preview_display = false ; ! $preview_count = count($file_list[$file]->afile); ! for ($i=0; $i<$preview_count; $i++) { // writing to file, so do NOT use htmlspecial chars *************** *** 2701,2711 **** if (!$preview_display) { ! echo '</PRE><b class="preview"><PRE>' . htmlspecialchars(substr($file_list[$file]->afile[$i], 4) ) ; } // special case: the very last line of the file, end the bolding ! else if ($i == (count($file_list[$file]->afile)-1)) { ! echo htmlspecialchars(substr($file_list[$file]->afile[$i], 4) ) . '</PRE></b><PRE>' ; } --- 2717,2727 ---- if (!$preview_display) { ! echo '</pre><pre class="preview">' . htmlspecialchars(substr($file_list[$file]->afile[$i], 4)); } // special case: the very last line of the file, end the bolding ! else if ($i == ($preview_count-1)) { ! echo htmlspecialchars(substr($file_list[$file]->afile[$i], 4)); // . '</pre><pre class="normal">'; } *************** *** 2713,2717 **** else { ! echo htmlspecialchars(substr($file_list[$file]->afile[$i], 4) ) ; } --- 2729,2733 ---- else { ! echo htmlspecialchars(substr($file_list[$file]->afile[$i], 4)); } *************** *** 2722,2726 **** else if ($preview_display) { ! echo '</PRE></b><PRE>' . htmlspecialchars($file_list[$file]->afile[$i]) ; $preview_display = false ; } --- 2738,2742 ---- else if ($preview_display) { ! echo '</pre><pre class="normal">' . htmlspecialchars($file_list[$file]->afile[$i]); $preview_display = false ; } *************** *** 2729,2733 **** else { ! echo htmlspecialchars($file_list[$file]->afile[$i]) ; } } --- 2745,2749 ---- else { ! echo htmlspecialchars($file_list[$file]->afile[$i]); } } *************** *** 2737,2741 **** if ($mode == 'display_file') { ! echo "</PRE>\n" ; } --- 2753,2757 ---- if ($mode == 'display_file') { ! echo "</pre>\n</body>\n</html>\n"; } *************** *** 2826,2832 **** for ($i=0; $i<count( $command_file->afile); $i++) { ! $hidden .= '<input type="hidden" name="command_step'.$i.'" value="' . $command_file->afile[$i] . "\">\n"; } ! $hidden .= '<input type="hidden" name="num_command_steps" value="' . $i . "\">\n" ; // load up any SQL commands into hidden fields as well --- 2842,2848 ---- for ($i=0; $i<count( $command_file->afile); $i++) { ! $hidden .= '<input type="hidden" name="command_step'.$i.'" value="' . $command_file->afile[$i] . "\" />\n"; } ! $hidden .= '<input type="hidden" name="num_command_steps" value="' . $i . "\" />\n"; // load up any SQL commands into hidden fields as well *************** *** 2838,2844 **** $line .= $sql[$i][$j] ; } ! $hidden .= '<input type="hidden" name="SQL'.$i.'" value="' . $line . "\">\n"; } ! $hidden .= '<input type="hidden" name="num_sql_steps" value="' . $i . "\">\n" ; // put DIY INSTRUCTIONS in hidden fields --- 2854,2860 ---- $line .= $sql[$i][$j] ; } ! $hidden .= '<input type="hidden" name="SQL'.$i.'" value="' . htmlspecialchars($line) . "\" />\n"; } ! $hidden .= '<input type="hidden" name="num_sql_steps" value="' . $i . "\" />\n"; // put DIY INSTRUCTIONS in hidden fields *************** *** 2901,2908 **** if ( isset($HTTP_POST_VARS[$var_name])) { ! $hidden .= '<input type="hidden" name="command_step'.$i.'" value="' . $HTTP_POST_VARS[$var_name]."\">\n"; } } ! $hidden .= '<input type="hidden" name="num_command_steps" value="' . $i . "\">\n" ; // put DIY instructions in hidden vars --- 2917,2924 ---- if ( isset($HTTP_POST_VARS[$var_name])) { ! $hidden .= '<input type="hidden" name="command_step'.$i.'" value="' . $HTTP_POST_VARS[$var_name]."\" />\n"; } } ! $hidden .= '<input type="hidden" name="num_command_steps" value="' . $i . "\" />\n"; // put DIY instructions in hidden vars *************** *** 2933,2936 **** --- 2949,2953 ---- + /********************************************************************************\ // turn the psuedo mysql into SQL for this user's DB type include($phpbb_root_path . 'admin/em_includes/em_schema.' . $phpEx) ; *************** *** 2951,2954 **** --- 2968,3005 ---- } } + \********************************************************************************/ + // Load the new SQL Parser + if( !@file_exists($phpbb_root_path . 'language/' . $board_config['default_lang'] . '/lang_sql_parser.' . $phpEx) ) + { + require($phpbb_root_path . 'language/lang_english/lang_sql_parser.' . $phpEx); + } + else + { + require($phpbb_root_path . 'language/' . $board_config['default_lang'] . '/lang_sql_parser.' . $phpEx); + } + require($phpbb_root_path . 'includes/sql/sql_parser.' . $phpEx); + + // Instatiate the SQL Parser object. + $sql_parser = new sql_parser(); + + // Parse and convert the SQL statements for this user's DB type. + $result = $sql_parser->parse_stream(implode("\n", $sql), $table_prefix); + $error = ''; + $formatted_sql = array(); + + if( $result & SQL_PARSER_ERROR ) + { + $error = '<b>Error:</b><br />' . $sql_parser->error_message['message'] . '<br /><br /><b>SQL:</b><br />' . $sql_parser->sql_input[$sql_parser->sql_count]; + $template->assign_block_vars('error', array('ERROR_MSG' => $error)); + } + if( $result & SQL_PARSER_WARNINGS ) + { + $warnings = $sql_parser->warnings; + } + for( $j = 0; $j < count($sql_parser->sql_output); $j++ ) + { + $formatted_sql[] = $sql_parser->sql_output[$j]; + } + /********************************************************************************/ // print message if there is no SQL to worry about *************** *** 2985,2990 **** { //////////////// WHAT IF THERE IS HTML IN THE SQL?? ! $hidden_sql = '<input type="hidden" name="SQL' . $steps . '" value="' . $formatted_sql[$i] . '">' ; ! $check = '<input type="checkbox" name="check_SQL' . $steps . '" checked="checked">' ; $steps++ ; } --- 3036,3041 ---- { //////////////// WHAT IF THERE IS HTML IN THE SQL?? ! $hidden_sql = '<input type="hidden" name="SQL' . $steps . '" value="' . htmlspecialchars($formatted_sql[$i]) . '" />'; ! $check = '<input type="checkbox" name="check_SQL' . $steps . '" checked="checked" />'; $steps++ ; } *************** *** 3006,3013 **** 'HIDDEN_SQL' => $hidden_sql, 'CHECK' => $check, ! 'DISPLAY_SQL' => $formatted_sql[$i]) ); } ! $hidden .= '<input type="hidden" name="num_sql_steps" value="' . $steps . "\">\n" ; // if it's postgre or mssql, let them know I don't have things quite right yet! --- 3057,3064 ---- 'HIDDEN_SQL' => $hidden_sql, 'CHECK' => $check, ! 'DISPLAY_SQL' => htmlspecialchars($formatted_sql[$i]) . ';') ); } ! $hidden .= '<input type="hidden" name="num_sql_steps" value="' . $steps . "\" />\n"; // if it's postgre or mssql, let them know I don't have things quite right yet! *************** *** 3033,3037 **** // fill the template $template->assign_vars(array( ! 'S_ACTION' => append_sid($phpbb_root_path . 'admin/admin_easymod.'.$phpEx), 'L_STEP' => $lang['EM_sql_step2'], --- 3084,3088 ---- // fill the template $template->assign_vars(array( ! 'S_ACTION' => append_sid('admin_easymod.' . $phpEx), 'L_STEP' => $lang['EM_sql_step2'], *************** *** 3039,3043 **** 'L_SQL_INTRO' => $lang['EM_sql_intro_explain'], 'L_ALTERATIONS' => $lang['EM_Alterations'], ! 'L_PSEUDO' => sprintf($lang['EM_proposed_alerations'], SQL_LAYER), 'L_ALLOW' => $lang['EM_Allow'], 'L_PERFORM' => $lang['EM_Perform'], --- 3090,3094 ---- 'L_SQL_INTRO' => $lang['EM_sql_intro_explain'], 'L_ALTERATIONS' => $lang['EM_Alterations'], ! 'L_PSEUDO' => sprintf($lang['EM_proposed_alterations'], SQL_LAYER), 'L_ALLOW' => $lang['EM_Allow'], 'L_PERFORM' => $lang['EM_Perform'], *************** *** 3081,3088 **** if ( isset($HTTP_POST_VARS[$var_name])) { ! $hidden .= '<input type="hidden" name="command_step'.$i.'" value="' . $HTTP_POST_VARS[$var_name]."\">\n"; } } ! $hidden .= '<input type="hidden" name="num_command_steps" value="' . $i . "\">\n" ; // put DIY instructions in hidden vars --- 3132,3139 ---- if ( isset($HTTP_POST_VARS[$var_name])) { ! $hidden .= '<input type="hidden" name="command_step'.$i.'" value="' . $HTTP_POST_VARS[$var_name]."\" />\n"; } } ! $hidden .= '<input type="hidden" name="num_command_steps" value="' . $i . "\" />\n"; // put DIY instructions in hidden vars *************** *** 3117,3125 **** $error = $db->sql_error() ; ! //echo "[" . $error['message'] . "][" . $error['code'] . "]<br>\n" ; //exit ; // load up an error message $template->assign_block_vars( 'sql_error', array( ! 'LINE' => $sql_line, 'ERROR_CODE' => $error['code'], 'ERROR_MSG' => $error['message']) --- 3168,3176 ---- $error = $db->sql_error() ; ! //echo "[" . $error['message'] . "][" . $error['code'] . "]<br />\n" ; //exit ; // load up an error message $template->assign_block_vars( 'sql_error', array( ! 'LINE' => htmlspecialchars($sql_line) . ';', 'ERROR_CODE' => $error['code'], 'ERROR_MSG' => $error['message']) *************** *** 3159,3163 **** 'HIDDEN' => '', 'CHECK' => $sql[$i]['status'], ! 'DISPLAY_SQL' => $sql[$i]['command']) ); } --- 3210,3214 ---- 'HIDDEN' => '', 'CHECK' => $sql[$i]['status'], ! 'DISPLAY_SQL' => htmlspecialchars($sql[$i]['command']) . ';') ); } *************** *** 3167,3170 **** --- 3218,3223 ---- // fill the template $template->assign_vars(array( + 'S_ACTION' => append_sid('admin_easymod.' . $phpEx), + 'L_STEP' => $lang['EM_sql_step2'], 'L_SQL_ALPHA2' => $lang['EM_SQL_Alpha2'], *************** *** 3308,3312 **** $type = $lang['EM_pp_backup'] ; $is_backup = true ; ! $link = append_sid('admin_easymod.' . $phpEx) . '&mode=display_backup&file=' . $parms[1] . "&password=$em_pass" ; } else --- 3361,3365 ---- $type = $lang['EM_pp_backup'] ; $is_backup = true ; ! $link = append_sid('admin_easymod.' . $phpEx . '?mode=display_backup&file=' . $parms[1] . "&password=$em_pass"); } else *************** *** 3316,3320 **** $type = $lang['EM_pp_download'] ; $is_backup = false ; ! $link = append_sid('admin_easymod.' . $phpEx) . '&mode=display_file&file=' . $parms[2] . "&password=$em_pass&install_file=$install_file&install_path=$install_path" ; } --- 3369,3373 ---- $type = $lang['EM_pp_download'] ; $is_backup = false ; ! $link = append_sid('admin_easymod.' . $phpEx . '?mode=display_file&file=' . $parms[2] . "&password=$em_pass&install_file=$install_file&install_path=$install_path"); } Index: mod_complete.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/mod_complete.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mod_complete.tpl 3 Jun 2005 22:59:12 -0000 1.3 --- mod_complete.tpl 31 Oct 2005 17:57:15 -0000 1.4 *************** *** 49,54 **** {HIDDEN} <input type="hidden" name="mode" value="{diy_switch.MODE}" /> ! <input type="hidden" name="password" value="{diy_switch.EM_PASS}"> ! <input type="submit" name="post" class="mainoption" value="{L_FINAL_INSTALL_STEP}" /></center> </td> </tr> --- 49,54 ---- {HIDDEN} <input type="hidden" name="mode" value="{diy_switch.MODE}" /> ! <input type="hidden" name="password" value="{diy_switch.EM_PASS}" /> ! <input type="submit" name="post" class="mainoption" value="{L_FINAL_INSTALL_STEP}" /> </td> </tr> *************** *** 101,108 **** <br /> <form action="{S_ACTION}" method="post"> ! <input type="hidden" name="mode" value="download_backup"> ! <input type="hidden" name="install_file" value="{MOD_FILE}"> ! <input type="hidden" name="install_path" value="{MOD_PATH}"> ! <input type="hidden" name="mod_count" value="{MOD_COUNT}"> <table cellspacing="1" cellpadding="4" border="0" align="center" class="forumline" width="100%"> <tr> --- 101,108 ---- <br /> <form action="{S_ACTION}" method="post"> ! <input type="hidden" name="mode" value="download_backup" /> ! <input type="hidden" name="install_file" value="{MOD_FILE}" /> ! <input type="hidden" name="install_path" value="{MOD_PATH}" /> ! <input type="hidden" name="mod_count" value="{MOD_COUNT}" /> <table cellspacing="1" cellpadding="4" border="0" align="center" class="forumline" width="100%"> <tr> *************** *** 111,116 **** <!-- BEGIN backups --> <tr> ! <td class="row1" align="left" height=25 width="50%"><span class="gen">{backups.FROM}</span></td> ! <td class="row2" align="left" height=25 width="50%"><span class="gen">{backups.TO}</span></td> </tr> <!-- END backups --> --- 111,116 ---- <!-- BEGIN backups --> <tr> ! <td class="row1" align="left" height="25" width="50%"><span class="gen">{backups.FROM}</span></td> ! <td class="row2" align="left" height="25" width="50%"><span class="gen">{backups.TO}</span></td> </tr> <!-- END backups --> *************** *** 123,130 **** <tr><td> <form action="{S_ACTION}" method="post"> ! <input type="hidden" name="mode" value="download_file"> ! <input type="hidden" name="install_file" value="{MOD_FILE}"> ! <input type="hidden" name="install_path" value="{MOD_PATH}"> ! <input type="hidden" name="mod_count" value="{MOD_COUNT}"> <table cellspacing="1" cellpadding="4" border="0" align="center" class="forumline" width="100%"> <tr> --- 123,130 ---- <tr><td> <form action="{S_ACTION}" method="post"> ! <input type="hidden" name="mode" value="download_file" /> ! <input type="hidden" name="install_file" value="{MOD_FILE}" /> ! <input type="hidden" name="install_path" value="{MOD_PATH}" /> ! <input type="hidden" name="mod_count" value="{MOD_COUNT}" /> <table cellspacing="1" cellpadding="4" border="0" align="center" class="forumline" width="100%"> <tr> *************** *** 135,141 **** <!-- BEGIN files --> <tr> ! <td class="row1" align="left" height=25 width="50%"><span class="gen">{files.FROM}</span></td> ! <td class="row2" align="left" height=25 width="50%"><span class="gen">{files.TO}</span></td> ! <td class="row2" align="left" height=25 width="*"><span class="gen">{files.COMPLETED}</span></td> </tr> --- 135,141 ---- <!-- BEGIN files --> <tr> ! <td class="row1" align="left" height="25" width="45%"><span class="gen">{files.FROM}</span></td> ! <td class="row2" align="left" height="25" width="45%"><span class="gen">{files.TO}</span></td> ! <td class="row2" align="left" height="25" width="10%"><span class="gen">{files.COMPLETED}</span></td> </tr> *************** *** 144,146 **** </form> </td></tr></table> - --- 144,145 ---- Index: mod_install.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/mod_install.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mod_install.tpl 24 Apr 2005 14:59:53 -0000 1.1 --- mod_install.tpl 31 Oct 2005 17:57:15 -0000 1.2 *************** *** 35,53 **** <td align="center"><span class="gen"><a href="{unprocessed.MOD_URL}" class="gen" target="_blank">{unprocessed.MOD_URL}</a></span></td> </tr> - <tr> - <td align="center"><span class="gen"> - <!-- <a href="{unprocessed.MOD_URL}" class="gen">{L_SUPPORT}</a></span> --> - </td> - </tr> </table> </td> <td class="{unprocessed.ROW_CLASS}" align="left"><span class="gen">{unprocessed.MOD_DESC}</span></td> ! <td class="{unprocessed.ROW_CLASS}" align="center"><span class="gen">{unprocessed.MOD_EMC}<span></td> <td class="{unprocessed.ROW_CLASS}" align="center" valign="bottom"> <form method="post" action="{S_ACTION}"> ! <input type="hidden" name="mode" value="process"> ! <input type="hidden" name="install_file" value="{unprocessed.MOD_FILE}"> ! <input type="hidden" name="install_path" value="{unprocessed.MOD_PATH}"> ! <input type="hidden" name="password" value="{EM_PASS}"> <input type="submit" name="post" class="mainoption" value="{L_PROCESS}" /><br> {L_PREVIEW}: <input type="checkbox" name="preview" value="0" /> --- 35,48 ---- <td align="center"><span class="gen"><a href="{unprocessed.MOD_URL}" class="gen" target="_blank">{unprocessed.MOD_URL}</a></span></td> </tr> </table> </td> <td class="{unprocessed.ROW_CLASS}" align="left"><span class="gen">{unprocessed.MOD_DESC}</span></td> ! <td class="{unprocessed.ROW_CLASS}" align="center"><span class="gen">{unprocessed.MOD_EMC}</span></td> <td class="{unprocessed.ROW_CLASS}" align="center" valign="bottom"> <form method="post" action="{S_ACTION}"> ! <input type="hidden" name="mode" value="process" /> ! <input type="hidden" name="install_file" value="{unprocessed.MOD_FILE}" /> ! <input type="hidden" name="install_path" value="{unprocessed.MOD_PATH}" /> ! <input type="hidden" name="password" value="{EM_PASS}" /> <input type="submit" name="post" class="mainoption" value="{L_PROCESS}" /><br> {L_PREVIEW}: <input type="checkbox" name="preview" value="0" /> Index: mod_history_details.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/mod_history_details.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mod_history_details.tpl 29 Jul 2005 17:33:08 -0000 1.2 --- mod_history_details.tpl 31 Oct 2005 17:57:15 -0000 1.3 *************** *** 37,41 **** </tr> <tr> - <tr> <td class="row1" align="left" width="25%"><span class="gen">{L_DB_ALTS}:</span></td> <td class="row2" align="left" width="75%"><span class="gen">{L_ADDED}: {ADDED} {L_ALTERED}: {ALTERED} {L_INSERTED}: {INSERTED}</span></td> --- 37,40 ---- |