[Easymod-cvs] easymod/install em_install.php,NONE,1.1 index.htm,NONE,1.1
Status: Beta
Brought to you by:
wgeric
From: Eric F. <wg...@us...> - 2005-12-04 03:12:40
|
Update of /cvsroot/easymod/easymod/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29556/install Added Files: em_install.php index.htm Log Message: First commit to SourceForge. Enjoy! --- NEW FILE: em_install.php --- <?php /** * * @package EasyMOD * @version $Id: em_install.php,v 1.1 2005/12/04 03:12:30 wgeric Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * * @TODO Need to optimize a lot of the script * @TODO Function for checking temp write access * @TODO Work on the debug/error handler * @TODO Help for everything * */ define('EM_INSTALL_VERSION', '0.0.1'); define('IN_EM_INSTALL', true); define('IN_PHPBB', true); $phpbb_root_path = './../'; $em_dir = 'install/em_files/'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); include($phpbb_root_path . $em_dir . 'includes/em/em_common.'.$phpEx); $help = request_var('help', ''); if ( !empty($help) ) { ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang['ENCODING']; ?>"> <meta http-equiv="Content-Style-Type" content="text/css"> <title><?php echo $lang['EM_Help'];?></title> <link rel="stylesheet" href="../templates/subSilver/subSilver.css" type="text/css"> <style type="text/css"> <!-- th { background-image: url('../templates/subSilver/images/cellpic3.gif') } td.cat { background-image: url('../templates/subSilver/images/cellpic1.gif') } td.rowpic { background-image: url('../templates/subSilver/images/cellpic2.jpg'); background-repeat: repeat-y } td.catHead,td.catSides,td.catLeft,td.catRight,td.catBottom { background-image: url('../templates/subSilver/images/cellpic1.gif') } /* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */ @import url("../templates/subSilver/formIE.css"); //--> </style> </head> <body bgcolor="#E5E5E5" text="#000000" link="#006699" vlink="#5584AA"> <table width="100%" border="0" cellspacing="0" cellpadding="10" align="center"> <tr> <td class="bodyline" width="100%"> <table border="0" cellpadding="3" cellspacing="1" class="forumline" width="100%"> <tr> <th><?php echo $lang['EM_Help']; ?></th> </tr> <?php $i = 0; foreach($lang['EM_Help_topics'] as $name => $values) { $row_class = ( $i % 2 ) ? 'row1' : 'row2'; ?> <tr> <td class="cat"><span class="cattitle"><a name="<?php echo $name; ?>"></a><?php echo $values['title']; ?></span></td> </tr> <tr> <td class="<?php echo $row_class; ?>"><span class="gen"><?php echo nl2br($values['desc']); ?><br /><br /><a href="javascript:window.close();"><?php echo $lang['Close_window']; ?></a></span></td> </tr> <tr> <td class="spaceRow" height="1"><img src="<?php echo $phpbb_root_path; ?>templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td> </tr> <?php $i++; } ?> </table> </td> </tr> <tr> <td><p class="copyright" align="center"><a href="http://www.phpbb.com/" class="copyright">EasyMOD</a> © 2005 phpBB Group</p></td> </tr> </table> </body> </html> <?php exit; } $step = request_var('step', 1); if ( isset($board_config['em_version']) && $board_config['em_version'] == EM_INSTALL_VERSION ) { //message_die(GENERAL_MESSAGE, 'This version of EasyMOD is already installed'); } $error = false; $board_config['em_pass'] = $password = request_var('password', ''); $password_confirm = request_var('password_confirm', ''); $sel_method = request_var('method', ( !empty($board_config['em_method']) ) ? $board_config['em_method'] : ''); $board_config['em_tmp_path'] = $tmp_path = request_var('tmp_path', ''); $board_config['em_ftp_host'] = $ftp_host = request_var('ftp_host', ''); $board_config['em_ftp_port'] = $ftp_port = request_var('ftp_port', 21); $board_config['em_ftp_timeout'] = $ftp_timeout = request_var('ftp_timeout', 10); $board_config['em_ftp_username'] = $ftp_username = request_var('ftp_username', ''); $board_config['em_ftp_password'] = $ftp_password = request_var('ftp_password', ''); $board_config['em_ftp_root_path'] = $ftp_root_path = request_var('ftp_root_path', ''); if ( $step == 2 ) { $board_config['em_pass'] = $password = md5($password); $password_confirm = md5($password_confirm); $key = ''; for($i = 1, $total = strlen($password); $i < $total; $i = round(($i+1)*2)) { $key .= md5($password{$i}); } $board_config['em_ftp_password'] = $ftp_password = $crypt->encrypt($ftp_password, $key); } $hidden_fields = '<input type="hidden" name="password" value="' . $password . '" />'; if ( $step != 5 ) { $hidden_fields .= '<input type="hidden" name="method" value="' . $sel_method . '" />'; $hidden_fields .= '<input type="hidden" name="tmp_path" value="' . $tmp_path . '" />'; $hidden_fields .= '<input type="hidden" name="ftp_host" value="' . $ftp_host . '" />'; $hidden_fields .= '<input type="hidden" name="ftp_port" value="' . $ftp_port . '" />'; $hidden_fields .= '<input type="hidden" name="ftp_timeout" value="' . $ftp_timeout . '" />'; $hidden_fields .= '<input type="hidden" name="ftp_username" value="' . $ftp_username . '" />'; $hidden_fields .= '<input type="hidden" name="ftp_password" value="' . $ftp_password . '" />'; $hidden_fields .= '<input type="hidden" name="ftp_root_path" value="' . $ftp_root_path . '" />'; } if ( $step > 1 && (empty($sel_method) || !file_exists($phpbb_root_path . $em_dir . 'includes/em/em_methods_' . $sel_method . '.'.$phpEx)) ) { message_die(GENERAL_ERROR, 'No method selected'); } switch($step) { // test the settings case 2: // check to make sure passwords match if ( $password != $password_confirm ) { message_die(GENERAL_ERROR, 'Passwords don\'t match'); } include($phpbb_root_path . $em_dir . 'includes/em/em_methods_' . $sel_method . '.'.$phpEx); page_header(); ?> <table border="0" cellpadding="3" cellspacing="1" class="forumline" width="100%"> <tr> <th>Testing Connections</th> </tr> <tr> <td class="row1"><span class="gen"> <?php $error = $mod_io->test_connection(); ?> </span></td> </tr> <tr> <td class="row1"><span class="gen"> <?php if ( $error !== true ) { ?> <p style="color: red; font-weight: bold;">Error testing the connection. Please go back and change the connection settings</p> </td> </tr> <tr> <td class="cat"><input type="hidden" name="step" value="1" /><input type="submit" value="Back to step 1" name="submit" class="mainoption" /></td> </tr> <?php } else { ?> <p style="color: green; font-weight: bold;">Connection test was successful!</p> </td> </tr> <tr> <td class="cat"><input type="hidden" name="step" value="3" /><?php echo $hidden_fields; ?><input type="submit" value="Go to step 3" name="submit" class="mainoption" /></td> </tr> <?php } ?> </table> <?php break; // Make the edits to the files case 3: include($phpbb_root_path . $em_dir . 'includes/em/em_methods_' . $sel_method . '.'.$phpEx); $error = $mod_io->init(); page_header(); ?> <table border="0" cellpadding="3" cellspacing="1" class="forumline" width="100%"> <tr> <th>Edit files</th> </tr> <tr> <td class="row1"><span class="gen">No edits will be done at this time ;)</span></td> </tr> <tr> <td class="cat"><input type="hidden" name="step" value="4" /><?php echo $hidden_fields; ?><input type="submit" value="Go to step 4" name="submit" class="mainoption" /></td> </tr> </table> <?php break; // make backups, move files case 4: include($phpbb_root_path . $em_dir . 'includes/em/em_methods_' . $sel_method . '.'.$phpEx); $error = $mod_io->init(); page_header(); ?> <table border="0" cellpadding="3" cellspacing="1" class="forumline" width="100%"> <tr> <th class="thLeft">From</th> <th class="thTop">To</th> <th class="thRight">Status</th> </tr> <tr> <td class="cat" colspan="3"><span class="cattitle">Create Backups and Move the files</span></td> </tr> <?php // long list of files ... $file = array(); $files[] = array('to' => './../admin/em_manage.php', 'from' => './../install/em_files/admin/em_manage.php'); $files[] = array('to' => './../admin/em_logs.php', 'from' => './../install/em_files/admin/em_logs.php'); $files[] = array('to' => './../admin/em_history.php', 'from' => './../install/em_files/admin/em_history.php'); $files[] = array('to' => './../admin/admin_easymod.php', 'from' => './../install/em_files/admin/admin_easymod.php'); $files[] = array('to' => './../admin/em_general.php', 'from' => './../install/em_files/admin/em_general.php'); $files[] = array('to' => './../includes/em/em_functions.php', 'from' => './../install/em_files/includes/em/em_functions.php'); $files[] = array('to' => './../includes/em/em_processing.php', 'from' => './../install/em_files/includes/em/em_processing.php'); $files[] = array('to' => './../includes/em/em_acp_menu.php', 'from' => './../install/em_files/includes/em/em_acp_menu.php'); $files[] = array('to' => './../includes/em/em_functions_20x.php', 'from' => './../install/em_files/includes/em/em_functions_20x.php'); $files[] = array('to' => './../includes/em/em_mcrypt.php', 'from' => './../install/em_files/includes/em/em_mcrypt.php'); $files[] = array('to' => './../includes/em/em_parser_text.php', 'from' => './../install/em_files/includes/em/em_parser_text.php'); //$files[] = array('to' => './../includes/em/em_functions_30x.php', 'from' => './../install/em_files/includes/em/em_functions_30x.php'); $files[] = array('to' => './../includes/em/em_crypt.php', 'from' => './../install/em_files/includes/em/em_crypt.php'); $files[] = array('to' => './../includes/em/index.htm', 'from' => './../install/em_files/includes/em/index.htm'); $files[] = array('to' => './../includes/em/em_methods_server.php', 'from' => './../install/em_files/includes/em/em_methods_server.php'); $files[] = array('to' => './../includes/em/em_methods_ftp.php', 'from' => './../install/em_files/includes/em/em_methods_ftp.php'); $files[] = array('to' => './../includes/em/em_actions.php', 'from' => './../install/em_files/includes/em/em_actions.php'); $files[] = array('to' => './../includes/em/em_common.php', 'from' => './../install/em_files/includes/em/em_common.php'); $files[] = array('to' => './../includes/em/em_methods_ftp_fsock.php', 'from' => './../install/em_files/includes/em/em_methods_ftp_fsock.php'); $files[] = array('to' => './../includes/em/em_parser_xml.php', 'from' => './../install/em_files/includes/em/em_parser_xml.php'); //$files[] = array('to' => './../includes/em/em_methods_ssh2.php', 'from' => './../install/em_files/includes/em/em_methods_ssh2.php'); $files[] = array('to' => './../language/lang_english/lang_easymod.php', 'from' => './../install/em_files/language/lang_english/lang_easymod.php'); $files[] = array('to' => './../templates/subSilver/admin/em_check_install.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_check_install.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_login.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_login.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_check_sql.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_check_sql.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_mod_info.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_mod_info.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_post_process.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_post_process.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_logs.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_logs.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_check_update.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_check_update.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_mod_info_rows.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_mod_info_rows.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_check_uninstall.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_check_uninstall.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_preview.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_preview.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_manage_install.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_manage_install.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_header.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_header.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_manage_history.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_manage_history.tpl'); $files[] = array('to' => './../templates/subSilver/admin/em_general.tpl', 'from' => './../install/em_files/templates/subSilver/admin/em_general.tpl'); $files[] = array('to' => './../templates/subSilver/images/em_update.gif', 'from' => './../install/em_files/templates/subSilver/images/em_update.gif'); $files[] = array('to' => './../templates/subSilver/images/em_moreinfo.gif', 'from' => './../install/em_files/templates/subSilver/images/em_moreinfo.gif'); $files[] = array('to' => './../templates/subSilver/images/em_install.gif', 'from' => './../install/em_files/templates/subSilver/images/em_install.gif'); $files[] = array('to' => './../templates/subSilver/images/em_uninstall.gif', 'from' => './../install/em_files/templates/subSilver/images/em_uninstall.gif'); $files[] = array('to' => './../templates/subSilver/images/em_preview.gif', 'from' => './../install/em_files/templates/subSilver/images/em_preview.gif'); $files[] = array('to' => './../templates/subSilver/images/easymod.gif', 'from' => './../install/em_files/templates/subSilver/images/easymod.gif'); $files[] = array('to' => './../templates/subSilver/images/em_status_ready.gif', 'from' => './../install/em_files/templates/subSilver/images/em_status_ready.gif'); $files[] = array('to' => './../templates/subSilver/images/em_status_style.gif', 'from' => './../install/em_files/templates/subSilver/images/em_status_style.gif'); if( @file_exists($em_root_path . "includes/sql/sql_parser.$phpEx") ) { $files[] = array('to' => './../includes/sql/sql_builder_mysql.php', 'from' => './../install/em_files/includes/sql/sql_builder_mysql.php'); $files[] = array('to' => './../includes/sql/sql_builder_postgresql.php', 'from' => './../install/em_files/includes/sql/sql_builder_postgresql.php'); $files[] = array('to' => './../includes/sql/sql_reserved_keywords.php', 'from' => './../install/em_files/includes/sql/sql_reserved_keywords.php'); $files[] = array('to' => './../includes/sql/sql_parser.php', 'from' => './../install/em_files/includes/sql/sql_parser.php'); $files[] = array('to' => './../includes/sql/sql_builder_mssql.php', 'from' => './../install/em_files/includes/sql/sql_builder_mssql.php'); $files[] = array('to' => './../includes/sql/sql_builder.php', 'from' => './../install/em_files/includes/sql/sql_builder.php'); $files[] = array('to' => './../language/lang_english/lang_sql_parser.php', 'from' => './../install/em_files/language/lang_english/lang_sql_parser.php'); } for($i = 0, $total = sizeof($files); $i < $total; $i++) { $cur_dir = dirname($files[$i]['to']); if(!@is_dir($cur_dir)) { ?> <tr> <td class="row3" colspan="2"><span class="gen">Making directory <strong><?php echo $cur_dir; ?></strong></span></td> <td class="row3" align="center"><span class="gen"><strong> <?php if ( !$mod_io->make_dir($cur_dir) ) { echo $lang['EM_Failed']; } else { echo $lang['EM_Passed']; } ?> </strong></span></td> </tr> <?php } ?> <tr> <td class="row1" width="40%"><span class="gen"><?php echo $files[$i]['from']; ?></span></td> <td class="row2" width="40%"><span class="gen"><?php echo $files[$i]['to']; ?></span></td> <td class="row1" width="20%" align="center"><span class="gen"><strong> <?php if (!$mod_io->copy_file($files[$i]['from'], $files[$i]['to'])) { echo $lang['EM_Failed']; } else { echo $lang['EM_Passed']; } ?> </strong></span></td> </tr> <?php } ?> <tr> <td class="cat" colspan="3"><input type="hidden" name="step" value="5" /><?php echo $hidden_fields; ?><input type="submit" value="Go to step 5" name="submit" class="mainoption" /></td> </tr> </table> <?php break; // run sql case 5: include($phpbb_root_path . $em_dir . 'includes/em/em_methods_' . $sel_method . '.'.$phpEx); $error = $mod_io->init(); $sql = array(); $sql[] = build_config_query('em_version', EM_INSTALL_VERSION); $sql[] = build_config_query('em_pass', (string) $password); $sql[] = build_config_query('em_method', (string) $sel_method); $sql[] = build_config_query('em_tmp_path', (string) $tmp_path); $sql[] = build_config_query('em_ftp_host', (string) $ftp_host); $sql[] = build_config_query('em_ftp_port', (int) $ftp_port); $sql[] = build_config_query('em_ftp_timeout', (int) $ftp_timeout); $sql[] = build_config_query('em_ftp_username', (string) $ftp_username); /** * @TODO encrypt the ftp password somehow, blowfish? */ $sql[] = build_config_query('em_ftp_password', (string) $ftp_password); $sql[] = build_config_query('em_ftp_root_path', (string) $ftp_root_path); page_header(); ?> <table border="0" cellpadding="3" cellspacing="1" class="forumline" width="100%"> <tr> <th>Sql Queries</th> </tr> <tr> <td class="row1"><span class="gen">Doing some sql processing. Look in the schema folder for the rest of the queries that aren't being performed.<br /><br /> <?php $queries_success = true; for($i = 0, $total = sizeof($sql); $i < $total; $i++) { $result = $db->sql_query($sql[$i]); if ( !$result ) { $queries_success = false; } echo 'Performing sql ... ' . (( !$result ) ? $lang['EM_Failed'] : $lang['EM_Passed']) . '<br />'; echo htmlspecialchars($sql[$i]) . '<br /><br />'; } if ( !$queries_success ) { ?> <p style="color: red; font-weight: bold;">Some of the SQL Queries failed. Check them before proceeding</p> <?php } else { ?> <p style="color: green; font-weight: bold;">SQL Queries were successful!</p> <?php } ?> </span></td> </tr> <tr> <td class="cat"><input type="hidden" name="step" value="6" /><?php echo $hidden_fields; ?><input type="submit" value="Finish install" name="submit" class="mainoption" /></td> </tr> </table> <?php break; // test to make sure install went successfully case 6: page_header(); ?> <table border="0" cellpadding="3" cellspacing="1" class="forumline" width="100%"> <tr> <th>Checking Install</th> </tr> <tr> <td class="row1"><span class="gen"> <?php $success = true; echo 'Checking for admin/admin_easymod.' . $phpEx . ' ...'; if ( file_exists($phpbb_root_path . 'admin/admin_easymod.'.$phpEx) && filesize($phpbb_root_path . 'admin/admin_easymod.'.$phpEx) > 0 ) { echo '<strong>Success!</strong><br />'; } else { echo '<strong>Error!</strong><br />'; $success = false; } echo 'Checking for templates/subSilver/admin/em_general.tpl ...'; if ( file_exists($phpbb_root_path . 'templates/subSilver/admin/em_general.tpl') && filesize($phpbb_root_path . 'templates/subSilver/admin/em_general.tpl') > 0 ) { echo '<strong>Success!</strong><br />'; } else { echo '<strong>Error!</strong><br />'; $success = false; } echo 'Checking for $board_config[\'em_pass\'] ...'; if ( $board_config['em_pass'] == $password ) { echo '<strong>Success!</strong><br />'; } else { echo '<strong>Error!</strong><br />'; $success = false; } echo 'Checking for $board_config[\'em_method\'] ...'; if ( $board_config['em_method'] == $sel_method ) { echo '<strong>Success!</strong><br />'; } else { echo '<strong>Error!</strong><br />'; $success = false; } ?> </span></td> </tr> <tr> <?php if ( $success ) { add_log('EM_Log_install', 'EasyMOD', EM_INSTALL_VERSION); ?> <td class="row1"><span class="gen"> <p style="color: green; font-weight: bold;">Install successful!</p> <a href="<?php echo append_sid("{$phpbb_root_path}index.$phpEx"); ?>">Return to Index</a> </span></td> <?php } else { ?> <td class="row1"><span class="gen"> <p style="color: red; font-weight: bold;">Install failed!</p> <a href="<?php echo append_sid("{$phpbb_root_path}install/em_install.$phpEx"); ?>">Return to Step 1</a> </span></td> <?php } ?> </tr> </table> <?php break; // get the settings case 1: default: page_header(); // // general debug information // $debug = array(); // php version $debug['general']['php_version'] = phpversion(); // phpbb version $debug['general']['phpbb_version'] = '2' . $board_config['version']; // easymod version $debug['general']['em_version'] = ( !empty($board_config['em_version']) ) ? $board_config['em_version'] : $lang['EM_Not_installed']; $debug['general']['em_install_version'] = EM_INSTALL_VERSION; // check writing temp files $tmp = true; if ( $tmpfname = @tempnam(( ( !empty($board_config['em_tmp_path']) ) ? $board_config['em_tmp_path'] : '/tmp'), 'em_')) { @unlink($tmpfname); if ( $fp = @fopen($tmpfname, 'w') ) { // remember to clean up! @fwrite($fp, "EM TEST\n"); @fclose($fp); @unlink($tmpfname); $debug['general']['tmp_write'] = true; } else { $debug['general']['tmp_write'] = false; } } else { $debug['general']['tmp_write'] = false; } // safe mode? if ( @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on' ) { $debug['general']['safe_mode'] = $lang['EM_On']; } else { $debug['general']['safe_mode'] = $lang['EM_Off']; } ?> <tr valign="top"> <td width="200"> <table border="0" cellpadding="3" cellspacing="1" class="forumline" width="100%"> <tr> <th class="thTop" colspan="2">Debug Information</th> </tr> <?php // load the methods and the debug information $method_files = array(); $methods = load_methods('install/em_files/'); for($i = 0, $total = sizeof($methods); $i < $total; $i++) { include($phpbb_root_path . $em_dir . 'includes/em/em_methods_' . $methods[$i]['file'] . '.'. $phpEx); $mod_io->test($debug, $methods[$i]['name']); $method_files[$methods[$i]['name']] = $methods[$i]['file']; } $allowed_methods = '<select name="method">'; foreach($debug as $method => $options) { $method_lang = ( isset($lang['EM_' . $method]) ) ? $lang['EM_' . $method] : str_replace('_', ' ', $method); ?> <tr> <td class="cat" colspan="2"><span class="cattitle"><?php echo $method_lang; ?></span></td> </tr> <?php foreach($options as $option => $allowed) { if ( $option == 'allowed' ) { $allowed_methods .= ( $allowed ) ? '<option value="' . $method_files[$method] . '">' . $method_lang . '</option>' : ''; } else { ?> <tr> <td class="row1"><span class="gen"><?php echo ( isset($lang['EM_' . $option]) ) ? $lang['EM_' . $option] : str_replace('_', ' ', $option); ?></span></td> <td class="row1"><span class="gen"><?php if ( is_bool($allowed) ) { echo ( $allowed ) ? $lang['EM_Passed']: $lang['EM_Failed']; } else { echo $allowed; } ?></span></td> </tr> <?php } } } $allowed_methods .= '</select>'; /** * @TODO make these more clear, add popups for help information */ ?> </table> </td> <td> <table border="0" cellpadding="3" cellspacing="1" class="forumline" width="100%"> <tr> <th colspan="2">EasyMOD Settings</th> </tr> <tr> <td class="cat" colspan="2"><span class="cattitle">General Settings</span></td> </tr> <tr> <td class="row1" width="200"><span class="gen">Password</span></td> <td class="row1"><span class="gen"><input type="password" name="password" class="post" /> <a href="javascript:help_popup('password');">Help</a></span></td> </tr> <tr> <td class="row1"><span class="gen">Password confirm</span></td> <td class="row1"><span class="gen"><input type="password" name="password_confirm" class="post" /> <a href="javascript:help_popup('password_confirm');">Help</a></span></td> </tr> <tr> <td class="row1"><span class="gen">Write/Move Method</span></td> <td class="row1"><span class="gen"><?php echo $allowed_methods; ?> <a href="javascript:help_popup('write_move_methods');">Help</a></span></td> </tr> <tr> <td class="row1"><span class="gen">Temporary Path</span></td> <td class="row1"><span class="gen"><input type="text" name="tmp_path" value="/tmp" class="post" /> <a href="javascript:help_popup('tmp_path');">Help</a></span></td> </tr> <tr> <td class="cat" colspan="2"><span class="cattitle">FTP Connection Settings</span></td> </tr> <tr> <td class="row1"><span class="gen">Username</span></td> <td class="row1"><span class="gen"><input type="text" name="ftp_username" class="post" /></span></td> </tr> <tr> <td class="row1"><span class="gen">Password</span></td> <td class="row1"><span class="gen"><input type="password" name="ftp_password" class="post" /></span></td> </tr> <tr> <td class="row1"><span class="gen">Host</span></td> <td class="row1"><span class="gen"><input type="text" name="ftp_host" class="post" /></span></td> </tr> <tr> <td class="row1"><span class="gen">Path to phpBB</span></td> <td class="row1"><span class="gen"><input type="text" name="ftp_root_path" class="post" /></span></td> </tr> <tr> <td class="row1"><span class="gen">Port</span></td> <td class="row1"><span class="gen"><input type="text" name="ftp_port" value="21" class="post" /></span></td> </tr> <tr> <td class="row1"><span class="gen">Timeout</span></td> <td class="row1"><span class="gen"><input type="text" name="ftp_timeout" value="10" class="post" /></span></td> </tr> <tr> <td class="cat" colspan="2"><span class="cattitle">SSH/SFTP Connection Settings</span></td> </tr> <tr> <td class="row1"><span class="gen">Username</span></td> <td class="row1"><span class="gen"><input type="text" name="ssh2_username" class="post" /></span></td> </tr> <tr> <td class="row1"><span class="gen">Password</span></td> <td class="row1"><span class="gen"><input type="password" name="ssh2_password" class="post" /></span></td> </tr> <tr> <td class="row1"><span class="gen">Host</span></td> <td class="row1"><span class="gen"><input type="text" name="ssh2_host" class="post" /></span></td> </tr> <tr> <td class="row1"><span class="gen">Port</span></td> <td class="row1"><span class="gen"><input type="text" name="ssh2_port" value="22" class="post" /></span></td> </tr> <tr> <td class="cat" colspan="2"><input type="hidden" name="step" value="2" /><input type="submit" name="submit" value="Go to step 2" class="mainoption" /> <input type="submit" name="rescan" value="Rescan" class="liteoption" /></td> </tr> </table> </td> <?php break; } if ( !is_bool($error) ) { em_handle_error(EM_ERR_INSTALL, $error); } page_footer(); //---------------------------------------------------------------------------------// // Functions //---------------------------------------------------------------------------------// function get_files($dir) { $files = array(); if ($handle = @opendir($dir)) { while (($file = @readdir($handle)) !== false) { if((@is_dir($dir . $file)) && ($file != ".") && ($file != "..") && (strpos($file, 'CVS') === false) && (strpos($file, '~') === false)) { $dir_files = get_files($dir . $file . '/'); foreach($dir_files as $sub_file) { $files[] = $sub_file; } } elseif (($file != ".") && ($file != "..") && (strpos($file, 'CVS') === false) && (strpos($file, '~') === false)) { $files[] = $dir . $file; } } closedir($handle); } else { echo '<b>[!]</b> Im sorry Dave, I cannot do that ... er ... because I couldn\'t open ' . $dir . '<br/>'; } return $files; } function build_config_query($name, $value) { global $db; $name = "'" . str_replace("\'", "''", $name) . "'"; if ( is_string($value) ) { $value = "'" . str_replace("\'", "''", $value) . "'"; } else { $value = intval($value); } $sql = "SELECT config_value FROM " . CONFIG_TABLE . " WHERE config_name = $name"; if(!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Could not get config value', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); if ( isset($row['config_value']) ) { $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = $value WHERE config_name = $name"; } else { $sql = 'INSERT INTO ' . CONFIG_TABLE . " (config_name, config_value) VALUES ($name, $value)"; } return $sql; } function em_debug_display() { global $board_config, $lang, $mod_io; global $sel_method, $tmp_path; global $ftp_host, $ftp_port, $ftp_timeout, $ftp_username, $ftp_password, $ftp_root_path; $tmp_write = false; if ( $tmpfname = @tempnam(( ( !empty($tmp_path) ) ? $tmp_path : '/tmp'), 'em_')) { @unlink($tmpfname); if ( $fp = @fopen($tmpfname, 'w') ) { // remember to clean up! @fwrite($fp, "EM TEST\n"); @fclose($fp); @unlink($tmpfname); $tmp_write = true; } else { $tmp_write = false; } } else { $tmp_write = false; } ?> <strong>[b]PHP Version[/b]</strong>: <?php echo phpversion(); ?><br /> <strong>[b]phpBB Version[/b]</strong>: 2.<?php echo $board_config['version']; ?><br /> <strong>[b]EM Version[/b]</strong>: <?php echo ( !empty($board_config['em_version']) ) ? $board_config['em_version'] : $lang['EM_Not_installed']; ?><br /> <strong>[b]EM Install Version[/b]</strong>: <?php echo EM_INSTALL_VERSION; ?><br /> <strong>[b]TMP Write Access[/b]</strong>: <?php echo ( $tmp_write ) ? '[color=green]' . $lang['EM_Passed'] . '[/color]': '[color=red]' . $lang['EM_Failed'] . '[/color]'; ?><br /> <strong>[b]Safe Mode[/b]</strong>: <?php echo ( @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on' ) ? 'On' : 'Off'; ?><br /><br /> <strong>[b]Selected Method[/b]</strong>: <?php echo $sel_method; ?><br /> <strong>[b]Tmp Path[/b]</strong>: <?php echo $tmp_path; ?><br /> <strong>[b]FTP Host[/b]</strong>: <?php echo $ftp_host; ?><br /> <strong>[b]FTP Port[/b]</strong>: <?php echo $ftp_port; ?><br /> <strong>[b]FTP Timeout[/b]</strong>: <?php echo $ftp_timeout; ?><br /> <strong>[b]FTP Username[/b]</strong>: <?php echo $ftp_username; ?><br /> <strong>[b]FTP Password[/b]</strong>: <?php echo ( !empty($ftp_password) ) ? '********' : 'None'; ?><br /> <strong>[b]FTP Root Path[/b]</strong>: <?php echo $ftp_root_path; ?><br /><br /> <?php $test_results = $mod_io->test_connection(); ?> <br /><br /> <?php $debug = array(); $mod_io->test($debug, 'temp'); foreach($debug['temp'] as $option => $allowed) { if ( $option == 'allowed' ) { continue; } ?> <strong>[b]<?php echo ( isset($lang['EM_' . $option]) ) ? $lang['EM_' . $option] : str_replace('_', ' ', $option); ?>[/b]</strong>: <?php if ( is_bool($allowed) ) { echo ( $allowed ) ? '[color=green]' . $lang['EM_Passed'] . '[/color]': '[color=red]' . $lang['EM_Failed'] . '[/color]'; } else { echo $allowed; } ?><br /> <?php } return; } function page_header($text = '', $form_action = false) { global $phpbb_root_path, $phpEx, $lang, $step; if ( defined('HEADER_DISPLAY') ) { return; } define('HEADER_DISPLAY', true); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang['ENCODING']; ?>"> <meta http-equiv="Content-Style-Type" content="text/css"> <title><?php echo $lang['EM_Welcome_install'];?></title> <link rel="stylesheet" href="../templates/subSilver/subSilver.css" type="text/css"> <style type="text/css"> <!-- th { background-image: url('../templates/subSilver/images/cellpic3.gif') } td.cat { background-image: url('../templates/subSilver/images/cellpic1.gif') } td.rowpic { background-image: url('../templates/subSilver/images/cellpic2.jpg'); background-repeat: repeat-y } td.catHead,td.catSides,td.catLeft,td.catRight,td.catBottom { background-image: url('../templates/subSilver/images/cellpic1.gif') } /* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */ @import url("../templates/subSilver/formIE.css"); //--> </style> <script language="javascript"> <!-- function help_popup(item) { window.open('<?php echo $phpbb_root_path; ?>install/em_install.<?php echo $phpEx; ?>?help=1#' + item, 'help', 'width=600,height=500,resizable=yes,toolbar=no,scrollbars=yes,location=no,directories=no,status=no,menubar=no,copyhistory=no'); } --> </script> </head> <body bgcolor="#E5E5E5" text="#000000" link="#006699" vlink="#5584AA"> <table width="100%" border="0" cellspacing="0" cellpadding="10" align="center"> <tr> <td class="bodyline" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../templates/subSilver/images/logo_phpBB.gif" border="0" alt="Forum Home" vspace="1" /></td> <td align="center" width="100%" valign="middle"><span class="maintitle"><?php echo $lang['EM_Welcome_install'];?></span></td> </tr> </table></td> </tr> <tr> <td> </td> </tr> <tr> <td colspan="2"><table width="90%" border="0" align="center" cellspacing="0" cellpadding="0"> <tr> <td><h4><?php echo sprintf($lang['EM_step'], $step); ?></h4><?php if ( !empty($text) ) { ?><span class="gen"><?php echo $text; ?></span><?php } ?></td> </tr> </table></td> </tr> <tr> <td> </td> </tr> <tr> <td width="100%"><table width="100%" cellpadding="2" cellspacing="1" border="0"><form action="<?php echo ($form_action) ? $form_action : 'em_install.'.$phpEx; ?>" name="install" method="post"> <?php } function page_footer() { if ( defined('FOOTER_DISPLAY') ) { return; } define('FOOTER_DISPLAY', true); ?> </table></form></td> </tr> </table> <p class="copyright" align="center"><a href="http://www.phpbb.com/" class="copyright">EasyMOD</a> © 2005 phpBB Group</p> </td> </tr> </table> </body> </html> <?php } ?> --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> |