diff options
-rw-r--r-- | phpBB/download.php | 18 | ||||
-rwxr-xr-x | phpBB/install/index.php | 11 | ||||
-rwxr-xr-x | phpBB/install/install_install.php | 20 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 2 | ||||
-rw-r--r-- | phpBB/language/en/common.php | 1 | ||||
-rwxr-xr-x | phpBB/language/en/install.php | 103 |
6 files changed, 137 insertions, 18 deletions
diff --git a/phpBB/download.php b/phpBB/download.php index 86cfed7292..cd24f3ccc1 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -189,15 +189,11 @@ function send_file_to_browser($attachment, $upload_dir, $category) // Now send the File Contents to the Browser $size = @filesize($filename); - // Might not be ideal to store the contents, but file_get_contents is binary-safe as well as the recommended method // To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work) - $contents = @file_get_contents($filename); // Check if headers already sent or not able to get the file contents. - if (headers_sent() || $contents === false) + if (headers_sent() || !@file_exists($filename) || !@is_readable($filename)) { - unset($contents); - // PHP track_errors setting On? if (!empty($php_errormsg)) { @@ -210,15 +206,21 @@ function send_file_to_browser($attachment, $upload_dir, $category) // Now the tricky part... let's dance header('Pragma: public'); + // Try X-Sendfile since it is much more server friendly. + // lighttpd has core support for it. An apache2 module is available at http://celebnamer.celebworld.ws/stuff/mod_xsendfile/ + header('X-Sendfile: ' . $filename); + // Send out the Headers - header('Content-type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"'); + header('Content-Type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"'); header('Content-Disposition: inline; filename="' . $attachment['real_filename'] . '"'); if ($size) { - header("Content-length: $size"); + header("Content-Length: $size"); } - echo $contents; + + // Might not be ideal to store the contents, but file_get_contents is binary-safe as well as the recommended method + echo @file_get_contents($filename); unset($contents); flush(); diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 9a542dc2df..053ef19a17 100755 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -173,7 +173,7 @@ set_error_handler('msg_handler'); $user = new user(); $auth = new auth(); $cache = new cache(); -$template = new Template(); +$template = new template(); $template->set_custom_template('../adm/style', 'admin'); $template->assign_var('T_TEMPLATE_PATH', '../adm/style'); @@ -212,7 +212,7 @@ class module */ function create($module_type, $module_url, $selected_mod = false, $selected_submod = false) { - global $db, $config, $phpEx; + global $db, $config, $phpEx, $phpbb_root_path; $module = array(); @@ -285,10 +285,9 @@ class module $this->mode = $mode; } - /** - * @todo this could be written as $this->module = new $this->filename($this); ... no? (eval statement in install/index.php) - */ - eval("\$this->module = new $this->filename(\$this);"); + $module = $this->filename; + $this->module = new $module($this); + if (method_exists($this->module, 'main')) { $this->module->main($this->mode, $this->sub); diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index e318683334..287596497d 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -19,6 +19,19 @@ if ( !defined('IN_INSTALL') ) if (!empty($setmodules)) { + /* If phpBB is already installed we do not include this module + // This does not work at the moment because on installation the config file will be written before + // everything is finished. + if (@file_exists($phpbb_root_path . 'config.' . $phpEx)) + { + include_once($phpbb_root_path . 'config.' . $phpEx); + + if (defined('PHPBB_INSTALLED')) + { + return; + } + }*/ + $module[] = array( 'module_type' => 'install', 'module_title' => 'INSTALL', @@ -748,9 +761,9 @@ class install_install extends module // $config_data .= "\$acm_type = '" . (($acm_type) ? $acm_type : 'file') . "';\n"; $config_data .= "\$acm_type = 'file';\n"; $config_data .= "\$load_extensions = '$load_extensions';\n\n"; - $config_data .= "define('PHPBB_INSTALLED', true);\n"; - $config_data .= "define('DEBUG', true);\n"; // @todo Comment out when final - $config_data .= "define('DEBUG_EXTRA', true);\n"; // @todo Comment out when final + $config_data .= "@define('PHPBB_INSTALLED', true);\n"; + $config_data .= "@define('DEBUG', true);\n"; // @todo Comment out when final + $config_data .= "@define('DEBUG_EXTRA', true);\n"; // @todo Comment out when final $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! // Attempt to write out the config file directly. If it works, this is the easiest way to do it ... @@ -927,6 +940,7 @@ class install_install extends module global $db, $lang, $template, $phpbb_root_path, $phpEx; $this->page_title = $lang['STAGE_CREATE_TABLE']; + $s_hidden_fields = ''; // Obtain any submitted data foreach ($this->request_vars as $var) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index c2dd6babfe..fba8c5ccce 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -205,7 +205,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.B2'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.B3-dev'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 183f465a98..246d1afc14 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -140,6 +140,7 @@ $lang = array_merge($lang, array( 'ERR_CHANGING_DIRECTORY' => 'Unable to change directory', 'ERR_CONNECTING_SERVER' => 'Error connecting to the server', 'ERR_UNABLE_TO_LOGIN' => 'Error on login. Supplied username or password wrong.', + 'ERR_WRONG_PATH_TO_PHPBB' => 'The phpBB path entered seems to be not valid.', 'EXTENSION' => 'Extension', 'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension <strong>%s</strong> has been deactivated and can no longer be displayed', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index d3738b95ca..4edb29e097 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -255,4 +255,107 @@ $lang = array_merge($lang, array( 'WRITEABLE' => 'Writeable', )); +// Updater +$lang = array_merge($lang, array( + 'ALL_FILES_UP_TO_DATE' => 'All files are up to date with the latest phpBB version. You may want to run the database update tool now.', + 'ARCHIVE_FILE' => 'Source file within archive', + + 'BACK' => 'Back', + + 'CHECK_FILES' => 'Check files', + 'CHECK_FILES_AGAIN' => 'Check files again', + 'CHECK_FILES_EXPLAIN' => 'Within the next step all all files will be checked against the update files - this can take a while if this is the first file check.', + 'CHECK_FILES_UP_TO_DATE' => 'According to your database your version is up to date. You may want to proceed with the file check to make sure all files are really up to date with the latest phpBB version.', + 'COLLECTED_INFORMATIONS' => 'Collected file informations', + 'COLLECTED_INFORMATIONS_EXPLAIN'=> 'The list below shows informations about the files needing an update. Please read the information in front of every status block to see what they mean and what you may need to do to perform a successful update.', + 'CURRENT_FILE' => 'Current original file', + 'CURRENT_VERSION' => 'Current version', + + 'DESTINATION' => 'Destination file', + 'DIFF_INLINE' => 'Inline', + 'DIFF_RAW' => 'Raw unified diff', + 'DIFF_SIDE_BY_SIDE' => 'Side by Side', + 'DIFF_UNIFIED' => 'Unified diff', + 'DOWNLOAD' => 'Download', + 'DOWNLOAD_AS' => 'Download as', + 'DOWNLOAD_UPDATE_METHOD' => 'Download modified files archive', + 'DOWNLOAD_UPDATE_METHOD_EXPLAIN' => 'Once downloaded you should unpack the archive. You will find the modified files you need to upload to your phpBB root directory within it. Please upload the files to their respective locations then. After you have uploaded all files, please check the files again with the other button below.', + + 'FILE_ALREADY_UP_TO_DATE' => 'File is already up to date', + 'FILES_CONFLICT' => 'Conflict files', + 'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified the them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in loosing the changes from the newer file.', + 'FILES_MODIFIED' => 'Modified files', + 'FILES_MODIFIED_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. The updated file will be a merge between your modifications and the new file.', + 'FILES_NEW' => 'New files', + 'FILES_NEW_EXPLAIN' => 'The following files currently do not exist within your installation.', + 'FILES_NEW_CONFLICT' => 'New conflicting files', + 'FILES_NEW_CONFLICT_EXPLAIN' => 'The following files are new within the latest version but it has been determined that there is already a file with the same name within the same position. This file will be overwritten by the new file.', + 'FILES_NOT_MODIFIED' => 'Not modified files', + 'FILES_NOT_MODIFIED_EXPLAIN' => 'The following files were not modified and represent the original phpBB files from the version you want to update from.', + 'FILES_UP_TO_DATE' => 'Already updated files', + 'FILES_UP_TO_DATE_EXPLAIN' => 'The following files are already up to date and do not need to be updated.', + 'FTP_SETTINGS' => 'FTP Settings', + 'FTP_UPDATE_METHOD' => 'FTP Upload', + + 'INCOMPATIBLE_UPDATE_FILES' => 'The update files found are incompatible with your installed version. Your installed version is %1$s and the update file is for updating phpBB %2$s to %3$s.', + 'INCOMPLETE_UPDATE_FILES' => 'The update files are incomplete', + + 'LATEST_VERSION' => 'Latest version', + 'LINE' => 'Line', + 'LINE_ADDED' => 'Added', + 'LINE_MODIFIED' => 'Modified', + 'LINE_REMOVED' => 'Removed', + 'LINE_UNMODIFIED' => 'Unmodified', + 'LOGIN_UPDATE_EXPLAIN' => 'In order to update your installation you need to login first.', + + 'MAPPING_FILE_STRUCTURE' => 'To ease the upload here are the file locations which map your phpBB installation.', + 'MERGE_MOD_FILE_OPTION' => 'Use modified file code on final merge', + 'MERGE_NEW_FILE_OPTION' => 'Use new file code on final merge', + 'MERGE_SELECT_ERROR' => 'Conflicting file merge modes are not correctly selected.', + + 'NEW_FILE' => 'New updated file', + 'NO_AUTH_UPDATE' => 'Not authorized to update', + 'NO_UPDATE_FILES_OUTDATED' => 'No valid update directory was found, please make sure you uploaded the relevant files.<br /><br />Your installation does <strong>not</strong> seem to be up to date. Updates are available for your version of phpBB %1$s, please visit <a href="http://www.phpbb.com/downloads.php" rel="external">http://www.phpbb.com/downloads.php</a> to obtain the correct package to update from Version %2$s to Version %3$s.', + 'NO_UPDATE_FILES_UP_TO_DATE' => 'Your version is up to date. There is no need to run the update tool. If you want to make an integrity check on your files make sure you uploaded the correct update files.', + 'NO_UPDATE_INFO' => 'Update file informations could not be found.', + 'NO_VISIBLE_CHANGES' => 'No visible changes', + 'NOTICE' => 'Notice', + 'NUM_CONFLICTS' => 'Number of conflicts', + + 'SELECT_DIFF_MODE' => 'Select diff mode', + 'SELECT_DOWNLOAD_FORMAT' => 'Select download archive format', + 'SELECT_FTP_SETTINGS' => 'Select FTP Settings', + 'SHOW_DIFFERENCES' => 'Show differences', + 'SHOW_DIFFERENCES_CONFLICT' => 'Show differences/conflicts', + 'SHOW_FILE_CONTENTS' => 'Show file contents', + 'SHOW_MERGED_DIFFERENCES' => 'Show merged differences', + 'STAGE_FILE_CHECK' => 'Check files', + 'STAGE_UPDATE_DB' => 'Update database', + 'STAGE_UPDATE_FILES' => 'Update files', + 'STAGE_VERSION_CHECK' => 'Version Check', + 'STATUS_CONFLICT' => 'Modified file producing conflicts', + 'STATUS_MODIFIED' => 'Modified file', + 'STATUS_NEW' => 'New file', + 'STATUS_NEW_CONFLICT' => 'Conflicting new file', + 'STATUS_NOT_MODIFIED' => 'Not modified file', + 'STATUS_UP_TO_DATE' => 'Already updated file', + + 'UPDATE_DATABASE' => 'Update database', + 'UPDATE_FILES' => 'Update files', + 'UPDATE_INSTALLATION' => 'Update phpBB Installation', + 'UPDATE_INSTALLATION_EXPLAIN' => 'With this option, it is possible to update your phpBB installation to the latest version.<br />During the process all of your files will be checked for their integrity. You are able to review all differences and files before the update.<br /><br />The file update itself can be done in two different ways.</p><h2>Manual Update</h2><p>With this update you only download your personal set of changed files to make sure you do not loose your file modifications you may have done. After you downloaded this package you need to manually upload the files to their correct position under your phpBB root directory. Once done, you are able to do the file check stage again to see if you moved the files to their correct location. If everything is correctly updated you will be forwarded to the database updater.</p><h2>Automatic Update with FTP</h2><p>This method is similar to the first one but without the need to download the changed files and uploading them on your own. This will be done for you. In order to use this method you need to know your FTP login details since you will be asked for them. Once finished you will be redirected to the file check again to make sure everything got updated correctly. If so, you will be forwarded to the database updater.', + 'UPDATE_METHOD' => 'Update method', + 'UPDATE_METHOD_EXPLAIN' => 'You are now able to choose your preferred update method. Using the FTP Upload will present you with a form you need to enter your FTP account details into. With this method the files will be automatically moved to the new location and backups of the old files being created by appending .bak to the filename. If you choose to download the modified files you are able to unpack and upload them to their correct location manually later.', + 'UPDATE_SUCCESS' => 'Update was successful', + 'UPDATE_SUCCESS_EXPLAIN' => 'Successfully updated all files. The next step involves checking all files again to make sure the files got updated correctly.', + 'UPLOAD_METHOD' => 'Upload method', + + 'VERSION_CHECK' => 'Version Check', + 'VERSION_CHECK_EXPLAIN' => 'Checks to see if the version of phpBB you are currently running is up to date.', + 'VERSION_NOT_UP_TO_DATE' => 'Your version of phpBB is not up to date. Please continue the update process.', + 'VERSION_UP_TO_DATE' => 'Your installation is up to date, no updates are available for your version of phpBB. You may want to continue anyway to perform a file validity check.', + 'VIEWING_FILE_CONTENTS' => 'Viewing file contents', + 'VIEWING_FILE_DIFF' => 'Viewing file differences', +)); + ?>
\ No newline at end of file |