Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv19357
Modified Files:
serendipity_admin_installer.inc.php
Log Message:
Fixed bug which inserted wrong values in the database during installation
Index: serendipity_admin_installer.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_installer.inc.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- serendipity_admin_installer.inc.php 3 Sep 2003 19:59:29 -0000 1.36
+++ serendipity_admin_installer.inc.php 7 Sep 2003 20:53:23 -0000 1.37
@@ -302,6 +302,9 @@
$mail_comments = 0;
}
+ /*
+ ------------- Install main author ------------
+ */
$enc_pass = md5($_POST['pass']);
$query = "INSERT INTO {$_POST['dbPrefix']}authors (
username,
@@ -362,7 +365,6 @@
// Save all basic config variables to the database
$p = serendipity_parseTemplate("./serendipity_config_local.tpl");
-
foreach($p as $key => $value) {
foreach ($value as $entry) {
serendipity_set_config_var($entry['name'], $_POST[$entry['name']]);
@@ -420,10 +422,12 @@
$res = serendipity_installDatabase();
if ( $res !== false ) {
echo ' ' . DONE . '<br />';
+ /* Insert all the configurated options */
+ serendipity_updateConfiguration();
} else {
echo '<span style="color: #FF0000">- ' . DATABASE_ALREADY_INSTALLED . '</span><br />';
}
-
+
/* Next are the files, .htaccess */
printf(ATTEMPT_WRITE_FILE, '.htaccess');
$res = serendipity_installFiles();
@@ -459,16 +463,20 @@
);
session_destroy();
- }
-
- $res = serendipity_updateConfiguration();
- if ( is_array($res) ) {
- echo DIAGNOSTIC_ERROR;
- echo '<span style="color: #FF0000">- ' . implode('<br />', $res) . '</span><br /><br />';
+
+
+ /*
+ If serendipity is already installed and we are only doing a reconfiguration
+ */
} else {
- echo WRITTEN_N_SAVED;
+ $res = serendipity_updateConfiguration();
+ if ( is_array($res) ) {
+ echo DIAGNOSTIC_ERROR;
+ echo '<span style="color: #FF0000">- ' . implode('<br />', $res) . '</span><br /><br />';
+ } else {
+ echo WRITTEN_N_SAVED;
+ }
}
-
break;
default:
|