aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorGraham Eames <grahamje@users.sourceforge.net>2006-04-22 13:59:46 +0000
committerGraham Eames <grahamje@users.sourceforge.net>2006-04-22 13:59:46 +0000
commitebae19ff71f4f189a0e033073a38abe4637a3e69 (patch)
tree5f8342e0385243e151ee6b0f9be8ce6df695aaba /phpBB
parent832ac398c401101585a0ded8faea5d084391cbf9 (diff)
downloadforums-ebae19ff71f4f189a0e033073a38abe4637a3e69.tar
forums-ebae19ff71f4f189a0e033073a38abe4637a3e69.tar.gz
forums-ebae19ff71f4f189a0e033073a38abe4637a3e69.tar.bz2
forums-ebae19ff71f4f189a0e033073a38abe4637a3e69.tar.xz
forums-ebae19ff71f4f189a0e033073a38abe4637a3e69.zip
The return of the option to download the config file if it could not be written
git-svn-id: file:///svn/phpbb/trunk@5821 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rwxr-xr-xphpBB/adm/style/install_install.html11
-rwxr-xr-xphpBB/install/install_install.php54
-rwxr-xr-xphpBB/language/en/install.php1
3 files changed, 58 insertions, 8 deletions
diff --git a/phpBB/adm/style/install_install.html b/phpBB/adm/style/install_install.html
index f83e73d143..efa52fa94b 100755
--- a/phpBB/adm/style/install_install.html
+++ b/phpBB/adm/style/install_install.html
@@ -41,6 +41,17 @@
<!-- END options -->
</fieldset>
+<!-- IF S_SHOW_DOWNLOAD -->
+<fieldset>
+ <legend>{L_DL_CONFIG}</legend>
+ <p>{L_DL_CONFIG_EXPLAIN}</p>
+</fieldset>
+<fieldset class="submit-buttons">
+ {S_HIDDEN}
+ <input class="button1" type="submit" id="dlconfig" name="dlconfig" value="{L_DL_DOWNLOAD}" />&nbsp;<input class="button1" type="submit" id="dldone" name="dldone" value="{L_DL_DONE}" />
+</fieldset>
+<!-- ENDIF -->
+
<!-- IF L_SUBMIT -->
<fieldset class="submit-buttons">
{S_HIDDEN}
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 7154eee9bc..7981908957 100755
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -721,18 +721,56 @@ class install_install extends module
@fclose($fp);
}
- if ($written)
+ if (isset($_POST['dldone']))
{
- $config_options = array_merge($this->db_config_options, $this->admin_config_options);
- foreach ($config_options as $config_key => $vars)
+ // Do a basic check to make sure that the file has been uploaded
+ // Note that all we check is that the file has _something_ in it
+ // We don't compare the contents exactly - if they can't upload
+ // a single file correctly, it's likely they will have other problems....
+ if (filesize($phpbb_root_path . 'config.'.$phpEx) > 10)
{
- if (!is_array($vars))
- {
- continue;
- }
- $s_hidden_fields .= '<input type="hidden" name="' . $config_key . '" value="' . $$config_key . '" />';
+ $written = true;
}
+ }
+ $config_options = array_merge($this->db_config_options, $this->admin_config_options);
+ foreach ($config_options as $config_key => $vars)
+ {
+ if (!is_array($vars))
+ {
+ continue;
+ }
+ $s_hidden_fields .= '<input type="hidden" name="' . $config_key . '" value="' . $$config_key . '" />';
+ }
+
+ if (!$written)
+ {
+ // OK, so it didn't work let's try the alternatives
+
+ if (isset($_POST['dlconfig']))
+ {
+ // They want a copy of the file to download, so send the relevant headers and dump out the data
+ header("Content-Type: text/x-delimtext; name=\"config.$phpEx\"");
+ header("Content-disposition: attachment; filename=config.$phpEx");
+ echo $config_data;
+ exit;
+ }
+
+ // The option to download the config file is always available, so output it here
+ $template->assign_vars(array(
+ 'BODY' => $lang['CONFIG_FILE_UNABLE_WRITE'],
+ 'L_DL_CONFIG' => $lang['DL_CONFIG'],
+ 'L_DL_CONFIG_EXPLAIN' => $lang['DL_CONFIG_EXPLAIN'],
+ 'L_DL_DONE' => $lang['DL_DONE'],
+ 'L_DL_DOWNLOAD' => $lang['DL_DOWNLOAD'],
+ 'S_HIDDEN' => $s_hidden_fields,
+ 'S_SHOW_DOWNLOAD' => true,
+ 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&amp;sub=config_file",
+ ));
+ return;
+ }
+ else
+ {
$template->assign_vars(array(
'BODY' => $lang['CONFIG_FILE_WRITTEN'],
'L_SUBMIT' => $lang['NEXT_STEP'],
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index 3d186b5cd9..0d0480724b 100755
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -43,6 +43,7 @@ $lang = array_merge($lang, array(
'CAT_CONVERT' => 'Convert',
'CAT_INSTALL' => 'Install',
'CAT_OVERVIEW' => 'Overview',
+ 'CONFIG_FILE_UNABLE_WRITE' => 'It was not possible to write the configuration file. Alternative methods for this file to be created are presented below',
'CONFIG_FILE_WRITTEN' => 'The configuration file has been written, you may now proceed to the next step of the installation',
'CONFIG_RETRY' => 'Retry',
'CONTACT_EMAIL' => 'Contact email address',