aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install.php
diff options
context:
space:
mode:
authorthe_systech <the_systech@users.sourceforge.net>2001-10-02 14:30:15 +0000
committerthe_systech <the_systech@users.sourceforge.net>2001-10-02 14:30:15 +0000
commitba4944f1c7431f4d3895190251a40f94e14b6466 (patch)
tree2c8c4e4618817cdc8f2eb639a8a39d0792119b04 /phpBB/install.php
parent2d769f1c105ab8138d63d1877b000d0c1ae59065 (diff)
downloadforums-ba4944f1c7431f4d3895190251a40f94e14b6466.tar
forums-ba4944f1c7431f4d3895190251a40f94e14b6466.tar.gz
forums-ba4944f1c7431f4d3895190251a40f94e14b6466.tar.bz2
forums-ba4944f1c7431f4d3895190251a40f94e14b6466.tar.xz
forums-ba4944f1c7431f4d3895190251a40f94e14b6466.zip
Merge install and includes/installation, and updated error handling for config file unwritable.
git-svn-id: file:///svn/phpbb/trunk@1125 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install.php')
-rw-r--r--phpBB/install.php109
1 files changed, 106 insertions, 3 deletions
diff --git a/phpBB/install.php b/phpBB/install.php
index fff04a9208..50ce9fb4e5 100644
--- a/phpBB/install.php
+++ b/phpBB/install.php
@@ -18,15 +18,93 @@
* (at your option) any later version.
*
***************************************************************************/
+//
+// First thing to check for is the case that we couldn't write the config
+// file and they chose to have use send it to them.
+//
+
+if($HTTP_POST_VARS['send_file'] == 1)
+{
+ header("Content-Type: text/x-delimtext; name=\"config.php\"");
+ header("Content-disposition: attachment; filename=config.php");
+ if(get_magic_quotes_gpc())
+ {
+ $HTTP_POST_VARS['config_data'] = stripslashes($HTTP_POST_VARS['config_data']);
+ }
+ echo $HTTP_POST_VARS['config_data'];
+ exit();
+}
+
$phpbb_root_path='./';
include($phpbb_root_path.'extension.inc');
-include($phpbb_root_path.'includes/installation.'.$phpEx);
+
+
+/***************************************************************************
+ * Install Customization Section
+ *
+ * This section can be modified to set up some basic default information
+ * used by the install script. Specifically the default theme data
+ * and the default template.
+ *
+ **************************************************************************/
+$userdata = "some false data";
+$theme = array(
+ 'themes_id' => '2',
+ 'themes_name' => 'Default',
+ 'template_name' => 'Default',
+ 'td_color1' => 'CCCCCC',
+ 'td_color2' => 'DDDDDD'
+);
+$default_language = 'english';
+$default_template = 'Default';
+
+$available_dbms[] = array(
+ "LABEL" => "MySQL",
+ "VALUE" => "mysql"
+);
+$available_dbms[] = array(
+ "LABEL" => "MS SQL",
+ "VALUE" => "mssql"
+);
+$available_dbms[] = array(
+ "LABEL" => "Postgres",
+ "VALUE" => "postgres"
+);
+$available_dbms[] = array(
+ "LABEL" => "ODBC - MSAccess",
+ "VALUE" => "odbc:access"
+);
+$available_dbms[] = array(
+ "LABEL" => "ODBC - DB2",
+ "VALUE" => "odbc:db2"
+);
+/***************************************************************************
+*
+* End Install Customization Section
+*
+***************************************************************************/
+
+//
+// Fill an array with a list of available languages.
+//
+
+$dir = opendir($phpbb_root_path.'/language');
+while($file = readdir($dir))
+{
+ if(preg_match("/^lang_(.*)\.$phpEx/", $file, $matches))
+ {
+ $available_lang[] = $matches[1];
+ }
+}
+
+//
+// Bring in the extra files that contain functions we need.
+//
$language = ($HTTP_POST_VARS['language']) ? $HTTP_POST_VARS['language'] : $default_language;
include($phpbb_root_path.'includes/sql_parse.'.$phpEx);
include($phpbb_root_path.'includes/constants.'.$phpEx);
include($phpbb_root_path.'includes/template.'.$phpEx);
-//include($phpbb_root_path.'includes/message.'.$phpEx);
include($phpbb_root_path.'includes/functions.'.$phpEx);
include($phpbb_root_path.'language/lang_'.$language.'.'.$phpEx);
@@ -301,7 +379,32 @@ switch ( $installStep )
$config_data.= '$table_prefix = "'.$HTTP_POST_VARS['prefix'].'";'."\n";
$config_data.= '?>';
@umask(0111);
- $fp = fopen('config.php', 'w');
+ $noOpen = False;
+ $fp = @fopen('config.php', 'w');
+ if(!$fp)
+ {
+ //
+ // Unable to open the file writeable do something here as an attempt
+ // to get around that...
+ $template->set_filenames(array(
+ "body" => "install.tpl")
+ );
+ $template->assign_vars(array(
+ "L_INSTRUCT" => $lang['UnWrite_Config'],
+ "L_SUBMIT" => $lang['Send_Config'],
+ "S_FORM_ACTION" => 'install.'.$phpEx)
+ );
+ $template->assign_block_vars("hidden_fields", array(
+ "NAME" => "config_data",
+ "VALUE" => htmlspecialchars($config_data) )
+ );
+ $template->assign_block_vars("hidden_fields", array(
+ "NAME" => "send_file",
+ "VALUE" => "1")
+ );
+ $template->pparse('body');
+ exit();
+ }
$result = fputs($fp, $config_data, strlen($config_data));
fclose($fp);
//