easymod-cvs Mailing List for EasyMOD (Page 7)
Status: Beta
Brought to you by:
wgeric
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
(16) |
May
(36) |
Jun
(53) |
Jul
(21) |
Aug
|
Sep
(10) |
Oct
(4) |
Nov
(69) |
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
(5) |
Oct
(3) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(12) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Markus P. <mar...@us...> - 2005-11-02 19:42:59
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28297 Modified Files: easymod_install.php Log Message: login redirection was not pointing to the right place. Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** easymod_install.php 2 Nov 2005 09:31:21 -0000 1.34 --- easymod_install.php 2 Nov 2005 19:42:50 -0000 1.35 *************** *** 46,50 **** if( !$userdata['session_logged_in'] ) { ! redirect(append_sid("login.$phpEx?redirect=".basename(__FILE__), true)); } if( $userdata['user_level'] != ADMIN ) --- 46,50 ---- if( !$userdata['session_logged_in'] ) { ! redirect(append_sid("login.$phpEx?redirect=admin/mods/easymod/easymod_install.$phpEx", true)); } if( $userdata['user_level'] != ADMIN ) *************** *** 53,59 **** } - $script_path = 'admin/mods/easymod/'; //// $easymod_install_version = '0.2.2'; //// --- 53,59 ---- } //// $easymod_install_version = '0.2.2'; + $script_path = 'admin/mods/easymod/'; //// |
From: Markus P. <mar...@us...> - 2005-11-02 12:58:39
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23966/mods/easymod/includes Modified Files: admin_easymod.php.txt Log Message: Let's hide coming soon features until fully implemented. Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** admin_easymod.php.txt 2 Nov 2005 09:31:21 -0000 1.32 --- admin_easymod.php.txt 2 Nov 2005 12:58:07 -0000 1.33 *************** *** 694,698 **** { // compare passwords and send them back to the password screen if they fail ! if ( $password !== get_em_pw()) { $get_password = true; --- 694,698 ---- { // compare passwords and send them back to the password screen if they fail ! if ($password !== get_em_pw()) { $get_password = true; *************** *** 1209,1213 **** $mod_file = '<a href="' . htmlspecialchars($temp_url) . '" class="gen" target="_blank">' . htmlspecialchars($file[1]) . '</a>'; ! $template->assign_block_vars('switch_install_file', array()); } else --- 1209,1214 ---- $mod_file = '<a href="' . htmlspecialchars($temp_url) . '" class="gen" target="_blank">' . htmlspecialchars($file[1]) . '</a>'; ! // Let's hide coming soon features until fully implemented ! //$template->assign_block_vars('switch_install_file', array()); } else *************** *** 1219,1223 **** if ( file_exists('./mods/' . $file[0] . '/processed/') || file_exists('./mods/' . $file[0]. '/backups/') ) { ! $template->assign_block_vars('switch_files', array()); } // see if backups are there so we can give them the option to restore them --- 1220,1225 ---- if ( file_exists('./mods/' . $file[0] . '/processed/') || file_exists('./mods/' . $file[0]. '/backups/') ) { ! // Let's hide coming soon features until fully implemented ! //$template->assign_block_vars('switch_files', array()); } // see if backups are there so we can give them the option to restore them |
From: Markus P. <mar...@us...> - 2005-11-02 09:31:29
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12026/mods/easymod/includes Modified Files: admin_easymod.php.txt Log Message: Changed the way the EM password is passed between panels. Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** admin_easymod.php.txt 2 Nov 2005 05:58:51 -0000 1.31 --- admin_easymod.php.txt 2 Nov 2005 09:31:21 -0000 1.32 *************** *** 506,510 **** // look in the config table to get the EM settings ! function get_em_settings( $filename, $path, $em_pass, $preview = false) { global $db, $phpbb_root_path; --- 506,510 ---- // look in the config table to get the EM settings ! function get_em_settings($filename, $path, $em_pass, $preview = false) { global $db, $phpbb_root_path; *************** *** 514,518 **** // $sql = "SELECT * ! FROM " . CONFIG_TABLE; if( !$result = $db->sql_query($sql) ) { --- 514,519 ---- // $sql = "SELECT * ! FROM " . CONFIG_TABLE . " ! WHERE config_name LIKE 'EM_%'"; if( !$result = $db->sql_query($sql) ) { *************** *** 521,563 **** // 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_port') { $ftp_port = $row['config_value']; } ! else if ( $row['config_name'] == 'EM_ftp_type') { $ftp_type = $row['config_value']; } ! else if ( $row['config_name'] == 'EM_ftp_cache') { $ftp_cache = $row['config_value']; --- 522,564 ---- // 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 = crypt_ftp_pass(EM_DECRYPT, $row['config_value'], $em_pass); } ! else if ($row['config_name'] == 'EM_ftp_host') { $ftp_host = $row['config_value']; } ! else if ($row['config_name'] == 'EM_ftp_port') { $ftp_port = $row['config_value']; } ! else if ($row['config_name'] == 'EM_ftp_type') { $ftp_type = $row['config_value']; } ! else if ($row['config_name'] == 'EM_ftp_cache') { $ftp_cache = $row['config_value']; *************** *** 565,575 **** } - // 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) --- 566,569 ---- *************** *** 583,587 **** } - // look in the config table to get the EM Version function get_em_version() --- 577,580 ---- *************** *** 666,669 **** --- 659,666 ---- $password = ( !empty($HTTP_POST_VARS['password']) ) ? stripslashes($HTTP_POST_VARS['password']) : ''; + if( isset($HTTP_POST_VARS['login']) ) + { + $password = md5($password); + } $install_file = ( !empty($HTTP_POST_VARS['install_file']) ) ? stripslashes(trim($HTTP_POST_VARS['install_file'])) : ''; $install_path = ( !empty($HTTP_POST_VARS['install_path']) ) ? stripslashes(trim($HTTP_POST_VARS['install_path'])) : ''; *************** *** 697,701 **** { // compare passwords and send them back to the password screen if they fail ! if ( md5($password) != get_em_pw()) { $get_password = true; --- 694,698 ---- { // compare passwords and send them back to the password screen if they fail ! if ( $password !== get_em_pw()) { $get_password = true; *************** *** 922,926 **** 'L_SUBMIT' => $lang['EM_settings_update'], ! 'EM_PASS' => $password, 'EM_VERSION' => get_em_version(), --- 919,923 ---- 'L_SUBMIT' => $lang['EM_settings_update'], ! 'EM_PASS' => htmlspecialchars($password), 'EM_VERSION' => get_em_version(), *************** *** 970,974 **** // 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 *************** *** 978,982 **** } // the confirm is empty so they are not trying to update the pw, so don't ! else if ( $em_pass_confirm == '') { $pass_msg = $lang['EM_pass_not_updated']; --- 975,979 ---- } // the confirm is empty so they are not trying to update the pw, so don't ! else if ($em_pass_confirm == '') { $pass_msg = $lang['EM_pass_not_updated']; *************** *** 984,993 **** } // passwords do not match so throw an error ! else if ( $em_pass !== $em_pass_confirm) { message_die(GENERAL_ERROR, $lang['EM_err_set_pw']); } - // update the settings em_db_update('EM_read', str_replace("'", "''", $read)); --- 981,989 ---- } // passwords do not match so throw an error ! else if ($em_pass !== $em_pass_confirm) { message_die(GENERAL_ERROR, $lang['EM_err_set_pw']); } // update the settings em_db_update('EM_read', str_replace("'", "''", $read)); *************** *** 999,1009 **** 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', str_replace("'", "''", $ftp_pass)); } --- 995,999 ---- if ( $force_ftp_pass || !empty($ftp_pass) ) { ! em_db_update('EM_ftp_pass', str_replace("'", "''", crypt_ftp_pass(EM_ENCRYPT, $ftp_pass, $em_pass))); } *************** *** 1017,1021 **** } - // // history --- 1007,1010 ---- *************** *** 1410,1414 **** $hidden_vars_ary = array( 'mod_id' => $mod_id, ! 'password' => $password, 'mode' => $mode, 'install_path' => dirname($mod_file).'/', --- 1399,1403 ---- $hidden_vars_ary = array( 'mod_id' => $mod_id, ! 'password' => htmlspecialchars($password), 'mode' => $mode, 'install_path' => dirname($mod_file).'/', |
From: Markus P. <mar...@us...> - 2005-11-02 09:31:28
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12026/mods/easymod Modified Files: easymod_install.php Log Message: Changed the way the EM password is passed between panels. Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** easymod_install.php 2 Nov 2005 06:23:15 -0000 1.33 --- easymod_install.php 2 Nov 2005 09:31:21 -0000 1.34 *************** *** 1639,1652 **** $db->sql_freeresult($result); - // added security starting in 0.0.11, md5 the em pass $em_md5 = md5($em_pass) ; // added security starting in 0.0.11, blowfish encrypt the ftp_pass ! include($phpbb_root_path . $script_path . 'em_includes/em_cipher.'.$phpEx) ; ! $cipher = new Cipher_BlockMode_cbc(); ! $cipher->blowfish->setKey( $em_pass); ! $ftp_cipher = $cipher->encrypt($ftp_pass) ; ! // if not, add the fields if ( $rows == 0) --- 1639,1648 ---- $db->sql_freeresult($result); // added security starting in 0.0.11, md5 the em pass $em_md5 = md5($em_pass) ; // added security starting in 0.0.11, blowfish encrypt the ftp_pass ! $ftp_cipher = crypt_ftp_pass(EM_ENCRYPT, $ftp_pass, $em_md5); ! // if not, add the fields if ( $rows == 0) |
From: Markus P. <mar...@us...> - 2005-11-02 09:22:50
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10569/mods/easymod/em_includes Modified Files: em_cipher.php em_functions.php Log Message: Backported cipher class and implemented a common interface to make it easy to use from the acp and install scripts. Index: em_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_functions.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** em_functions.php 2 Nov 2005 05:51:56 -0000 1.18 --- em_functions.php 2 Nov 2005 09:22:42 -0000 1.19 *************** *** 40,43 **** --- 40,67 ---- define('FIND_FAIL_CRITICAL', 2); + /// + /// Interface to crypt class + /// + + define('EM_ENCRYPT', 'em_encrypt'); + define('EM_DECRYPT', 'em_decrypt'); + + function crypt_ftp_pass($crypt_direction, $ftp_pass, $em_pass) + { + global $phpbb_root_path, $phpEx; + + $key = ''; + for($i = 1, $total = strlen($em_pass); $i < $total; $i = round(($i+1)*2)) + { + $key .= md5($em_pass{$i}); + } + + require($phpbb_root_path . 'admin/em_includes/em_cipher.' . $phpEx); + $cipher = new Cipher_BlockMode_cbc(); + $crypt_method = ( $crypt_direction == EM_ENCRYPT ? 'encrypt' : 'decrypt' ); + $ftp_pass = $cipher->$crypt_method($ftp_pass, $key); + unset($cipher); + return $ftp_pass; + } Index: em_cipher.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_cipher.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** em_cipher.php 31 Oct 2005 17:57:15 -0000 1.4 --- em_cipher.php 2 Nov 2005 09:22:42 -0000 1.5 *************** *** 22,30 **** ! // ! // THE PURPOSE of this module is purely to encrypt the FTP password. Since I can't ! // be sure what PHP libraries are installed, I cannot use mcrypt. Thus the addition ! // of this 29k file just to make a password safe. Oh well, EM spares no expense ;-) ! // --- 22,30 ---- ! /* ! * THE PURPOSE of this module is purely to encrypt the FTP password. Since I can't ! * be sure what PHP libraries are installed, I cannot use mcrypt. Thus the addition ! * of this 29k file just to make a password safe. Oh well, EM spares no expense ;-) ! */ *************** *** 335,341 **** function setKey($key) { - // we want a minimum length for our key - $key .= '12345678' ; - $key = $this->_formatKey($key); $keyPos = 0; --- 335,338 ---- *************** *** 526,531 **** var $_iv = "\0\0\0\0\0\0\0\0"; // String containing the initilization vector. ! var $blowfish ; // will contain a blowfish class ! var $filler ; --- 523,529 ---- var $_iv = "\0\0\0\0\0\0\0\0"; // String containing the initilization vector. ! var $blowfish; // will contain a blowfish class ! var $filler; ! var $key_set; *************** *** 533,550 **** function Cipher_BlockMode_cbc() { ! $this->blowfish = new Cipher_blowfish() ; ! $this->filler = 'nuttzy=1337' ; } // encrypts the text a chunk at a time and then strings them all together and returns the value ! function encrypt($plaintext) { $encrypted = ''; - // added by Nuttzy, we want to make sure the password is nice and long so brute forcers won't know if this - // is a really short pw - $plaintext .= $this->filler ; - $blocksize = $this->blowfish->getBlockSize(); $previousCipher = $this->_iv; --- 531,546 ---- function Cipher_BlockMode_cbc() { ! $this->blowfish = new Cipher_blowfish(); ! $this->key_set = false; } // encrypts the text a chunk at a time and then strings them all together and returns the value ! function encrypt($plaintext, $key) { + $this->setkey($key); + $encrypted = ''; $blocksize = $this->blowfish->getBlockSize(); $previousCipher = $this->_iv; *************** *** 565,571 **** // added by Nuttzy - we'll be storing the result in a DB so we need to replace ' with \' ! $encrypted = addslashes( $encrypted) ; // TAKE TWO: the way General Config settings work in phpBB, this isn't sufficient, get rid of the ' all together - // $encrypted = str_replace("\'", "''", $encrypted) ; $encrypted = str_replace("\'", 'NUTTICK', $encrypted); $encrypted = str_replace("\n", 'NUTLINE', $encrypted); --- 561,566 ---- // added by Nuttzy - we'll be storing the result in a DB so we need to replace ' with \' ! $encrypted = addslashes($encrypted); // TAKE TWO: the way General Config settings work in phpBB, this isn't sufficient, get rid of the ' all together $encrypted = str_replace("\'", 'NUTTICK', $encrypted); $encrypted = str_replace("\n", 'NUTLINE', $encrypted); *************** *** 587,592 **** // decrypts the cipher a chunk at a time and returns the plaintext ! function decrypt($ciphertext) { // decode for use (postgres storage problems) if( function_exists('utf8_decode') ) --- 582,589 ---- // decrypts the cipher a chunk at a time and returns the plaintext ! function decrypt($ciphertext, $key) { + $this->setkey($key); + // decode for use (postgres storage problems) if( function_exists('utf8_decode') ) *************** *** 616,624 **** } - // added by nuttzy, we need strip off the extra characters we added - $decrypted = substr( $decrypted, 0, strlen($decrypted) - strlen($this->filler)) ; - return $decrypted; } } --- 613,629 ---- } return $decrypted; } + + function setkey($key) + { + if ( !$this->key_set ) + { + $this->blowfish->setKey($key); + $this->key_set = true; + } + + return; + } } |
From: Markus P. <mar...@us...> - 2005-11-02 06:23:23
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6789 Modified Files: easymod_install.php Log Message: Oops, forgot to copy the sql lang at install time. Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** easymod_install.php 2 Nov 2005 03:20:16 -0000 1.32 --- easymod_install.php 2 Nov 2005 06:23:15 -0000 1.33 *************** *** 764,767 **** --- 764,768 ---- $command_file->afile[] = 'copy includes/sql/sql_parser.php ../../../includes/sql/sql_parser.php'; $command_file->afile[] = 'copy includes/sql/sql_reserved_keywords.php ../../../includes/sql/sql_reserved_keywords.php'; + $command_file->afile[] = 'copy languages/lang_sql_parser.php ../../../language/lang_english/lang_sql_parser.php'; ////////////// |
From: Markus P. <mar...@us...> - 2005-11-02 05:59:05
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3323/includes Modified Files: admin_easymod.php.txt Log Message: Nah, this was not completely correct. Just confused with another project who happened to do it that way. Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** admin_easymod.php.txt 2 Nov 2005 05:51:56 -0000 1.30 --- admin_easymod.php.txt 2 Nov 2005 05:58:51 -0000 1.31 *************** *** 58,63 **** require('./pagestart.' . $phpEx); ! // 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/'; // Load the EM language file --- 58,64 ---- require('./pagestart.' . $phpEx); ! // $script_path = 'admin/'; + // // Load the EM language file |
From: Markus P. <mar...@us...> - 2005-11-02 05:52:07
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2555/includes Modified Files: admin_easymod.php.txt Log Message: A couple more fixes. Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** admin_easymod.php.txt 2 Nov 2005 04:27:42 -0000 1.29 --- admin_easymod.php.txt 2 Nov 2005 05:51:56 -0000 1.30 *************** *** 101,104 **** --- 101,122 ---- + // prevent from attempts to read files out of expected scope + function check_file_scope($filename, $expected_scope, $simply_die = false) + { + global $db, $lang; + + // make sure a file is located somewhere inside the specified directory + if( !@file_exists(phpbb_realpath($filename)) || !strstr(phpbb_realpath($filename), phpbb_realpath($expected_scope)) ) + { + $message = sprintf($lang['EM_modio_open_read'], $filename); + if( $simply_die ) + { + $db->sql_close(); + die($message); + } + message_die(GENERAL_ERROR, $message); + } + } + // write command info to the screen (add to template) function display_line($command, $body) *************** *** 196,199 **** --- 214,219 ---- function get_mod_properties($file, &$mod_title, &$mod_author_handle, &$mod_author_email, &$mod_author_name, &$mod_author_url, &$mod_description, &$mod_version, &$compliant) { + global $phpbb_root_path, $script_path; + // used to add a little tolerance on the Author line $faux_author = false; *************** *** 201,204 **** --- 221,225 ---- // open the file and grab the first line + check_file_scope($file, $phpbb_root_path . $script_path); $f_mod_script = fopen($file, 'r'); if (!$f_mod_script) *************** *** 208,212 **** $buffer = fgets($f_mod_script, 1024); - // see if it is EMC right away; first line starts with ## on it and contains "easymod" $compliant = false; --- 229,232 ---- *************** *** 745,754 **** // if there is no file to process then we are in trouble! ! if ( $process_file == '') { message_die(GENERAL_ERROR, $lang['EM_err_no_process_file']); } - // set up the redirects so we will download a file, the contents of which we will echo out header('Content-Type: text/x-delimtext; name="' . $split[count($split)-1] . '"'); --- 765,773 ---- // if there is no file to process then we are in trouble! ! if ($process_file == '') { message_die(GENERAL_ERROR, $lang['EM_err_no_process_file']); } // set up the redirects so we will download a file, the contents of which we will echo out header('Content-Type: text/x-delimtext; name="' . $split[count($split)-1] . '"'); *************** *** 1569,1574 **** { $files = array(); ! $f_mod_script = fopen ($install_path . $install_file, 'r'); ! while (!feof ($f_mod_script)) { $buffer = fgets($f_mod_script, 4096); --- 1588,1594 ---- { $files = array(); ! check_file_scope($install_path . $install_file, $phpbb_root_path . $script_path); ! $f_mod_script = fopen($install_path . $install_file, 'r'); ! while (!feof($f_mod_script)) { $buffer = fgets($f_mod_script, 4096); *************** *** 1675,1678 **** --- 1695,1699 ---- { // open the core file + check_file_scope($process_file, $phpbb_root_path . $script_path, true); if (!$read_file = fopen($process_file, 'r')) { *************** *** 1730,1735 **** // ! $f_mod_script = fopen ($install_path . '/' . $install_file, 'r'); ! while (!feof ($f_mod_script)) { $buffer = fgets($f_mod_script, 4096); --- 1751,1757 ---- // ! check_file_scope($install_path . $install_file, $phpbb_root_path . $script_path); ! $f_mod_script = fopen($install_path . $install_file, 'r'); ! while (!feof($f_mod_script)) { $buffer = fgets($f_mod_script, 4096); |
From: Markus P. <mar...@us...> - 2005-11-02 05:52:07
|
Update of /cvsroot/easymod/easymod2/mods/easymod/languages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2555/languages Modified Files: lang_easymod_english.php Log Message: A couple more fixes. Index: lang_easymod_english.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/languages/lang_easymod_english.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lang_easymod_english.php 29 Jul 2005 17:33:08 -0000 1.2 --- lang_easymod_english.php 2 Nov 2005 05:51:56 -0000 1.3 *************** *** 531,535 **** $lang['EM_line_num'] = 'MOD script line #' ; $lang['EM_err_config_info'] = 'Could not obtain Config information' ; ! $lang['EM_err_no_process_file'] = 'Critical Error: There is no filed specified to process.' ; $lang['EM_err_set_pw'] = 'The EasyMOD passwords do not match. Settings not updated.' ; $lang['EM_err_em_info'] = 'Could not obtain EasyMod information' ; --- 531,535 ---- $lang['EM_line_num'] = 'MOD script line #' ; $lang['EM_err_config_info'] = 'Could not obtain Config information' ; ! $lang['EM_err_no_process_file'] = 'Critical Error: There is no file specified to process.' ; $lang['EM_err_set_pw'] = 'The EasyMOD passwords do not match. Settings not updated.' ; $lang['EM_err_em_info'] = 'Could not obtain EasyMod information' ; |
From: Markus P. <mar...@us...> - 2005-11-02 05:52:07
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2555/em_includes Modified Files: em_functions.php Log Message: A couple more fixes. Index: em_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_functions.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** em_functions.php 31 Oct 2005 17:57:15 -0000 1.17 --- em_functions.php 2 Nov 2005 05:51:56 -0000 1.18 *************** *** 1318,1331 **** // used only for debugging purposes only ! /* ! function em_vd($mixed, $title = '') { ! ob_start(); ! var_dump($mixed); ! $content = ob_get_contents(); ! ob_end_clean(); ! echo '<pre>' . ( !empty($title) ? ($title . ': ') : '' ) . htmlspecialchars($content) . "</pre>\n"; } - */ ?> \ No newline at end of file --- 1318,1332 ---- // used only for debugging purposes only ! if( defined('EM_DEBUG_AID') ) { ! function em_vd($mixed, $title = '') ! { ! ob_start(); ! var_dump($mixed); ! $content = ob_get_contents(); ! ob_end_clean(); ! echo '<pre>' . ( !empty($title) ? ($title . ': ') : '' ) . htmlspecialchars($content) . "</pre>\n"; ! } } ?> \ No newline at end of file |
From: Markus P. <mar...@us...> - 2005-11-02 04:27:56
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23815/includes Modified Files: admin_easymod.php.txt Log Message: First major commit for the review of the ACP script. Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** admin_easymod.php.txt 31 Oct 2005 17:57:15 -0000 1.28 --- admin_easymod.php.txt 2 Nov 2005 04:27:42 -0000 1.29 *************** *** 24,34 **** 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); } [...4674 lines suppressed...] { ! message_die(GENERAL_ERROR, '<br />' . $lang['EM_err_write_pp'] . '<br />' . $lang['EM_err_cwd'] . ': ' . getcwd() . '<br />'); } // closs the FTP session ! $command_file->modio_cleanup('move'); + $phpbb_version = get_phpbb_version(); + $mod_title = str_replace("'", "''", substr($mod_title, 0, 255)); + $mod_author_handle = str_replace("'", "''", substr($mod_author_handle, 0, 25)); + $mod_author_email = str_replace("'", "''", substr($mod_author_email, 0, 100)); + $mod_author_name = str_replace("'", "''", substr($mod_author_name, 0, 100)); + $mod_author_url = str_replace("'", "''", substr($mod_author_url, 0, 100)); + $mod_description = str_replace("'", "''", $mod_description); + $mod_version = str_replace("'", "''", substr($mod_version, 0, 15)); + $themes = str_replace("'", "''", $themes); + $languages = str_replace("'", "''", $languages); if ($preview) |
From: Markus P. <mar...@us...> - 2005-11-02 04:18:37
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22726/includes Modified Files: mod_complete.tpl Log Message: Fixed another minor HTML issue in a template. Index: mod_complete.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/mod_complete.tpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mod_complete.tpl 31 Oct 2005 17:57:15 -0000 1.4 --- mod_complete.tpl 2 Nov 2005 04:18:25 -0000 1.5 *************** *** 31,35 **** </tr> <tr> ! <td width="100%"><span class="gen"> <ul> <!-- BEGIN diyrow --> --- 31,35 ---- </tr> <tr> ! <td width="100%"><div class="gen"> <ul> <!-- BEGIN diyrow --> *************** *** 37,41 **** <!-- END diyrow --> </ul> ! </span></td> </tr> <tr> --- 37,41 ---- <!-- END diyrow --> </ul> ! </div></td> </tr> <tr> |
From: Markus P. <mar...@us...> - 2005-11-02 03:20:24
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12900 Modified Files: easymod_install.php Log Message: Wanted a separate commit for this one. Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** easymod_install.php 2 Nov 2005 03:13:36 -0000 1.31 --- easymod_install.php 2 Nov 2005 03:20:16 -0000 1.32 *************** *** 35,38 **** --- 35,56 ---- require($phpbb_root_path . 'includes/functions_admin.'.$phpEx); + // + // Session Management. + // + $userdata = session_pagestart($user_ip, PAGE_INDEX); + init_userprefs($userdata); + + // + // Only administrators here, please + // + if( !$userdata['session_logged_in'] ) + { + redirect(append_sid("login.$phpEx?redirect=".basename(__FILE__), true)); + } + if( $userdata['user_level'] != ADMIN ) + { + message_die(GENERAL_MESSAGE, $lang['Not_admin']); + } + $script_path = 'admin/mods/easymod/'; //// |
From: Markus P. <mar...@us...> - 2005-11-02 03:13:45
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11784 Modified Files: easymod_install.php Log Message: Oops! We are now using stripslashes, fixing the quotes used in SQL queries. Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** easymod_install.php 31 Oct 2005 17:57:15 -0000 1.30 --- easymod_install.php 2 Nov 2005 03:13:36 -0000 1.31 *************** *** 1635,1647 **** em_db_insert('EM_version', $easymod_install_version); em_db_insert('EM_password', $em_md5); ! em_db_insert('EM_read', str_replace("\'", "''", $read)); ! em_db_insert('EM_write', str_replace("\'", "''", $write)); ! em_db_insert('EM_move', str_replace("\'", "''", $move)); ! em_db_insert('EM_ftp_dir', str_replace("\'", "''", $ftp_dir)); ! em_db_insert('EM_ftp_user', str_replace("\'", "''", $ftp_user)); ! em_db_insert('EM_ftp_pass', str_replace("\'", "''", $ftp_cipher)); ! em_db_insert('EM_ftp_host', str_replace("\'", "''", $ftp_host)); em_db_insert('EM_ftp_port', $ftp_port); ! em_db_insert('EM_ftp_type', str_replace("\'", "''", $ftp_type)); em_db_insert('EM_ftp_cache', $ftp_cache); } --- 1635,1647 ---- em_db_insert('EM_version', $easymod_install_version); em_db_insert('EM_password', $em_md5); ! em_db_insert('EM_read', str_replace("'", "''", $read)); ! em_db_insert('EM_write', str_replace("'", "''", $write)); ! em_db_insert('EM_move', str_replace("'", "''", $move)); ! em_db_insert('EM_ftp_dir', str_replace("'", "''", $ftp_dir)); ! em_db_insert('EM_ftp_user', str_replace("'", "''", $ftp_user)); ! em_db_insert('EM_ftp_pass', str_replace("'", "''", $ftp_cipher)); ! em_db_insert('EM_ftp_host', str_replace("'", "''", $ftp_host)); em_db_insert('EM_ftp_port', $ftp_port); ! em_db_insert('EM_ftp_type', str_replace("'", "''", $ftp_type)); em_db_insert('EM_ftp_cache', $ftp_cache); } *************** *** 1652,1664 **** em_db_update('EM_version', $easymod_install_version); em_db_update('EM_password', $em_md5); ! em_db_update('EM_read', str_replace("\'", "''", $read)); ! em_db_update('EM_write', str_replace("\'", "''", $write)); ! em_db_update('EM_move', str_replace("\'", "''", $move)); ! em_db_update('EM_ftp_dir', str_replace("\'", "''", $ftp_dir)); ! em_db_update('EM_ftp_user', str_replace("\'", "''", $ftp_user)); ! em_db_update('EM_ftp_pass', str_replace("\'", "''", $ftp_cipher)); // 0.0.10a and later see if we have already made the EM_ftp_host field ! if (!add_new_config('EM_ftp_host', str_replace("\'", "''", $ftp_host))) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_config_table']) ; --- 1652,1664 ---- em_db_update('EM_version', $easymod_install_version); em_db_update('EM_password', $em_md5); ! em_db_update('EM_read', str_replace("'", "''", $read)); ! em_db_update('EM_write', str_replace("'", "''", $write)); ! em_db_update('EM_move', str_replace("'", "''", $move)); ! em_db_update('EM_ftp_dir', str_replace("'", "''", $ftp_dir)); ! em_db_update('EM_ftp_user', str_replace("'", "''", $ftp_user)); ! em_db_update('EM_ftp_pass', str_replace("'", "''", $ftp_cipher)); // 0.0.10a and later see if we have already made the EM_ftp_host field ! if (!add_new_config('EM_ftp_host', str_replace("'", "''", $ftp_host))) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_config_table']) ; *************** *** 1672,1676 **** // 0.0.10c and later see if we have already made the EM_ftp_type field ! if (!add_new_config('EM_ftp_type', str_replace("\'", "''", $ftp_type))) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_config_table']) ; --- 1672,1676 ---- // 0.0.10c and later see if we have already made the EM_ftp_type field ! if (!add_new_config('EM_ftp_type', str_replace("'", "''", $ftp_type))) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_config_table']) ; |
From: Markus P. <mar...@us...> - 2005-10-31 17:57:27
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12963/mods/easymod/em_includes Modified Files: em_cipher.php em_ftp.php em_functions.php em_modio.php em_schema.php 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: em_cipher.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_cipher.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** em_cipher.php 11 Jun 2005 23:05:53 -0000 1.3 --- em_cipher.php 31 Oct 2005 17:57:15 -0000 1.4 *************** *** 543,548 **** $encrypted = ''; ! // added by Nuttzy, we want to make sure the password is nice and long so brute forcers won't know if this ! // is a really short pw $plaintext .= $this->filler ; --- 543,548 ---- $encrypted = ''; ! // added by Nuttzy, we want to make sure the password is nice and long so brute forcers won't know if this ! // is a really short pw $plaintext .= $this->filler ; *************** *** 564,582 **** } ! // added by Nuttzy - we'll be storing the result in a DB so we need to replace ' with \' ! $encrypted = addslashes( $encrypted) ; ! // TAKE TWO: the way General Config settings work in phpBB, this isn't sufficient, get rid of the ' all together ! // $encrypted = str_replace( "\'", "''", $encrypted) ; ! $encrypted = str_replace( "\'", "NUTTICK", $encrypted) ; ! // NOTE: a cipher of "single'quote" (the cipher is the stuff between the double quotes) has the ' changed ! // to \' and again to ''. So the SQL string we generate for the DB looks like "single''quote". But this is ! // all just so the string is formed properly and what actually gets stored in the DB is "single'quote". The ! // same is true for any slashes that get added. The slashes won't actually show up when viewing the DB ;-) ! // change encoding for storage (postgres problems) ! $encrypted = utf8_encode($encrypted); ! return $encrypted ; } --- 564,586 ---- } ! // added by Nuttzy - we'll be storing the result in a DB so we need to replace ' with \' ! $encrypted = addslashes( $encrypted) ; ! // TAKE TWO: the way General Config settings work in phpBB, this isn't sufficient, get rid of the ' all together ! // $encrypted = str_replace("\'", "''", $encrypted) ; ! $encrypted = str_replace("\'", 'NUTTICK', $encrypted); ! $encrypted = str_replace("\n", 'NUTLINE', $encrypted); ! // NOTE: a cipher of "single'quote" (the cipher is the stuff between the double quotes) has the ' changed ! // to \' and again to ''. So the SQL string we generate for the DB looks like "single''quote". But this is ! // all just so the string is formed properly and what actually gets stored in the DB is "single'quote". The ! // same is true for any slashes that get added. The slashes won't actually show up when viewing the DB ;-) ! // change encoding for storage (postgres problems) ! if( function_exists('utf8_encode') ) ! { ! $encrypted = utf8_encode($encrypted); ! } ! return $encrypted ; } *************** *** 586,593 **** { // decode for use (postgres storage problems) ! $ciphertext = utf8_decode($ciphertext); ! // TAKE TWO: the way General Config settings work in phpBB, this isn't sufficient, get rid of the ' all together ! $ciphertext = str_replace( 'NUTTICK', "'", $ciphertext) ; $decrypted = ''; --- 590,601 ---- { // decode for use (postgres storage problems) ! if( function_exists('utf8_decode') ) ! { ! $ciphertext = utf8_decode($ciphertext); ! } ! // TAKE TWO: the way General Config settings work in phpBB, this isn't sufficient, get rid of the ' all together ! $ciphertext = str_replace('NUTTICK', "'", $ciphertext); ! $ciphertext = str_replace('NUTLINE', "\n", $ciphertext); $decrypted = ''; *************** *** 608,617 **** } ! // added by nuttzy, we need strip off the extra characters we added ! $decrypted = substr( $decrypted, 0, strlen($decrypted) - strlen($this->filler)) ; ! return $decrypted; } } ! ?> --- 616,625 ---- } ! // added by nuttzy, we need strip off the extra characters we added ! $decrypted = substr( $decrypted, 0, strlen($decrypted) - strlen($this->filler)) ; ! return $decrypted; } } ! ?> \ No newline at end of file Index: em_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_functions.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** em_functions.php 29 Jul 2005 17:33:08 -0000 1.16 --- em_functions.php 31 Oct 2005 17:57:15 -0000 1.17 *************** *** 328,332 **** // change subSilver to the current template as appropriate. $cur_template = preg_replace('#templates/(.*?)/.*#i','$1',$file_list[$file_count]->path); ! $search_array = ($cur_template == '') ? $search_array : str_replace('subSilver',$cur_template,$search_array); $line_return = '' ; --- 328,334 ---- // change subSilver to the current template as appropriate. $cur_template = preg_replace('#templates/(.*?)/.*#i','$1',$file_list[$file_count]->path); ! // $search_array = ($cur_template == '') ? $search_array : str_replace('subSilver',$cur_template,$search_array); ! // -=ET=-'s bugfix: http://sourceforge.net/tracker/index.php?func=detail&aid=1261039&group_id=136984&atid=737391 ! $search_array = ($cur_template == $file_list[$file_count]->path) ? $search_array : str_replace('subSilver',$cur_template,$search_array); $line_return = '' ; *************** *** 566,570 **** { $cur_template = preg_replace('#templates/(.*?)/.*#i','$1',$file_list[$file_count]->path); ! $search_fragment = ($cur_template == '') ? $search_fragment : str_replace('subSilver',$cur_template,$search_fragment); $found_fragment = false ; --- 568,574 ---- { $cur_template = preg_replace('#templates/(.*?)/.*#i','$1',$file_list[$file_count]->path); ! // $search_fragment = ($cur_template == '') ? $search_fragment : str_replace('subSilver',$cur_template,$search_fragment); ! // -=ET=-'s bugfix: http://sourceforge.net/tracker/index.php?func=detail&aid=1261039&group_id=136984&atid=737391 ! $search_fragment = ($cur_template == $file_list[$file_count]->path) ? $search_fragment : str_replace('subSilver',$cur_template,$search_fragment); $found_fragment = false ; *************** *** 1313,1316 **** } ! ?> --- 1317,1331 ---- } + // used only for debugging purposes only + /* + function em_vd($mixed, $title = '') + { + ob_start(); + var_dump($mixed); + $content = ob_get_contents(); + ob_end_clean(); + echo '<pre>' . ( !empty($title) ? ($title . ': ') : '' ) . htmlspecialchars($content) . "</pre>\n"; + } + */ ! ?> \ No newline at end of file Index: em_schema.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_schema.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** em_schema.php 21 Jun 2005 05:30:09 -0000 1.8 --- em_schema.php 31 Oct 2005 17:57:15 -0000 1.9 *************** *** 1284,1286 **** } ! ?> --- 1284,1286 ---- } ! ?> \ No newline at end of file Index: em_modio.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_modio.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** em_modio.php 8 Jul 2005 00:22:56 -0000 1.6 --- em_modio.php 31 Oct 2005 17:57:15 -0000 1.7 *************** *** 374,388 **** { // determing the destination path and filename if ($create_command) { ! $to_dir = $script_path . '/' . $install_path . $this->path ; ! $to_file = $this->filename ; } else { ! $to_dir = $script_path . '/' . $install_path . 'processed/' . $this->path ; ! $to_file = $this->filename . '.txt' ; } // leave some breadcrumbs so we can cd back to phpbb_root $return_path = '' ; --- 374,390 ---- { // determing the destination path and filename + $ipath = strpos($install_path, './') === 0 ? substr($install_path, 2) : $install_path; if ($create_command) { ! $to_dir = $script_path . $ipath . $this->path; ! $to_file = $this->filename; } else { ! $to_dir = $script_path . $ipath . 'processed/' . $this->path; ! $to_file = $this->filename . '.txt'; } + // leave some breadcrumbs so we can cd back to phpbb_root $return_path = '' ; *************** *** 692,694 **** ! ?> --- 694,696 ---- ! ?> \ No newline at end of file Index: em_ftp.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_ftp.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** em_ftp.php 10 Jul 2005 22:06:55 -0000 1.7 --- em_ftp.php 31 Oct 2005 17:57:15 -0000 1.8 *************** *** 1432,1434 **** } ! ?> --- 1432,1434 ---- } ! ?> \ No newline at end of file |
From: Markus P. <mar...@us...> - 2005-10-31 17:57:27
|
Update of /cvsroot/easymod/easymod2/mods/easymod/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12963/mods/easymod/templates Modified Files: display_debug.tpl display_debug_footer.tpl display_error.tpl error.tpl form_settings.tpl ftp_settings.tpl hidden_access.tpl install_info.tpl page_start.tpl step1_classic.tpl step1_simple.tpl step1b_ftp.tpl step1b_nowrite_nocopy.tpl step1b_simple.tpl step1b_write_nocopy.tpl step1c_empw.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: step1_simple.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/step1_simple.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** step1_simple.tpl 11 Jun 2005 23:31:32 -0000 1.3 --- step1_simple.tpl 31 Oct 2005 17:57:15 -0000 1.4 *************** *** 1,3 **** ! <span class="gen">{{EM_simple_mode}} :: <a href="easymod_install.php?setup=advanced">{{EM_advanced_mode}}</a></span><br> <table width="100%" border="1" cellpadding="5"> <tr> --- 1,3 ---- ! <span class="gen">{{EM_simple_mode}} :: <a href="easymod_install.php?setup=advanced">{{EM_advanced_mode}}</a></span><br /> <table width="100%" border="1" cellpadding="5"> <tr> *************** *** 10,14 **** <br /> ! <span class="gen">{{EM_support}}</class><br> </td><td valign="top" class="row2"> --- 10,14 ---- <br /> ! <span class="gen">{{EM_support}}</span><br /> </td><td valign="top" class="row2"> *************** *** 34,38 **** </tr> <tr> ! <td class="row1" align="left"><br></td> </tr> <tr> --- 34,38 ---- </tr> <tr> ! <td class="row1" align="left"><br /></td> </tr> <tr> *************** *** 49,52 **** </td></tr> </table> ! <br> ! <br> --- 49,52 ---- </td></tr> </table> ! <br /> ! <br /> Index: display_debug.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/display_debug.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** display_debug.tpl 1 May 2005 07:24:36 -0000 1.2 --- display_debug.tpl 31 Oct 2005 17:57:15 -0000 1.3 *************** *** 7,48 **** <td class="row1"><table width="100%" cellspacing="0" cellpadding="1" border="0"> <tr> ! <td align="left"><span class="gen"> ! ({{EM_debug_format}})<br> ! <br> ! [quote="{{EM_debug_installer}} v{{EM_VERSION}}"]<br> ! [b]<b>{{EM_phpBB_version}}:</b>[/b] {{PHPBB_VERSION}}<br> ! [b]<b>{{EM_debug_work_dir}}:</b>[/b] {{CWD}}<br> ! [b]<b>{{EM_debug_step}}:</b>[/b] {{STEP}}<br> ! [b]<b>{{EM_debug_mode}}:</b>[/b] {{MODE}}<br> ! <br> ! [quote="{{EM_debug_the_error}}"]<br> ! {{ERROR}}<?php echo ?><br> ! [/quote]<br> ! <br> ! [b]<b>{{EM_debug_permissions}}:</b>[/b] ({{EM_debug_sys_errors}})<br> <!-- FILE ACCESS --> {{[./templates/file_access.tpl]}} <!-- FILE ACCESS --> ! <br> ! <br> ! <br> ! [b]<b>{{EM_debug_recommend}}:</b>[/b]<br> ! [b]<b>{{EM_debug_write}}:</b>[/b] {{WRITE_REC}}<br> ! [b]<b>{{EM_debug_move}}:</b>[/b] {{MOVE_REC}}<br> ! <br> ! [b]<b>{{EM_debug_selected}}:</b>[/b]<br> ! [b]<b>{{EM_debug_write}}:</b>[/b] {{WRITE_SEL}}<br> ! [b]<b>{{EM_debug_move}}:</b>[/b] {{MOVE_SEL}}<br> ! [b]<b>{{EM_debug_ftp_dir}}:</b>[/b] {{FTP_DIR}}<br> ! [b]<b>{{EM_debug_ftp_host}}:</b>[/b] {{FTP_HOST}}<br> ! [b]<b>{{EM_debug_ftp_port}}:</b>[/b] {{FTP_PORT}}<br> ! [b]<b>{{EM_debug_ftp_debug}}:</b>[/b] {{FTP_DEBUG}}<br> ! [b]<b>{{EM_debug_ftp_ext}}:</b>[/b] {{FTP_EXT}}<br> ! [b]<b>{{EM_debug_ftp_cache}}:</b>[/b] {{FTP_CACHE}}<br> ! <br> ! [b]<b>{{EM_debug_listing}}:</b>[/b]<br> ! [code]<br> {{FILE_LISTING}} ! [/code]<br> --- 7,48 ---- <td class="row1"><table width="100%" cellspacing="0" cellpadding="1" border="0"> <tr> ! <td align="left"><div class="gen"> ! ({{EM_debug_format}})<br /> ! <br /> ! [quote="{{EM_debug_installer}} v{{EM_VERSION}}"]<br /> ! [b]<b>{{EM_phpBB_version}}:</b>[/b] {{PHPBB_VERSION}}<br /> ! [b]<b>{{EM_debug_work_dir}}:</b>[/b] {{CWD}}<br /> ! [b]<b>{{EM_debug_step}}:</b>[/b] {{STEP}}<br /> ! [b]<b>{{EM_debug_mode}}:</b>[/b] {{MODE}}<br /> ! <br /> ! [quote="{{EM_debug_the_error}}"]<br /> ! {{ERROR}}<?php echo ?><br /> ! [/quote]<br /> ! <br /> ! [b]<b>{{EM_debug_permissions}}:</b>[/b] ({{EM_debug_sys_errors}})<br /> <!-- FILE ACCESS --> {{[./templates/file_access.tpl]}} <!-- FILE ACCESS --> ! <br /> ! <br /> ! <br /> ! [b]<b>{{EM_debug_recommend}}:</b>[/b]<br /> ! [b]<b>{{EM_debug_write}}:</b>[/b] {{WRITE_REC}}<br /> ! [b]<b>{{EM_debug_move}}:</b>[/b] {{MOVE_REC}}<br /> ! <br /> ! [b]<b>{{EM_debug_selected}}:</b>[/b]<br /> ! [b]<b>{{EM_debug_write}}:</b>[/b] {{WRITE_SEL}}<br /> ! [b]<b>{{EM_debug_move}}:</b>[/b] {{MOVE_SEL}}<br /> ! [b]<b>{{EM_debug_ftp_dir}}:</b>[/b] {{FTP_DIR}}<br /> ! [b]<b>{{EM_debug_ftp_host}}:</b>[/b] {{FTP_HOST}}<br /> ! [b]<b>{{EM_debug_ftp_port}}:</b>[/b] {{FTP_PORT}}<br /> ! [b]<b>{{EM_debug_ftp_debug}}:</b>[/b] {{FTP_DEBUG}}<br /> ! [b]<b>{{EM_debug_ftp_ext}}:</b>[/b] {{FTP_EXT}}<br /> ! [b]<b>{{EM_debug_ftp_cache}}:</b>[/b] {{FTP_CACHE}}<br /> ! <br /> ! [b]<b>{{EM_debug_listing}}:</b>[/b]<br /> ! [code]<br /> {{FILE_LISTING}} ! [/code]<br /> Index: install_info.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/install_info.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** install_info.tpl 20 Jun 2005 22:15:43 -0000 1.2 --- install_info.tpl 31 Oct 2005 17:57:15 -0000 1.3 *************** *** 26,30 **** <td class="gen" nowrap="nowrap">{{L_EM_STATUS}}</td> <td class="gen"> :: </td> ! <td class="gen" width="100%"><b>{{STATUS}}</td> </tr> </table> --- 26,30 ---- <td class="gen" nowrap="nowrap">{{L_EM_STATUS}}</td> <td class="gen"> :: </td> ! <td class="gen" width="100%"><b>{{STATUS}}</b></td> </tr> </table> Index: form_settings.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/form_settings.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** form_settings.tpl 24 Apr 2005 14:59:53 -0000 1.1 --- form_settings.tpl 31 Oct 2005 17:57:15 -0000 1.2 *************** *** 1,5 **** <form action="{{U_FORM}}" name="install" method="post"> {{HIDDEN}} ! <input type="hidden" name="install_step" value="{{STEP}}"> {{MAIN}} {{RESCAN}} --- 1,5 ---- <form action="{{U_FORM}}" name="install" method="post"> {{HIDDEN}} ! <input type="hidden" name="install_step" value="{{STEP}}" /> {{MAIN}} {{RESCAN}} Index: step1b_write_nocopy.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/step1b_write_nocopy.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** step1b_write_nocopy.tpl 5 Jun 2005 23:37:05 -0000 1.2 --- step1b_write_nocopy.tpl 31 Oct 2005 17:57:15 -0000 1.3 *************** *** 10,29 **** <tr> <td class="row1" align="left"><input type="radio" name="option" value="ftp" checked="checked" /></td> ! <td class="row1" align="left" width="*"><span class="gen">{{EM_try_ftp}}</span></td> </tr> <tr> <td class="row1" align="left"><input type="radio" name="option" value="idunno" /></td> ! <td class="row1" align="left" width="*"><span class="gen">{{EM_perms_mod_rescan}}</span></td> </tr> <tr> <td class="row1" align="left"><input type="radio" name="option" value="post_process" /></td> ! <td class="row1" align="left" width="*"><span class="gen">{{EM_use_post_process}}</span></td> </tr> <tr> <td class="row1" align="left"><input type="radio" name="option" value="manual" /></td> ! <td class="row1" align="left" width="*"><span class="gen">{{EM_download_manual}}</span></td> </tr> <td class="row1" align="left"><input type="radio" name="option" value="advanced" /></td> ! <td class="row1" align="left" width="*"><span class="gen">{{EM_select_else}}</span></td> <tr> <td class="row1" align="center" colspan="2"><br /></td> --- 10,29 ---- <tr> <td class="row1" align="left"><input type="radio" name="option" value="ftp" checked="checked" /></td> ! <td class="row1" align="left" width="100%"><span class="gen">{{EM_try_ftp}}</span></td> </tr> <tr> <td class="row1" align="left"><input type="radio" name="option" value="idunno" /></td> ! <td class="row1" align="left" width="100%"><span class="gen">{{EM_perms_mod_rescan}}</span></td> </tr> <tr> <td class="row1" align="left"><input type="radio" name="option" value="post_process" /></td> ! <td class="row1" align="left" width="100%"><span class="gen">{{EM_use_post_process}}</span></td> </tr> <tr> <td class="row1" align="left"><input type="radio" name="option" value="manual" /></td> ! <td class="row1" align="left" width="100%"><span class="gen">{{EM_download_manual}}</span></td> </tr> <td class="row1" align="left"><input type="radio" name="option" value="advanced" /></td> ! <td class="row1" align="left" width="100%"><span class="gen">{{EM_select_else}}</span></td> <tr> <td class="row1" align="center" colspan="2"><br /></td> Index: page_start.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/page_start.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** page_start.tpl 24 Apr 2005 14:59:53 -0000 1.1 --- page_start.tpl 31 Oct 2005 17:57:15 -0000 1.2 *************** *** 2,5 **** --- 2,6 ---- <html> <head> + <title>{{TITLE}}</title> <meta http-equiv="Content-Type" content="text/html;"> <meta http-equiv="Content-Style-Type" content="text/css"> Index: display_error.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/display_error.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** display_error.tpl 24 Apr 2005 14:59:53 -0000 1.1 --- display_error.tpl 31 Oct 2005 17:57:15 -0000 1.2 *************** *** 1,4 **** ! <br> <table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0"> <tr> --- 1,4 ---- ! <br /> <table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0"> <tr> *************** *** 12,16 **** <tr> <td align="center"><span class="gen"> ! {{ERROR}}<br> </span></td> </tr> --- 12,16 ---- <tr> <td align="center"><span class="gen"> ! {{ERROR}}<br /> </span></td> </tr> *************** *** 21,23 **** </tr> </table> ! <br> --- 21,23 ---- </tr> </table> ! <br /> Index: ftp_settings.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/ftp_settings.tpl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ftp_settings.tpl 19 Jun 2005 22:46:42 -0000 1.5 --- ftp_settings.tpl 31 Oct 2005 17:57:15 -0000 1.6 *************** *** 8,28 **** <tr> <td class="row1" align="right"><span class="gen">{{EM_ftp_dir}}</span></td> ! <td class="row2"><input type="text" name="ftp_dir"> <span class="gen">({{DIR_EX}}) (<a href="{{U_FORM}}?mode=help#ftp_dir" onClick="return helpwin(this)">{{EM_more_info}}</a>)</span></td> </tr> <tr> <td class="row1" align="right"><span class="gen">{{EM_ftp_user}}</span></td> ! <td class="row2"><input type="text" name="ftp_user"></td> </tr> <tr> <td class="row1" align="right"><span class="gen">{{EM_ftp_pass}}</span></td> ! <td class="row2"><input type="password" name="ftp_pass"></td> </tr> <tr> <td class="row1" align="right"><span class="gen">{{EM_ftp_host}}</span></td> ! <td class="row2"><input type="text" name="ftp_host" value="localhost"> <span class="gen">{{EM_ftp_host_info}} (<a href="{{U_FORM}}?mode=help#ftp_host" onClick="return helpwin(this)">{{EM_more_info}}</a>)</span></td> </tr> <tr> <td class="row1" align="right"><span class="gen">{{EM_ftp_port}}</span></td> ! <td class="row2"><input type="text" size="5" maxlength="5" name="ftp_port" value="21"> <span class="gen">{{EM_ftp_port_info}} (<a href="{{U_FORM}}?mode=help#ftp_port" onClick="return helpwin(this)">{{EM_more_info}}</a>)</span></td> </tr> <tr> --- 8,28 ---- <tr> <td class="row1" align="right"><span class="gen">{{EM_ftp_dir}}</span></td> ! <td class="row2"><input type="text" name="ftp_dir" /> <span class="gen">({{DIR_EX}}) (<a href="{{U_FORM}}?mode=help#ftp_dir" onClick="return helpwin(this)">{{EM_more_info}}</a>)</span></td> </tr> <tr> <td class="row1" align="right"><span class="gen">{{EM_ftp_user}}</span></td> ! <td class="row2"><input type="text" name="ftp_user" /></td> </tr> <tr> <td class="row1" align="right"><span class="gen">{{EM_ftp_pass}}</span></td> ! <td class="row2"><input type="password" name="ftp_pass" /></td> </tr> <tr> <td class="row1" align="right"><span class="gen">{{EM_ftp_host}}</span></td> ! <td class="row2"><input type="text" name="ftp_host" value="localhost" /> <span class="gen">{{EM_ftp_host_info}} (<a href="{{U_FORM}}?mode=help#ftp_host" onClick="return helpwin(this)">{{EM_more_info}}</a>)</span></td> </tr> <tr> <td class="row1" align="right"><span class="gen">{{EM_ftp_port}}</span></td> ! <td class="row2"><input type="text" size="5" maxlength="5" name="ftp_port" value="21" /> <span class="gen">{{EM_ftp_port_info}} (<a href="{{U_FORM}}?mode=help#ftp_port" onClick="return helpwin(this)">{{EM_more_info}}</a>)</span></td> </tr> <tr> *************** *** 32,37 **** <td class="row1" align="right"><span class="gen">{{EM_ftp_debug}}</span></td> <td class="row2"> ! <input type="radio" name="ftp_debug" value="1"><span class="gen">{{EM_yes}}</span> ! <input type="radio" name="ftp_debug" value="0" checked="checked">{{EM_no}}</span> <span class="gen">{{EM_ftp_debug_not}}</span> </td> </tr> --- 32,37 ---- <td class="row1" align="right"><span class="gen">{{EM_ftp_debug}}</span></td> <td class="row2"> ! <input type="radio" name="ftp_debug" value="1" /><span class="gen">{{EM_yes}}</span> ! <input type="radio" name="ftp_debug" value="0" checked="checked" /><span class="gen">{{EM_no}}</span> <span class="gen">{{EM_ftp_debug_not}}</span> </td> </tr> *************** *** 39,44 **** <td class="row1" align="right"><span class="gen">{{EM_ftp_use_ext}}</span></td> <td class="row2">{{FTP_EXT_MSG}} ! <input type="radio" name="ftp_type" value="ext" {{EXT_YES}}><span class="gen">{{EM_yes}}</span> ! <input type="radio" name="ftp_type" value="fsock" {{EXT_NO}}>{{EM_no}}</span> <span class="gen">{{EM_ftp_ext_not}} (<a href="{{U_FORM}}?mode=help#ftp_php_ext" onClick="return helpwin(this)">{{EM_more_info}}</a>)</span> {{FTP_EXT_CLOSE}} </td> --- 39,44 ---- <td class="row1" align="right"><span class="gen">{{EM_ftp_use_ext}}</span></td> <td class="row2">{{FTP_EXT_MSG}} ! <input type="radio" name="ftp_type" value="ext" {{EXT_YES}} /><span class="gen">{{EM_yes}}</span> ! <input type="radio" name="ftp_type" value="fsock" {{EXT_NO}} /><span class="gen">{{EM_no}}</span> <span class="gen">{{EM_ftp_ext_not}} (<a href="{{U_FORM}}?mode=help#ftp_php_ext" onClick="return helpwin(this)">{{EM_more_info}}</a>)</span> {{FTP_EXT_CLOSE}} </td> *************** *** 47,52 **** <td class="row1" align="right"><span class="gen">{{EM_ftp_use_cache}}</span></td> <td class="row2">{{FTP_CACHE_MSG}} ! <input type="radio" name="ftp_cache" value="1" {{CACHE_YES}}><span class="gen">{{EM_yes}}</span> ! <input type="radio" name="ftp_cache" value="0" {{CACHE_NO}}>{{EM_no}}</span> <span class="gen">{{EM_ftp_ext_not}} (<a href="{{U_FORM}}?mode=help#ftp_cache" onClick="return helpwin(this)">{{EM_more_info}}</a>)</span> {{FTP_CACHE_CLOSE}} </td> --- 47,52 ---- <td class="row1" align="right"><span class="gen">{{EM_ftp_use_cache}}</span></td> <td class="row2">{{FTP_CACHE_MSG}} ! <input type="radio" name="ftp_cache" value="1" {{CACHE_YES}} /><span class="gen">{{EM_yes}}</span> ! <input type="radio" name="ftp_cache" value="0" {{CACHE_NO}} /><span class="gen">{{EM_no}}</span> <span class="gen">{{EM_ftp_ext_not}} (<a href="{{U_FORM}}?mode=help#ftp_cache" onClick="return helpwin(this)">{{EM_more_info}}</a>)</span> {{FTP_CACHE_CLOSE}} </td> Index: step1_classic.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/step1_classic.tpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** step1_classic.tpl 19 Jun 2005 22:46:42 -0000 1.4 --- step1_classic.tpl 31 Oct 2005 17:57:15 -0000 1.5 *************** *** 1,3 **** ! <span class="gen"><a href="easymod_install.php?setup=simple">{{EM_simple_mode}}</a> :: {{EM_advanced_mode}}</span><br> <table width="100%" border="1" cellpadding="5"> <tr> --- 1,3 ---- ! <span class="gen"><a href="easymod_install.php?setup=simple">{{EM_simple_mode}}</a> :: {{EM_advanced_mode}}</span><br /> <table width="100%" border="1" cellpadding="5"> <tr> *************** *** 13,18 **** <!-- FILE ACCESS --> ! <br> ! <span class="gen">{{EM_support}}</class><br> </td><td valign="top" class="row2"> --- 13,18 ---- <!-- FILE ACCESS --> ! <br /> ! <span class="gen">{{EM_support}}</span><br /> </td><td valign="top" class="row2"> *************** *** 74,77 **** </td></tr> </table> ! <br> ! <br> --- 74,77 ---- </td></tr> </table> ! <br /> ! <br /> Index: hidden_access.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/hidden_access.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hidden_access.tpl 24 Apr 2005 14:59:53 -0000 1.1 --- hidden_access.tpl 31 Oct 2005 17:57:15 -0000 1.2 *************** *** 1,10 **** ! <input type="hidden" name="read_access" value="{{READ_ACCESS}}"> ! <input type="hidden" name="write_access" value="{{WRITE_ACCESS}}"> ! <input type="hidden" name="root_write" value="{{ROOT_WRITE}}"> ! <input type="hidden" name="tmp_write" value="{{TMP_WRITE}}"> ! <input type="hidden" name="chmod_access" value="{{CHMOD_ACCESS}}"> ! <input type="hidden" name="unlink_access" value="{{UNLINK_ACCESS}}"> ! <input type="hidden" name="mkdir_access" value="{{MKDIR_ACCESS}}"> ! <input type="hidden" name="copy_access" value="{{COPY_ACCESS}}"> ! <input type="hidden" name="language" value="{{LANGUAGE}}"> --- 1,10 ---- ! <input type="hidden" name="read_access" value="{{READ_ACCESS}}" /> ! <input type="hidden" name="write_access" value="{{WRITE_ACCESS}}" /> ! <input type="hidden" name="root_write" value="{{ROOT_WRITE}}" /> ! <input type="hidden" name="tmp_write" value="{{TMP_WRITE}}" /> ! <input type="hidden" name="chmod_access" value="{{CHMOD_ACCESS}}" /> ! <input type="hidden" name="unlink_access" value="{{UNLINK_ACCESS}}" /> ! <input type="hidden" name="mkdir_access" value="{{MKDIR_ACCESS}}" /> ! <input type="hidden" name="copy_access" value="{{COPY_ACCESS}}" /> ! <input type="hidden" name="language" value="{{LANGUAGE}}" /> Index: display_debug_footer.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/display_debug_footer.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** display_debug_footer.tpl 24 Apr 2005 14:59:53 -0000 1.1 --- display_debug_footer.tpl 31 Oct 2005 17:57:15 -0000 1.2 *************** *** 3,7 **** ! </span></td> </tr> <tr> --- 3,7 ---- ! </div></td> </tr> <tr> Index: error.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/error.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** error.tpl 24 Apr 2005 14:59:53 -0000 1.1 --- error.tpl 31 Oct 2005 17:57:15 -0000 1.2 *************** *** 1,5 **** {{NO_ERROR_START}} ! <br> <table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0"> <tr> --- 1,5 ---- {{NO_ERROR_START}} ! <br /> <table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0"> <tr> *************** *** 13,17 **** <tr> <td align="center"><span class="gen"> ! {{ERROR}}<br> </span></td> </tr> --- 13,17 ---- <tr> <td align="center"><span class="gen"> ! {{ERROR}}<br /> </span></td> </tr> *************** *** 22,25 **** </tr> </table> ! <br> {{NO_ERROR_END}} --- 22,25 ---- </tr> </table> ! <br /> {{NO_ERROR_END}} Index: step1b_nowrite_nocopy.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/step1b_nowrite_nocopy.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** step1b_nowrite_nocopy.tpl 5 Jun 2005 23:37:05 -0000 1.2 --- step1b_nowrite_nocopy.tpl 31 Oct 2005 17:57:15 -0000 1.3 *************** *** 11,27 **** <tr> <td class="row1" align="left"><input type="radio" name="option" value="ftp" /></td> ! <td class="row1" align="left" width="*"><span class="gen">{{EM_try_ftp}}</span></td> </tr> <tr> <td class="row1" align="left"><input type="radio" name="option" value="idunno" /></td> ! <td class="row1" align="left" width="*"><span class="gen">{{EM_perms_mod_rescan}}</span></td> </tr> <tr> <td class="row1" align="left"><input type="radio" name="option" value="download" /></td> ! <td class="row1" align="left" width="*"><span class="gen">{{EM_download_manual}}</span></td> </tr> </tr> <td class="row1" align="left"><input type="radio" name="option" value="advanced" /></td> ! <td class="row1" align="left" width="*"><span class="gen">{{EM_select_else}}</span></td> <tr> <tr> --- 11,27 ---- <tr> <td class="row1" align="left"><input type="radio" name="option" value="ftp" /></td> ! <td class="row1" align="left" width="100%"><span class="gen">{{EM_try_ftp}}</span></td> </tr> <tr> <td class="row1" align="left"><input type="radio" name="option" value="idunno" /></td> ! <td class="row1" align="left" width="100%"><span class="gen">{{EM_perms_mod_rescan}}</span></td> </tr> <tr> <td class="row1" align="left"><input type="radio" name="option" value="download" /></td> ! <td class="row1" align="left" width="100%"><span class="gen">{{EM_download_manual}}</span></td> </tr> </tr> <td class="row1" align="left"><input type="radio" name="option" value="advanced" /></td> ! <td class="row1" align="left" width="100%"><span class="gen">{{EM_select_else}}</span></td> <tr> <tr> Index: step1b_simple.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/step1b_simple.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** step1b_simple.tpl 5 Jun 2005 23:37:05 -0000 1.2 --- step1b_simple.tpl 31 Oct 2005 17:57:15 -0000 1.3 *************** *** 8,12 **** <br /> ! <span class="gen">{{EM_support}}</class><br> </td><td valign="top" class="row2"> --- 8,12 ---- <br /> ! <span class="gen">{{EM_support}}</span><br /> </td><td valign="top" class="row2"> *************** *** 53,56 **** </td></tr> </table> ! <br> ! <br> --- 53,56 ---- </td></tr> </table> ! <br /> ! <br /> Index: step1b_ftp.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/step1b_ftp.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** step1b_ftp.tpl 5 Jun 2005 23:37:05 -0000 1.2 --- step1b_ftp.tpl 31 Oct 2005 17:57:15 -0000 1.3 *************** *** 8,13 **** <br /> ! <br> ! <span class="gen">{{EM_support}}</span><br> </td><td valign="top" class="row2"> --- 8,13 ---- <br /> ! <br /> ! <span class="gen">{{EM_support}}</span><br /> </td><td valign="top" class="row2"> *************** *** 37,40 **** </td></tr> </table> ! <br> ! <br> --- 37,40 ---- </td></tr> </table> ! <br /> ! <br /> Index: step1c_empw.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/step1c_empw.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** step1c_empw.tpl 5 Jun 2005 23:37:05 -0000 1.3 --- step1c_empw.tpl 31 Oct 2005 17:57:15 -0000 1.4 *************** *** 3,10 **** <td valign="top" class="row1" width="290"> ! <br> <img src="./templates/nuttzy.jpg"> ! <br> ! <span class="gen">{{EM_support}}</span><br> </td><td valign="top" class="row2"> --- 3,10 ---- <td valign="top" class="row1" width="290"> ! <br /> <img src="./templates/nuttzy.jpg"> ! <br /> ! <span class="gen">{{EM_support}}</span><br /> </td><td valign="top" class="row2"> *************** *** 44,47 **** </td></tr> </table> ! <br> ! <br> --- 44,47 ---- </td></tr> </table> ! <br /> ! <br /> |
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 ---- |
From: Markus P. <mar...@us...> - 2005-10-31 17:57:23
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12963/mods/easymod Modified Files: easymod_display_functions.php easymod_install.php 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: easymod_display_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_display_functions.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** easymod_display_functions.php 22 Jun 2005 16:35:15 -0000 1.16 --- easymod_display_functions.php 31 Oct 2005 17:57:15 -0000 1.17 *************** *** 135,139 **** // we have to fix the password so it does not have a # in it or else the link won't work $ftp_pass = str_replace('#', '~pound~', $ftp_pass) ; ! $link = "easymod_install.$phpEx?mode=debug&install_step=$install_step&write=$write&move=$move&ftp_dir=$ftp_dir&ftp_user=$ftp_user&ftp_pass=$ftp_pass&ftp_host=$ftp_host&ftp_port=$ftp_port&ftp_debug=$ftp_debug&ftp_type=$ftp_type" ; $variables = array() ; --- 135,139 ---- // we have to fix the password so it does not have a # in it or else the link won't work $ftp_pass = str_replace('#', '~pound~', $ftp_pass) ; ! $link = "easymod_install.$phpEx?mode=debug&install_step=$install_step&write=$write&move=$move&ftp_dir=$ftp_dir&ftp_user=$ftp_user&ftp_pass=$ftp_pass&ftp_host=$ftp_host&ftp_port=$ftp_port&ftp_debug=$ftp_debug&ftp_type=$ftp_type" ; $variables = array() ; *************** *** 1016,1018 **** ! ?> --- 1016,1018 ---- ! ?> \ No newline at end of file Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** easymod_install.php 29 Jul 2005 17:33:07 -0000 1.29 --- easymod_install.php 31 Oct 2005 17:57:15 -0000 1.30 *************** *** 22,58 **** define('IN_PHPBB', 1); $phpbb_root_path = './../../../'; - $script_path = 'admin/mods/easymod/' ; - //// - $easymod_install_version = '0.2.1a' ; - //// ! // PHP5 with register_long_arrays off? ! if (!isset($HTTP_POST_VARS) && isset($_POST)) { [...1032 lines suppressed...] // 0.0.10c and later see if we have already made the EM_ftp_type field ! if (!add_new_config('EM_ftp_type', str_replace("\'", "''", $ftp_type))) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_config_table']) ; *************** *** 1834,1839 **** ! page_footer() ; ! exit ; } --- 1849,1854 ---- ! page_footer(); ! exit; } |
From: Markus P. <mar...@us...> - 2005-09-29 19:37:02
|
Update of /cvsroot/easymod/sql_parser/root/includes/sql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29895 Removed Files: sql_builder_msaccess.php Log Message: Removing MS-Access builder, not supported here anymore. --- sql_builder_msaccess.php DELETED --- |
From: Markus P. <mar...@us...> - 2005-09-29 19:32:29
|
Update of /cvsroot/easymod/sql_parser/root/includes/sql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28672/root/includes/sql Modified Files: sql_parser.php Log Message: Fixed a minor bug in the ALTER TABLE parser. Index: sql_parser.php =================================================================== RCS file: /cvsroot/easymod/sql_parser/root/includes/sql/sql_parser.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sql_parser.php 26 Sep 2005 09:59:13 -0000 1.3 --- sql_parser.php 29 Sep 2005 19:32:21 -0000 1.4 *************** *** 431,439 **** return true; } - if( preg_match('#msaccess#i', $this->sql_layer) ) - { - $builder_name = 'msaccess'; - return true; - } $builder_name = $this->sql_layer; return false; --- 431,434 ---- *************** *** 448,453 **** * @param bool TRUE to show the current table name in the message. * @param bool TRUE to translate table prefixes in the message. */ ! function format_message($message, $count = false, $show_table_name = false, $translate_prefix = true) { global $lang; --- 443,449 ---- * @param bool TRUE to show the current table name in the message. * @param bool TRUE to translate table prefixes in the message. + * @return array Associative array with the following elements: message, stmt_number and table_name */ ! function format_message($message, $stmt_number = false, $show_table_name = false, $translate_prefix = true) { global $lang; *************** *** 458,480 **** $message = str_replace($this->table_prefix, $this->phpbb_prefix, $message); } // Append additional information? ! if( $count !== false ) { ! $message .= sprintf($lang['SQL_in_statement'], $count); } if( $show_table_name ) { ! $table_name = ( $translate_prefix && $this->table_prefix != $this->phpbb_prefix ? str_replace($this->table_prefix, $this->phpbb_prefix, $this->sql_data['table_name']) : $this->sql_data['table_name'] ); ! $message .= sprintf($lang['SQL_in_table_name'], $table_name); } ! return $message; } ! function format_warning($message, $count = false, $show_table_name = false, $translate_prefix = true) { ! $this->warnings[] = $this->format_message($message, $count, $show_table_name, $translate_prefix); } ! function format_error($message, $count = false, $show_table_name = false, $translate_prefix = true) { ! $this->error_message = $this->format_message($message, $count, $show_table_name, $translate_prefix); } --- 454,485 ---- $message = str_replace($this->table_prefix, $this->phpbb_prefix, $message); } + else + { + $translate_prefix = false; + } + + $result = array(); + // Append additional information? ! if( $stmt_number !== false ) { ! $result['stmt_number'] = $stmt_number; ! $message .= sprintf($lang['SQL_in_statement'], $stmt_number); } if( $show_table_name ) { ! $result['table_name'] = ( $translate_prefix ? str_replace($this->table_prefix, $this->phpbb_prefix, $this->sql_data['table_name']) : $this->sql_data['table_name'] ); ! $message .= sprintf($lang['SQL_in_table_name'], $result['table_name']); } ! $result['message'] = $message; ! return $result; } ! function format_warning($message, $stmt_number = false, $show_table_name = false, $translate_prefix = true) { ! $this->warnings[] = $this->format_message($message, $stmt_number, $show_table_name, $translate_prefix); } ! function format_error($message, $stmt_number = false, $show_table_name = false, $translate_prefix = true) { ! $this->error_message = $this->format_message($message, $stmt_number, $show_table_name, $translate_prefix); } *************** *** 1368,1372 **** return false; } ! if( isset($match[2]) && $match[2] == 'COLUMN' ) { $alter_statement = substr($alter_statement, strlen($match[0])); --- 1373,1377 ---- return false; } ! if( isset($match[2]) && strtoupper($match[2]) == 'COLUMN' ) { $alter_statement = substr($alter_statement, strlen($match[0])); |
From: Markus P. <mar...@us...> - 2005-09-27 19:16:57
|
Update of /cvsroot/easymod/sql_parser/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26777 Modified Files: syntax_reference_bbcode.txt Log Message: Changed syntax reference header. Index: syntax_reference_bbcode.txt =================================================================== RCS file: /cvsroot/easymod/sql_parser/docs/syntax_reference_bbcode.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** syntax_reference_bbcode.txt 27 Sep 2005 19:13:23 -0000 1.1 --- syntax_reference_bbcode.txt 27 Sep 2005 19:16:28 -0000 1.2 *************** *** 1,10 **** ! [code]/** ! * ! * @package SQL Parser ! * @version $Id$ ! * @copyright (c) 2005 phpBB Group ! * @license http://opensource.org/licenses/gpl-license.php GNU General Public License ! * ! */[/code] [list][*][size=14][b]Introduction[/b][/size] --- 1,7 ---- ! [code] @package SQL Parser ! @version $Id$ ! @copyright (c) 2005 phpBB Group ! @license http://opensource.org/licenses/gpl-license.php GNU General Public License ! [/code] [list][*][size=14][b]Introduction[/b][/size] |
From: Markus P. <mar...@us...> - 2005-09-27 19:13:35
|
Update of /cvsroot/easymod/sql_parser/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25873/docs Added Files: syntax_reference_bbcode.txt Log Message: Added Syntax Reference in BBCode format (new docs directory). Also fixed a typo in the language file. --- NEW FILE: syntax_reference_bbcode.txt --- [code]/** * * @package SQL Parser * @version $Id: syntax_reference_bbcode.txt,v 1.1 2005/09/27 19:13:23 markus_petrux Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * */[/code] [list][*][size=14][b]Introduction[/b][/size] This document describes the syntax that the SQL Parser for EasyMOD accepts. While it is largely MySQL based, not all options available in the [url=http://dev.mysql.com/doc/mysql/en/index.html]MySQL syntax[/url] are supported. phpBB supports several SQL servers with its Database Abstraction Layer (DBAL) implementation, hence a minimal set of options available to perform DB operations needs to be defined. This is the main goal of the SQL Parser, that is provide support for as much options as possible while making sure all those options are portable. [b]NOTE:[/b] These standards are under development and most importantly open to discussion. However, as being said, whatever is implemented should be portable to, at least, all SQL servers supported by phpBB. [/list] [list][*][size=14][b]Syntax Conventions[/b][/size] This section describes the general rules applied to SQL statements and their components: [list][*]No explicit rule is applied to case. However, keywords and identifiers are case insensitive for almost all SQL servers. While the parser accepts any lettercase, we recommend use of keywords written in uppercase and identifiers in lowercase, for readability, as well as to prevent possible portability related issues. All SQL statements generated by the SQL Parser will use keywords in uppercase and identifiers written as found in the input. Read the [i]Identifiers[/i] section for other rules applied to identifiers, though. [*]Syntax Diagrams and Tables used in this document adhere the following conventions: [code]CONVENTION USED FOR ---------------- ---------------------------------------- UPPERCASE SQL keywords. lowercase User supplied elements such as SQL identifiers or constants. <label> Name for a block of syntax. This convention is used to group portions of lengthy blocks of syntax that can be used in more than one place. | (vertical bar) Separating optional syntax items within brackets or braces Only one of the specified items can be choosen. [ ] (brackets) Optional syntax items (brackets aren't part of the input). { } (braces) Required syntax items (braces aren't part of the input). [,...] The preceding item can be repeated n number of times (separated by commas). [ ...] The preceding item can be repeated n number of times (separated by blanks).[/code] [*]SQL statements must be terminated with a semicolon (;). Note the semicolon is required, even if only one statement is specified or for the last one. [*]SQL statements can be splitted into several lines. [*]Several forms of comments are allowed (described below).[/list] [/list] [list][*][size=14][b]Indentifiers[/b][/size] Table, index and column names are user supplied identifiers. To minimize portability related issues, all user supplied identifiers are subject to the following rules: [list][*][b]Backticked (quoted) identifiers:[/b] Some SQL servers allow to use non-ASCII characters, or even Reserved Keywords, when identifiers are backticked (MySQL) or double quoted (other SQL servers). However, even if backticked, a valid identifier for MySQL can be considered illegal on other SQL servers. Therefore, backticks are ignored and the rest of the rules enforced to minimize portability related issues. [*][b]Reserved Keywords:[/b] Can't be used. To minimize portability related issues identifiers are checked against a huge list of reserved keywords extracted from the following sources: * [url=http://dev.mysql.com/doc/mysql/en/reserved-words.html]MySQL Reserved Keywords[/url]. * [url=http://www.postgresql.org/docs/8.0/static/sql-keywords-appendix.html]PostgreSQL and Standard SQL 9x Reserved Keywords[/url]. * [url=http://msdn.microsoft.com/library/en-us/tsqlref/ts_ra-rz_9oj7.asp]Microsoft SQL Server Reserved Keywords[/url]. [*][b]Length:[/b] Up to 30 characters. This limit has been found from the minimum length allowed on selected SQL servers: * [url=http://msdn.microsoft.com/library/en-us/acdata/ac_8_con_03_6e9e.asp]128 characters in Microsoft SQL Server[/url]. * [url=http://dev.mysql.com/doc/mysql/en/legal-names.html]64 characters in MySQL[/url]. * [url=http://www.postgresql.org/docs/7.3/interactive/sql-syntax.html]63 characters in PostgreSQL 7.3 (based on NAMEDATALEN)[/url]. * [url=http://www.postgresql.org/docs/7.2/interactive/sql-syntax.html]31 characters in PostgreSQL 7.2 (based on NAMEDATALEN)[/url]. [*][b]Valid Characters:[/b] First character must be a letter (a-z or A-Z) in any lettercase or an underscore (_), from the second character on, also numbers (0-9) can be used.[/list] Examples: [code]forum_id -- Valid identifier! `default` -- Invalid, it's a Reserver Keyword! default_id -- Valid identifier! default-id -- Invalid, the hyphen (-) is NOT a valid character! _default -- Valid identifier! 1st_flag -- Invalid, starts with a number! first_flag -- Valid identifier! this_is_a_very_very_long_identifier -- Invalid, 35 characters in length![/code] [/list] [list][*][size=14][b]Constants[/b][/size] [list][*][b]String Constants:[/b] [list][*]Standard SQL string constants are arbitrary sequences of characters delimited by single quotes. ie. 'This is a standard SQL string constant' [*]Double quotes are used in SQL to quote identifiers, except MySQL, which uses backticks for this purpose. MySQL (therefore this SQL parser too) also accepts double quotes to delimit string constants. ie. "This is NOT standard, but still considered a string constant by MySQL, and so it is here" [*]Quotes used as string delimiters may be escaped by themselves or by backslashes. ie. 'Here''s an example' 'Here\'s another example' [*]Character set specifiers and collations are not supported.[/list] [*][b]Numeric Constants:[/b] Numeric constants include Intergers and Floating-Point Numbers. Numeric constants may or may not be enclosed in quotation marks. However, the SQL parser will remove the quotes when possible to prevent the SQL server from performing redundant and unnecessary type conversions. It is not always possible for the parser to know if a numeric constant should be un-quoted (for instance, when setting a default value in an ALTER statement), therefore it is recommended to not quote numbers. [list][*]Integer constants are represented by a sequence of numbers (0-9), optionally preceded by a hyphen (-) to indicate a negative value. Integers are accepted in the following format: [code][+-]digits[/code] Examples: [code]123 0 -123[/code] [*][url=http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html]Floating-Point[/url] numbers are inexact, variable precision numeric types that are represented using scientific notation, accepted in the following format: [code][+-]digits[[.decimals][e[+-]exponent]][/code] Examples: [code]123 123.45 -123.45 123.45e+10 123.45e10 123.45e-10 123e10[/code] [/list] [*][b]Boolean Constants:[/b] [list][*]Boolean values can be specified as 1 (true), 0 (false), TRUE or FALSE (in any lettercase).[/list] [*][b]NULL Constants:[/b] [list][*]The NULL value means "no data". It can be written in any lettercase.[/list] [*][b]Hexadecimal Constants:[/b] [list][*]Not supported, yet.[/list] [*][b]Binary Constants:[/b] [list][*]Not supported, yet.[/list] [/list] * [size=9]References about Constants: [url=http://dev.mysql.com/doc/mysql/en/literals.html]MySQL[/url], [url=http://www.postgresql.org/docs/8.0/interactive/sql-syntax.html#SQL-SYNTAX-CONSTANTS]PostgreSQL[/url], [url=http://msdn.microsoft.com/library/en-us/tsqlref/ts_ca-co_1n1v.asp]Microsoft SQL Server[/url].[/size] [/list] [list][*][size=14][b]Comments[/b][/size] Simple SQL comments and C-style comments are allowed. Comments are removed from the input before parsing the SQL statements. Note comment markers (described below) inside of string constants should be (in fact, are) considered part of the constant. [list][*][b]Simple SQL comments:[/b] Simple SQL comments are introduced by two consecutive hyphens (--) or by a hash character (#). All input from (and including) any of these comment markers until the end of the line is ignored. The hash (#), when found on the first character of a line, is used by the MOD Template to delimit MOD Actions (note hashes preceded only by whitespaces may still be considered MOD action delimiters). However, you can still use the hash in the middle of a line or at end of a SQL statement to add comments. Examples: [code]ALTER TABLE phpbb_users ADD user_flag1 SMALLINT; # This is a SQL comment. ALTER TABLE phpbb_users ADD user_flag2 SMALLINT; -- This is a SQL comment. # # This is NOT a SQL comment! # Note it will mark the end of the SQL action in the MOD Template![/code] [*][b]C-style comments:[/b] C-style comments start with /* and end with */ and may affect multiple lines. Example: [code]/* This is a multi line comment */ ALTER TABLE phpbb_users ADD user_flag1 SMALLINT;[/code] [/list][/list] [list][*][size=14][b]Data Types[/b][/size] [list][*]The following data types are supported: [code]DATA TYPE DESCRIPTION ---------------- ------------------------------ BOOL See BOOLEAN BOOLEAN Logical boolean (true/false) TINYINT[(D)] Very small integer SMALLINT[(D)] Small integer MEDIUMINT[(D)] Medium-size integer INT[(D)] See INTEGER INTEGER[(D)] Normal-size integer BIGINT[(D)] Large integer FLOAT[(L[,D])] Single precision floating-point number REAL[(L[,D])] See FLOAT DOUBLE[(L[,D])] See DOUBLE PRECISION DOUBLE PRECISION[(L[,D])] Double precision floating-point number DEC[(L[,D])] See DECIMAL DECIMAL[(L[,D])] Exact fixed-point number FIXED[(L[,D])] See DECIMAL NUMERIC[(L[,D])] See DECIMAL CHAR[(S)] Fixed-size character string VARCHAR[(S)] Variable-size character string BINARY[(S)] Fixed-size string of binary data VARBINARY[(S)] Variable-size string of binary data TINYTEXT Unlimited-size character string TEXT Unlimited-size character string MEDIUMTEXT Unlimited-size character string LONGTEXT Unlimited-size character string TINYBLOB Binary large Object BLOB Binary large Object MEDIUMBLOB Binary large Object LONGBLOB Binary large Object[/code] [i](D)[/i] is an optional argument used to specify display width for integer data types. [i](S)[/i] is an optional argument used to specify field size, in chars or bytes depending on the data type. [i]L[/i] in [i](L[,D])[/i] is the total number of digits (including decimals). [i]D[/i] in [i](L[,D])[/i] is the total number of digits after the decimal point. Note [i](L[,D])[/i] May also be specified for floating-point data types. However, it is not recommended since the meaning of these arguments may vary between SQL servers. [/list] [list][*]The following tables detail assumed storage sizes used for integer types: The column "DW" means "Display Width", which is the maximum recommended value to use as the [i](D)[/i] optional argument for integer types. This value is used by the parser to decide if an unsigned integer should be promoted to a higher size type when converting SQL statements for SQL servers that have no support for the unsigned attribute, such as PostgreSQL, MSSQL, etc.[/list] [code]TYPE BYTES MINIMUM UNSIGNED DW MAXIMUM UNSIGNED DW --------- ----- --------------------- -- --------------------- -- TINYINT 1 -128 4 +127 4 SMALLINT 2 -32768 6 +32767 6 MEDIUMINT 3 -8388608 8 +8388607 8 INTEGER 4 -2147483648 11 +2147483647 11 BIGINT 8 -9223372036854775808 20 +9223372036854775807 20[/code] [code]TYPE BYTES MAXIMUM SIGNED DW --------- ----- --------------------- -- TINYINT 1 +255 4 SMALLINT 2 +65535 6 MEDIUMINT 3 +16777215 9 INTEGER 4 +4294967295 11 BIGINT 8 +18446744073709551615 21[/code] * [size=9]Data Type References: [url=http://dev.mysql.com/doc/mysql/en/column-types.html]MySQL[/url], [url=http://www.postgresql.org/docs/8.0/interactive/datatype.html]PostgreSQL[/url], [url=http://msdn.microsoft.com/library/en-us/tsqlref/ts_da-db_7msw.asp]Microsoft SQL Server[/url].[/size] [/list] [list][*][size=14][b]SQL Reference[/b][/size] [list][*][size=12][b]CREATE TABLE[/b][/size] [list][*]Syntax: [code]CREATE TABLE table_name ({<column_definition>|<index_definition>}[,...]);[/code] [*]There must be, at least, one table definition element enclosed between parentheses. If more than one element is specified, they must be separated with commas. [*]Table attributes outside the parentheses are SQL server dependent, therefore are NOT accepted here. [*][i]<column_definition>[/i] and [i]<index_definition>[/i] are described below. [*]For the [i]table_name[/i] syntax, please refer to the [b]Identifiers[/b] chapter.[/list] * [size=9]CREATE TABLE References: [url=http://dev.mysql.com/doc/mysql/en/create-table.html]MySQL[/url], [url=http://www.postgresql.org/docs/8.0/interactive/sql-createtable.html]PostgreSQL[/url], [url=http://msdn.microsoft.com/library/en-us/tsqlref/ts_create2_8g9x.asp]Microsoft SQL Server[/url].[/size] [/list] [list][*][size=12][b]ALTER TABLE[/b][/size] [list][*]Syntax: [code]ALTER TABLE table_name ADD PRIMARY KEY (<index_key_definition>[,...]); ALTER TABLE table_name ADD {INDEX|UNIQUE} [index_name] (<index_key_definition>[,...]); ALTER TABLE table_name ADD [COLUMN] <column_definition>; ALTER TABLE table_name ALTER [COLUMN] column_name {SET DEFAULT constant|DROP DEFAULT}; ALTER TABLE table_name CHANGE [COLUMN] old_col_name <column_definition>; ALTER TABLE table_name MODIFY [COLUMN] <column_definition>; ALTER TABLE table_name DROP [COLUMN] column_name; ALTER TABLE table_name DROP PRIMARY KEY; ALTER TABLE table_name DROP INDEX index_name;[/code] [*]For the [i]table_name[/i], [i]index_name[/i] or [i]column_name[/i] syntax, please refer to the [b]Identifiers[/b] chapter.[/list] * [size=9]ALTER TABLE References: [url=http://dev.mysql.com/doc/mysql/en/alter-table.html]MySQL[/url], [url=http://www.postgresql.org/docs/8.0/interactive/sql-altertable.html]PostgreSQL[/url], [url=http://msdn.microsoft.com/library/en-us/tsqlref/ts_aa-az_3ied.asp]Microsoft SQL Server[/url].[/size] [/list] [list][*][size=12][b]DROP TABLE[/b][/size] [list][*]Syntax: [code]DROP TABLE table_name;[/code] [*]For the [i]table_name[/i] syntax, please refer to the [b]Identifiers[/b] chapter.[/list] * [size=9]DROP TABLE References: [url=http://dev.mysql.com/doc/mysql/en/drop-table.html]MySQL[/url], [url=http://www.postgresql.org/docs/8.0/interactive/sql-droptable.html]PostgreSQL[/url], [url=http://msdn.microsoft.com/library/en-us/tsqlref/ts_de-dz_7uud.asp]Microsoft SQL Server[/url].[/size] [/list] [list][*][size=12][b]Syntax Elements[/b][/size] [list][*][b]<column_definition>[/b] [list][*]Syntax: [code]column_name data_type [UNSIGNED] [ZEROFILL] [BINARY] [NULL|NOT NULL] [DEFAULT constant|NULL] [AUTO_INCREMENT][/code] [*]The following column attributes are accepted in any order: [list][*][b]UNSIGNED[/b]: Optional. For numeric types only. [*][b]ZEROFILL[/b]: Optional. For numeric types only. Ignored on non-MySQL servers. [*][b]BINARY[/b]: Optional. For CHAR or VARCHAR data types only. [*][b]NULL or NOT NULL[/b]: Optional. NOT NULL is required for primary keys. [*][b]DEFAULT[/b]: Optional. [*][b]AUTO_INCREMENT[/b]: Optional, If used, column must be indexed.[/list] [*]For the [i]column_name[/i] syntax, please refer to the [b]Identifiers[/b] chapter.[/list][/list] [list][*][b]<index_definition>[/b] [list][*]Syntax: [code]PRIMARY KEY (<index_key_definition>[,...]) {KEY|INDEX} [index_name] (<index_key_definition>[,...]) UNIQUE [INDEX] [index_name] (<index_key_definition>[,...])[/code] [*]For the [i]index_name[/i] syntax, please refer to the [b]Identifiers[/b] chapter.[/list][/list] [list][*][b]<index_key_definition>[/b] [list][*]Syntax: [code]{column_name[(length)] [ASC|DESC]}[,...][/code] [*]The [i]length[/i] attribute (next to the column name and enclosed between parentheses) is optional for CHAR, VARCHAR, BINARY and VARBINARY data types and required for TINYTEXT, TEXT, MEDIUMTEXT and LONGTEXT data types. [*]The [i]order[/i] attribute is optional and defaults to ASC. [*]For the [i]column_name[/i] syntax, please refer to the [b]Identifiers[/b] chapter.[/list] [/list] [/list] [/list] |
From: Markus P. <mar...@us...> - 2005-09-27 19:13:31
|
Update of /cvsroot/easymod/sql_parser/root/language/lang_english In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25873/root/language/lang_english Modified Files: lang_sql_parser.php Log Message: Added Syntax Reference in BBCode format (new docs directory). Also fixed a typo in the language file. Index: lang_sql_parser.php =================================================================== RCS file: /cvsroot/easymod/sql_parser/root/language/lang_english/lang_sql_parser.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** lang_sql_parser.php 26 Sep 2005 09:56:04 -0000 1.3 --- lang_sql_parser.php 27 Sep 2005 19:13:23 -0000 1.4 *************** *** 16,59 **** */ $lang += array( ! 'SQL_error_open_file' = 'Failed opening file "%s"', ! 'SQL_unknown_dbms' = 'Unknown or unsupported DBMS "%s"', ! 'SQL_nonclosed_string' = 'A non-closed string constant has been found: %s', ! 'SQL_missing_semicolon' = 'Missing semicolon, it might be an indication of further syntax errors', ! 'SQL_in_statement' = ', statement: %d', ! 'SQL_in_table_name' = ', table: "%s"', ! 'SQL_unknown_command' = 'Unknown SQL command "%s"', ! 'SQL_unexpected_syntax' = 'Unexpected syntax in "%s"', ! 'SQL_nonportable_option' = 'Non-portable syntax option(s) "%1$s", ignored', ! 'SQL_invalid_table_name' = 'Invalid table name "%s"', ! 'SQL_invalid_index_name' = 'Invalid index name "%s"', ! 'SQL_invalid_column_name' = 'Invalid column name "%s"', ! 'SQL_reserved_keyword' = 'Identifier "%1$s" is a reserved keyword (reference: %2$s)', ! 'SQL_invalid_index_name' = 'Invalid index name "%s"', ! 'SQL_invalid_index' = 'Invalid index "%s"', ! 'SQL_missing_keys' = 'Missing keys in "%s"', ! 'SQL_invalid_key_length' = 'Invalid key length "%s"', ! 'SQL_missing_key_length' = 'Missing key length "%1$s", mandatory for "%2$s" columns', ! 'SQL_invalid_column' = 'Invalid column definition "%s"', ! 'SQL_already_column' = 'Column "%s" already defined', ! 'SQL_invalid_primary' = 'Invalid primary key "%s"', ! 'SQL_already_primary' = 'Primary key "%s" already defined', ! 'SQL_unknown_primary' = 'Unknown column name "%s" in primary key', ! 'SQL_notnull_primary' = 'Inconsistent primary key "%s", should be defined as not null', ! 'SQL_autoinc_noindex' = 'Inconsistent usage of AUTO_INCREMENT in column "%s", it must be indexed', ! 'SQL_unknown_key' = 'Unknown column name for key "%s"', ! 'SQL_missing_default' = 'Missing default value "%s"', ! 'SQL_unknown_attribute' = 'Unexpected or unknown attribute "%1$s", in "%2$s"', ! 'SQL_nosupport_datatype' = 'Unsupported data type "%s"', ! 'SQL_invalid_datatype' = 'Invalid or unknown data type "%1$s", code: %2$d', ! 'SQL_unknown_datatype' = 'Unknown data type "%s"', ! 'SQL_illegal_null' = 'Illegal use of NULL for a NOT NULL column "%s"', ! 'SQL_illegal_attribute' = 'Illegal use of "%s" attribute', ! 'SQL_illegal_attriblen' = 'Illegal attribute length "%s"', ! 'SQL_warn_empty_number' = 'An empty string constant for a numeric data type has been converted to 0 "%s"', ! 'SQL_warn_bad_constant' = 'Possible inconsistencies detected, constant converted to (%1$s) in "%2$s"', ! 'SQL_warn_display_width' = 'Inconsistent display width specified "%1$s" in column "%2$s"', ! 'SQL_warn_mysql_ext' = 'MySQL extension "%1$s" used for column "%2$s"', ! 'SQL_warn_column_type' = 'Column "%1$s" has been found using %2$d different data types in %3$d tables: %4$s', ! 'SQL_warn_column_type_tb' = '%1$s in %2$s', ); --- 16,59 ---- */ $lang += array( ! 'SQL_error_open_file' => 'Failed opening file "%s"', ! 'SQL_unknown_dbms' => 'Unknown or unsupported DBMS "%s"', ! 'SQL_nonclosed_string' => 'A non-closed string constant has been found: %s', ! 'SQL_missing_semicolon' => 'Missing semicolon, it might be an indication of further syntax errors', ! 'SQL_in_statement' => ', statement: %d', ! 'SQL_in_table_name' => ', table: "%s"', ! 'SQL_unknown_command' => 'Unknown SQL command "%s"', ! 'SQL_unexpected_syntax' => 'Unexpected syntax in "%s"', ! 'SQL_nonportable_option' => 'Non-portable syntax option(s) "%1$s", ignored', ! 'SQL_invalid_table_name' => 'Invalid table name "%s"', ! 'SQL_invalid_index_name' => 'Invalid index name "%s"', ! 'SQL_invalid_column_name' => 'Invalid column name "%s"', ! 'SQL_reserved_keyword' => 'Identifier "%1$s" is a reserved keyword (reference: %2$s)', ! 'SQL_invalid_index_name' => 'Invalid index name "%s"', ! 'SQL_invalid_index' => 'Invalid index "%s"', ! 'SQL_missing_keys' => 'Missing keys in "%s"', ! 'SQL_invalid_key_length' => 'Invalid key length "%s"', ! 'SQL_missing_key_length' => 'Missing key length "%1$s", mandatory for "%2$s" columns', ! 'SQL_invalid_column' => 'Invalid column definition "%s"', ! 'SQL_already_column' => 'Column "%s" already defined', ! 'SQL_invalid_primary' => 'Invalid primary key "%s"', ! 'SQL_already_primary' => 'Primary key "%s" already defined', ! 'SQL_unknown_primary' => 'Unknown column name "%s" in primary key', ! 'SQL_notnull_primary' => 'Inconsistent primary key "%s", should be defined as not null', ! 'SQL_autoinc_noindex' => 'Inconsistent usage of AUTO_INCREMENT in column "%s", it must be indexed', ! 'SQL_unknown_key' => 'Unknown column name for key "%s"', ! 'SQL_missing_default' => 'Missing default value "%s"', ! 'SQL_unknown_attribute' => 'Unexpected or unknown attribute "%1$s", in "%2$s"', ! 'SQL_nosupport_datatype' => 'Unsupported data type "%s"', ! 'SQL_invalid_datatype' => 'Invalid or unknown data type "%1$s", code: %2$d', ! 'SQL_unknown_datatype' => 'Unknown data type "%s"', ! 'SQL_illegal_null' => 'Illegal use of NULL for a NOT NULL column "%s"', ! 'SQL_illegal_attribute' => 'Illegal use of "%s" attribute', ! 'SQL_illegal_attriblen' => 'Illegal attribute length "%s"', ! 'SQL_warn_empty_number' => 'An empty string constant for a numeric data type has been converted to 0 "%s"', ! 'SQL_warn_bad_constant' => 'Possible inconsistencies detected, constant converted to (%1$s) in "%2$s"', ! 'SQL_warn_display_width' => 'Inconsistent display width specified "%1$s" in column "%2$s"', ! 'SQL_warn_mysql_ext' => 'MySQL extension "%1$s" used for column "%2$s"', ! 'SQL_warn_column_type' => 'Column "%1$s" has been found using %2$d different data types in %3$d tables: %4$s', ! 'SQL_warn_column_type_tb' => '%1$s in %2$s', ); |
From: Markus P. <mar...@us...> - 2005-09-27 19:11:52
|
Update of /cvsroot/easymod/sql_parser/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25459/docs Log Message: Directory /cvsroot/easymod/sql_parser/docs added to the repository |
From: Markus P. <mar...@us...> - 2005-09-26 09:59:28
|
Update of /cvsroot/easymod/sql_parser/root/includes/sql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11076 Added Files: sql_builder.php sql_builder_msaccess.php sql_builder_mssql.php sql_builder_mysql.php sql_builder_postgresql.php sql_parser.php sql_reserved_keywords.php Log Message: Trying to cleanup stuff caused by wrong import. --- NEW FILE: sql_builder.php --- <?php /** * * @package SQL Parser * @version $Id: sql_builder.php,v 1.3 2005/09/26 09:59:13 markus_petrux Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * */ /** * SQL Builder Class * * This class is aimed to provide common services to all builder classes. */ class sql_builder { /** * A pointer to the main parser object. * * @access public */ var $parser; /** * Common indentation string for some kind of generated statements. * * @access public */ var $indent = ' '; /** * Constructor */ function sql_builder(&$parser) { $this->parser = &$parser; } /** * Generate a safe SQL identifier. * * @see class sql_parser * * @access public */ function get_identifier($identifier, $suffix = '') { return $this->parser->get_identifier($identifier, $suffix); } } ?> --- NEW FILE: sql_builder_msaccess.php --- <?php /** * * @package SQL Parser * @version $Id: sql_builder_msaccess.php,v 1.3 2005/09/26 09:59:13 markus_petrux Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * */ /** * SQL Builder Class for Microsoft Access * * Fundamental Microsoft Jet SQL for Access 2000: * http://msdn.microsoft.com/library/en-us/dnacc2k/html/acfundsql.asp * Intermediate Microsoft Jet SQL for Access 2000: * http://msdn.microsoft.com/library/en-us/dnacc2k/html/acintsql.asp * Advanced Microsoft Jet SQL for Access 2000: * http://msdn.microsoft.com/library/en-us/dnacc2k/html/acadvsql.asp * * SQL Reference for MS-Access 97: * http://msdn.microsoft.com/archive/en-us/office97/html/output/F1/D2/S5A318.asp * * Microsoft Jet SQL Reference: * http://www.devguru.com/Technologies/jetsql/quickref/statements.html */ class sql_builder_msaccess extends sql_builder { /** * Build a Column Definition. * @TODO: Column Definition for MSACCESS */ function build_column_definition($column_data) { $column_definition = $column_data['name'] . ' ' . $column_data['datatype']; return $column_definition; } /** * Build a CREATE TABLE statement. * @TODO: CREATE TABLE for MSACCESS * * Reference: * http://www.devguru.com/Technologies/jetsql/quickref/create_table.html * http://msdn.microsoft.com/archive/en-us/office97/html/output/F1/D2/S5A320.asp * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function create_table(&$sql_data, &$sql_output) { $sql_output[] = 'CREATE TABLE ' . $sql_data['table_name']; } /** * Build an ALTER TABLE statement. * @TODO: ALTER TABLE for MSACCESS * * Reference: * http://www.devguru.com/Technologies/jetsql/quickref/alter_table.html * http://msdn.microsoft.com/archive/en-us/office97/html/output/F1/D2/S5A31A.asp * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function alter_table(&$sql_data, &$sql_output) { $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name']; } /** * Build a DROP TABLE statement. * * Reference: * http://www.devguru.com/Technologies/jetsql/quickref/drop.html * http://msdn.microsoft.com/archive/en-us/office97/html/output/F1/D2/S5A323.asp * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function drop_table(&$sql_data, &$sql_output) { $sql_output[] = 'DROP TABLE ' . $sql_data['table_name']; } } ?> --- NEW FILE: sql_builder_mysql.php --- <?php /** * * @package SQL Parser * @version $Id: sql_builder_mysql.php,v 1.3 2005/09/26 09:59:13 markus_petrux Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * */ /** * SQL Builder Class for MySQL * * References: * http://dev.mysql.com/doc/mysql/en/data-definition.html */ class sql_builder_mysql extends sql_builder { /** * Translate the data type */ function translate_datatype($column_data) { $datatype = $column_data['datatype_name']; // BOOLEANs were added in MySQL 4.1.0 // http://dev.mysql.com/doc/mysql/en/numeric-type-overview.html // We'll use the synonym here for compatibility with older versions. if( $datatype == 'BOOLEAN' ) { $datatype = 'TINYINT(1)'; $column_data['unsigned'] = true; } return $datatype; } /** * Build a Column Definition. */ function build_column_definition($column_data) { $column_definition = $column_data['name'] . ' ' . $this->translate_datatype($column_data); if( isset($column_data['unsigned']) ) { $column_definition .= ' UNSIGNED'; } if( isset($column_data['binary']) ) { $column_definition .= ' BINARY'; } if( isset($column_data['zerofill']) ) { $column_definition .= ' ZEROFILL'; } if( !empty($column_data['null']) ) { $column_definition .= ' ' . $column_data['null']; } if( isset($column_data['default']) ) { $column_definition .= ' DEFAULT ' . $column_data['default']; } if( isset($column_data['auto_increment']) ) { $column_definition .= ' AUTO_INCREMENT'; } return $column_definition; } /** * Build a Primary Key Definition. */ function build_primary_key(&$sql_data) { $keys = array(); for( $i = 0; $i < count($sql_data['primary_keys']); $i++ ) { $key_data = &$sql_data['primary_keys'][$i]; $key_order = ( $key_data['order'] != 'ASC' ? ' DESC' : '' ); $keys[] = $key_data['name'] . $key_order; } return 'PRIMARY KEY (' . implode(', ', $keys) . ')'; } /** * Build an Index Definition. */ function build_index(&$sql_data, $index_data) { $keys = array(); for( $i = 0; $i < count($index_data['keys']); $i++ ) { $key_data = &$index_data['keys'][$i]; $key_length = ( $key_data['length'] > 0 ? ('('.$key_data['length'].')') : '' ); $key_order = ( $key_data['order'] != 'ASC' ? ' DESC' : '' ); $keys[] = $key_data['name'] . $key_length . $key_order; } return ( $index_data['unique'] ? 'UNIQUE' : 'INDEX' ) . ' ' . $index_data['name'] . ' (' . implode(', ', $keys) . ')'; } /** * Build a CREATE TABLE statement. * * References: * http://dev.mysql.com/doc/mysql/en/create-table.html * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function create_table(&$sql_data, &$sql_output) { $lines = array(); foreach( $sql_data['columns'] as $column_data ) { $lines[] = $this->indent . $this->build_column_definition($column_data); } if( count($sql_data['primary_keys']) > 0 ) { $lines[] = $this->indent . $this->build_primary_key($sql_data); } foreach( $sql_data['indexes'] as $index_data ) { $lines[] = $this->indent . $this->build_index($sql_data, $index_data); } $sql_output[] = 'CREATE TABLE ' . $sql_data['table_name'] . " (\n" . implode(",\n", $lines) . "\n)"; } /** * Build an ALTER TABLE statement. * * References: * http://dev.mysql.com/doc/mysql/en/alter-table.html * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function alter_table(&$sql_data, &$sql_output) { $line = 'ALTER TABLE ' . $sql_data['table_name'] . ' ' . $sql_data['action']; switch( $sql_data['action'] ) { case 'ADD': if( count($sql_data['primary_keys']) > 0 ) { $line .= ' ' . $this->build_primary_key($sql_data); } elseif( count($sql_data['indexes']) > 0 ) { $line .= ' ' . $this->build_index($sql_data, array_shift($sql_data['indexes'])); } elseif( count($sql_data['columns']) > 0 ) { $line .= ' ' . $this->build_column_definition(array_shift($sql_data['columns'])); } break; case 'ALTER': $line .= ' COLUMN ' . $sql_data['column']; if( $sql_data['subaction'] == 'set_default' ) { $line .= ' SET DEFAULT ' . $sql_data['default']; } else { $line .= ' DROP DEFAULT'; } break; case 'CHANGE': $line .= ' COLUMN ' . $sql_data['old_column'] . ' ' .$this->build_column_definition(array_shift($sql_data['columns'])); break; case 'MODIFY': $line .= ' COLUMN ' . $this->build_column_definition(array_shift($sql_data['columns'])); break; case 'DROP': if( isset($sql_data['primary_key']) ) { $line .= ' PRIMARY KEY'; } elseif( isset($sql_data['index']) ) { $line .= ' INDEX ' . $sql_data['index']; } elseif( isset($sql_data['column']) ) { $line .= ' COLUMN ' . $sql_data['column']; } break; } $sql_output[] = $line; } /** * Build a DROP TABLE statement. * * References: * http://dev.mysql.com/doc/mysql/en/drop-table.html * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function drop_table(&$sql_data, &$sql_output) { $sql_output[] = 'DROP TABLE ' . $sql_data['table_name']; } } ?> --- NEW FILE: sql_reserved_keywords.php --- <?php /** * * @package SQL Parser * @version $Id: sql_reserved_keywords.php,v 1.3 2005/09/26 09:59:13 markus_petrux Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * */ /** * Reserved Keywords for SQL Parser * * - Reserved keyword lookups are made in the order of this table. * - There are many duplicates here, though, the loader takes care of them. */ $reserved_keywords = array( 'SQL_99' => array( [...1295 lines suppressed...] VARIABLES VARYING VIEW WARNINGS WEEK WHEN WHERE WHILE WITH WORK WRITE X509 XA XOR YEAR YEAR_MONTH ZEROFILL SQL_PARSER_END_OF_DATA; ?> --- NEW FILE: sql_parser.php --- <?php /** * * @package SQL Parser * @version $Id: sql_parser.php,v 1.3 2005/09/26 09:59:13 markus_petrux Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * */ /** * SQL References... * * MOD Template SQL Command Standard (by Nuttzy): * http://area51.phpbb.com/phpBB/viewtopic.php?f=25&t=15390 * * MySQL: * http://dev.mysql.com/doc/mysql/en/index.html [...1905 lines suppressed...] * * This method is just provided for convenience. Despite input is a filename * we still return an array, so the caller can do whatever... * * @access public * @param string File name, contents of one or more SQL statements. * @param string Table Prefix in the target DB (optional). * @return integer Return code (@see constants SQL_PARSER_*). */ function parse_file($filename, $table_prefix = false) { if( !($sql_stream = $this->read_file($filename)) ) { return SQL_PARSER_ERROR | (count($this->warnings) > 0 ? SQL_PARSER_WARNINGS : 0); } return $this->parse_stream($sql_stream, $table_prefix); } } ?> --- NEW FILE: sql_builder_postgresql.php --- <?php /** * * @package SQL Parser * @version $Id: sql_builder_postgresql.php,v 1.3 2005/09/26 09:59:13 markus_petrux Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * */ /** * SQL Builder Class for PostgreSQL * * References: * http://www.postgresql.org/docs/8.0/interactive/index.html * http://www.postgresql.org/docs/8.0/interactive/sql-commands.html */ class sql_builder_postgresql extends sql_builder { /** * Translate the data type */ function translate_datatype($column_data) { $datatype = $column_data['datatype_name']; $datatype_map = array( 'TINYINT' => 'SMALLINT', 'MEDIUMINT' => 'INTEGER', 'BINARY' => 'BYTEA', 'VARBINARY' => 'BYTEA', 'TINYBLOB' => 'BYTEA', 'BLOB' => 'BYTEA', 'MEDIUMBLOB' => 'BYTEA', 'LONGBLOB' => 'BYTEA' ); if( isset($datatype_map[$datatype]) ) { $datatype = $datatype_map[$datatype]; } if( isset($column_data['binary']) ) { $datatype = 'BYTEA'; } if( in_array($datatype, array('SMALLINT','INTEGER','BIGINT')) ) { // - PostgreSQL does not support the UNSIGNED attribute, therefore small // integers (we'll never promote integers to BIGINT, which is a really huge // data type) should promoted in some cases: // a) Of course, SMALLINT UNSIGNED was specified and // b) It hasn't been already promoted by datatype_map and // c) No display width was specified or it is greater than the type capability. if( $datatype == 'SMALLINT' && isset($column_data['unsigned']) && !isset($datatype_map[$column_data['datatype_name']]) ) { if( $column_data['datatype_argc'] == 0 || $column_data['datatype_argc'] > 6 ) { $datatype = 'INTEGER'; } } if( isset($column_data['auto_increment']) ) { // PostgreSQL (at least, since 7.2) creates the sequence automatically when using SERIAL // See chapter "Serial Types": // http://www.postgresql.org/docs/8.0/interactive/datatype.html // http://www.postgresql.org/docs/7.2/interactive/datatype.html $datatype = ( $datatype == 'BIGINT' ? 'BIGSERIAL' : 'SERIAL' ); } } else { if( $column_data['datatype_argc'] > 0 && in_array($datatype, array('DECIMAL','CHAR','VARCHAR')) ) { $datatype .= '(' . implode(', ', $column_data['datatype_argv']) . ')'; } } return $datatype; } /** * Build a Column Definition. * * References: * http://www.postgresql.org/docs/8.0/interactive/datatype.html */ function build_column_definition($column_data) { $column_definition = $column_data['name'] . ' ' . $this->translate_datatype($column_data); if( !isset($column_data['auto_increment']) ) { if( !empty($column_data['null']) ) { $column_definition .= ' ' . $column_data['null']; } if( isset($column_data['default']) ) { $column_definition .= ' DEFAULT ' . $column_data['default']; } } return $column_definition; } /** * Build a Primary Key Definition. */ function build_primary_key(&$sql_data) { $keys = array(); for( $i = 0; $i < count($sql_data['primary_keys']); $i++ ) { $key_data = &$sql_data['primary_keys'][$i]; $key_order = ( $key_data['order'] != 'ASC' ? ' DESC' : '' ); $keys[] = $key_data['name'] . $key_order; } $contraint_name = $this->get_identifier($sql_data['table_name'], '_pk'); return 'CONSTRAINT ' . $contraint_name . ' PRIMARY KEY (' . implode(', ', $keys) . ')'; } /** * Build an Index Definition. */ function build_index(&$sql_data, $index_data) { $table_name = $sql_data['table_name']; $index_name = $this->get_identifier($sql_data['table_name'] . '_' . $index_data['name']); $keys = array(); for( $i = 0; $i < count($index_data['keys']); $i++ ) { $key_data = &$index_data['keys'][$i]; $key_order = ( $key_data['order'] != 'ASC' ? ' DESC' : '' ); $keys[] = $key_data['name'] . $key_order; } return 'CREATE' . ( $index_data['unique'] ? ' UNIQUE' : '' ) . ' INDEX ' . $index_name . ' ON ' . $table_name . ' (' . implode(', ', $keys) . ')'; } /** * Build a CREATE TABLE statement. * * References: * http://www.postgresql.org/docs/8.0/interactive/sql-createtable.html * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function create_table(&$sql_data, &$sql_output) { $lines = array(); foreach( $sql_data['columns'] as $column_data ) { $lines[] = $this->indent . $this->build_column_definition($column_data); } if( count($sql_data['primary_keys']) > 0 ) { $lines[] = $this->indent . $this->build_primary_key($sql_data); } foreach( $sql_data['columns'] as $column_data ) { if( isset($column_data['unsigned']) ) { $lines[] = $this->indent . 'CHECK (' . $column_data['name'] . '>=0)'; } } $sql_output[] = 'CREATE TABLE ' . $sql_data['table_name'] . " (\n" . implode(",\n", $lines) . "\n)"; foreach( $sql_data['indexes'] as $index_data ) { $sql_output[] = $this->build_index($sql_data, $index_data); } } /** * Build an ALTER TABLE statement. * * References: * http://www.postgresql.org/docs/8.0/interactive/sql-altertable.html * http://www.postgresql.org/docs/7.4/interactive/sql-altertable.html * http://www.postgresql.org/docs/7.3/interactive/sql-altertable.html * http://www.postgresql.org/docs/7.2/interactive/sql-altertable.html * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function alter_table(&$sql_data, &$sql_output) { switch( $sql_data['action'] ) { case 'ADD': if( count($sql_data['primary_keys']) > 0 ) { $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ADD ' . $this->build_primary_key($sql_data); } elseif( count($sql_data['indexes']) > 0 ) { $sql_output[] = $this->build_index($sql_data, array_shift($sql_data['indexes'])); } elseif( count($sql_data['columns']) > 0 ) { // Note: DEFAULT and NOT NULL clausules in the same ALTER ADD COLUMN // statement were not supported until PostgreSQL 8.0 $column_data = array_shift($sql_data['columns']); $column_name = $column_data['name']; if( isset($column_data['default']) ) { $set_default = $column_data['default']; unset($column_data['default']); } if( isset($column_data['null']) ) { if( $column_data['null'] == 'NOT NULL' ) { $set_null = ' SET NOT NULL'; } unset($column_data['null']); } $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ADD COLUMN ' . $this->build_column_definition($column_data); if( isset($set_default) ) { $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $set_default; } if( isset($set_null) ) { if( !isset($set_default) ) { $set_default = ( strstr('BIFD', $column_data['constant_type']) ? 0 : "''" ); } $sql_output[] = 'UPDATE TABLE ' . $sql_data['table_name'] . " SET $column_name = $set_default WHERE $column_name IS NULL"; $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ALTER COLUMN ' . $column_name . $set_null; } if( isset($column_data['unsigned']) ) { $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ADD CHECK (' . $column_data['name'] . '>=0)'; } } break; case 'ALTER': $line = 'ALTER TABLE ' . $sql_data['table_name'] . ' ALTER COLUMN ' . $sql_data['column']; if( $sql_data['subaction'] == 'set_default' ) { $line .= ' SET DEFAULT ' . $sql_data['default']; } else { $line .= ' DROP DEFAULT'; } $sql_output[] = $line; break; case 'CHANGE': case 'MODIFY': $column_data = array_shift($sql_data['columns']); $column_name = $column_data['name']; $datatype = $this->translate_datatype($column_data); if( $sql_data['action'] == 'CHANGE' ) { $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' RENAME COLUMN ' . $sql_data['old_column'] . ' TO ' . $column_name; } $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ALTER COLUMN ' . $column_name . ' TYPE ' . $datatype; $line = 'ALTER TABLE ' . $sql_data['table_name'] . ' ALTER COLUMN ' . $column_name; if( isset($column_data['default']) ) { $line .= ' SET DEFAULT ' . $column_data['default']; } else { $line .= ' DROP DEFAULT'; } $sql_output[] = $line; $set_drop = ( empty($column_data['null']) || $column_data['null'] == 'NULL' ? 'DROP' : 'SET' ); if( $set_drop == 'SET' && isset($column_data['default']) ) { $sql_output[] = 'UPDATE TABLE ' . $sql_data['table_name'] . " SET $column_name = " . $column_data['default'] . " WHERE $column_name IS NULL"; } $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ALTER COLUMN ' . $column_name . ' ' . $set_drop . ' NOT NULL'; if( isset($column_data['unsigned']) ) { $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ADD CHECK (' . $column_data['name'] . '>=0)'; } break; case 'DROP': if( isset($sql_data['primary_key']) ) { $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' DROP CONSTRAINT ' . $sql_data['table_name'] . '_pkey'; } elseif( isset($sql_data['index']) ) { $sql_output[] = 'DROP INDEX ' . $sql_data['index']; } elseif( isset($sql_data['column']) ) { // Note: DROP COLUMN was added in 7.3, and I guess we can't easilly offer support for // previous (legacy :P ;) versions, where the way to deal with this kind of operations // would, more or less, look like this: // 1) CREATE TABLE temp AS SELECT * FROM target_table; // 2) DROP TABLE target_table; // 3) CREATE TABLE target_table (column_definition[,...]); // 4) INSERT INTO target_table SELECT * FROM temp; // 5) DROP TABLE temp; // The problem here is we don't have the required information to build 3rd step, and // the CREATE TABLE a LIKE b; statement was not implemented until version 7.4, so the // only possible automation here would be to read all table attributes from the server // and dynamically build the column definitions, which looks like a bit too heavy. $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' DROP COLUMN ' . $sql_data['column'] . ' CASCADE'; } break; } } /** * Build a DROP TABLE statement. * * References: * http://www.postgresql.org/docs/8.0/interactive/sql-droptable.html * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function drop_table(&$sql_data, &$sql_output) { $sql_output[] = 'DROP TABLE ' . $sql_data['table_name']; } } ?> --- NEW FILE: sql_builder_mssql.php --- <?php /** * * @package SQL Parser * @version $Id: sql_builder_mssql.php,v 1.3 2005/09/26 09:59:13 markus_petrux Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * */ /** * SQL Builder Class for Microsoft SQL Server * * References: * http://msdn.microsoft.com/library/en-us/dnanchor/html/sqlserver2000.asp * * Known things that may need revision by the end-user: * - The [PRIMARY] "filegroup" is specified for all ON and TEXTIMAGE_ON clausules generated. * The user might want to adapt this clause to its own particular needs (big database, etc). * More information on "filegroups" can be found here: * > Creating and Maintaining Databases -> Files and Filegroups: * http://msdn.microsoft.com/library/en-us/createdb/cm_8_des_02_6epf.asp * > SQL Server Arquitecture -> Physical Database Files and Filegroups: * http://msdn.microsoft.com/library/en-us/architec/8_ar_da2_9sab.asp * > Optimizing Database Performance -> Data Placement using Filegroups: * http://msdn.microsoft.com/library/en-us/optimsql/odp_tun_1_2upf.asp */ class sql_builder_mssql extends sql_builder { /** * Translate the data type */ function translate_datatype($column_data) { $datatype = $column_data['datatype_name']; $datatype_map = array( // http://msdn.microsoft.com/library/en-us/tsqlref/ts_fa-fz_6r3g.asp 'FLOAT' => 'REAL', 'DOUBLE PRECISION' => 'FLOAT', // http://msdn.microsoft.com/library/en-us/tsqlref/ts_ia-iz_3ss4.asp 'MEDIUMINT' => 'INTEGER', // http://msdn.microsoft.com/library/en-us/tsqlref/ts_ia-iz_9rfp.asp 'TINYBLOB' => 'IMAGE', 'BLOB' => 'IMAGE', 'MEDIUMBLOB' => 'IMAGE', 'LONGBLOB' => 'IMAGE' ); if( isset($datatype_map[$datatype]) ) { $datatype = $datatype_map[$datatype]; } if( isset($column_data['binary']) ) { $datatype = ( $datatype == 'CHAR' ? 'BINARY' : 'VARBINARY' ); } if( in_array($datatype, array('TINYINT','SMALLINT','INTEGER','BIGINT')) ) { // - MS-SQL Server does not support signed TINYINTs. // - MS-SQL Server does not support MEDIUMINTs. // - MS-SQL Server does not support the UNSIGNED attribute, therefore small // integers (we'll never promote integers to BIGINT, which is a really huge // data type) should be promoted in some cases: // a) Of course, SMALLINT UNSIGNED was specified and // b) No display width was specified or it is greater than the type capability. if( $datatype == 'TINYINT' && !isset($column_data['unsigned']) ) { $datatype = 'SMALLINT'; } elseif( $datatype == 'SMALLINT' && isset($column_data['unsigned']) && ( $column_data['datatype_argc'] == 0 || $column_data['datatype_argc'] > 6 ) ) { $datatype = 'INTEGER'; } } else { if( $column_data['datatype_argc'] > 0 && in_array($datatype, array('DECIMAL','CHAR','VARCHAR','BINARY','VARBINARY')) ) { $datatype .= '(' . implode(', ', $column_data['datatype_argv']) . ')'; } } return $datatype; } /** * Build a Column Definition. * * References: * http://msdn.microsoft.com/library/en-us/tsqlref/ts_da-db_7msw.asp */ function build_column_definition($column_data) { $column_definition = $column_data['name'] . ' ' . $this->translate_datatype($column_data); if( !empty($column_data['null']) ) { $column_definition .= ' ' . $column_data['null']; } if( isset($column_data['default']) ) { $column_definition .= ' DEFAULT (' . $column_data['default'] . ')'; } if( isset($column_data['auto_increment']) ) { $column_definition .= ' IDENTITY(1, 1)'; } return $column_definition; } /** * Build a Primary Key Definition. */ function build_primary_key(&$sql_data) { $keys = array(); for( $i = 0; $i < count($sql_data['primary_keys']); $i++ ) { $key_data = &$sql_data['primary_keys'][$i]; $key_order = ( $key_data['order'] != 'ASC' ? ' DESC' : '' ); $keys[] = $key_data['name'] . $key_order; } $contraint_name = $this->get_identifier($sql_data['table_name'], '_pk'); return 'CONSTRAINT ' . $contraint_name . ' PRIMARY KEY (' . implode(', ', $keys) . ') ON [PRIMARY]'; } /** * Build an Index Definition. */ function build_index(&$sql_data, $index_data) { $table_name = $sql_data['table_name']; $index_name = $this->get_identifier($sql_data['table_name'] . '_' . $index_data['name']); $keys = array(); for( $i = 0; $i < count($index_data['keys']); $i++ ) { $key_data = &$index_data['keys'][$i]; $key_order = ( $key_data['order'] != 'ASC' ? ' DESC' : '' ); $keys[] = $key_data['name'] . $key_order; } return 'CREATE' . ( $index_data['unique'] ? ' UNIQUE' : '' ) . ' INDEX ' . $index_name . ' ON ' . $table_name . ' (' . implode(', ', $keys) . ') ON [PRIMARY]'; } /** * Build a CREATE TABLE statement. * * References: * http://msdn.microsoft.com/library/en-us/tsqlref/ts_create2_8g9x.asp * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function create_table(&$sql_data, &$sql_output) { $on_textimage = false; $lines = array(); foreach( $sql_data['columns'] as $column_data ) { if( in_array($column_data['datatype_name'], array('TEXT')) ) { $on_textimage = true; } $lines[] = $this->indent . $this->build_column_definition($column_data); } if( count($sql_data['primary_keys']) > 0 ) { $lines[] = $this->indent . $this->build_primary_key($sql_data); } foreach( $sql_data['columns'] as $column_data ) { if( isset($column_data['unsigned']) ) { $lines[] = $this->indent . 'CHECK (' . $column_data['name'] . '>=0)'; } } $filegroups = ' ON [PRIMARY]' . ( $on_textimage ? ' TEXTIMAGE_ON [PRIMARY]' : '' ); $sql_output[] = 'CREATE TABLE ' . $sql_data['table_name'] . " (\n" . implode(",\n", $lines) . "\n) $filegroups"; foreach( $sql_data['indexes'] as $index_data ) { $sql_output[] = $this->build_index($sql_data, $index_data); } } /** * Build an ALTER TABLE statement. * * References: * http://msdn.microsoft.com/library/en-us/tsqlref/ts_aa-az_3ied.asp * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function alter_table(&$sql_data, &$sql_output) { // @TODO: ALTER TABLE for MSSQL // $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name']; } /** * Build a DROP TABLE statement. * * References: * http://msdn.microsoft.com/library/en-us/tsqlref/ts_de-dz_7uud.asp * * @access public * @param array Specifications to build the statement. * @param array One or more formatted SQL statements. */ function drop_table(&$sql_data, &$sql_output) { $sql_output[] = 'DROP TABLE ' . $sql_data['table_name']; } } ?> |