Commit in phpslash-dev on MAIN
CHANGES+5-11.164 -> 1.165
public_html/config_setup.php+35-271.19 -> 1.20
           /config-dist.ini.php+2-21.30 -> 1.31
+42-30
3 modified files
config-setup.php, config-dist.ini.php - correct check for randomization string.  config file saving cleaned up some.

phpslash-dev
CHANGES 1.164 -> 1.165
diff -u -r1.164 -r1.165
--- CHANGES	11 May 2005 19:07:22 -0000	1.164
+++ CHANGES	11 May 2005 21:27:07 -0000	1.165
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.164 2005/05/11 19:07:22 joestewart Exp $
+$Id: CHANGES,v 1.165 2005/05/11 21:27:07 joestewart Exp $
 
 Changes Legend...
 
@@ -13,6 +13,10 @@
  9 - Removal of something (kill -9 :)
 
 2005-May 11  Joe Stewart <joe@php-slash.org> 
+[B] - config-setup.php, config-dist.ini.php - correct check for randomization 
+      string.  config file saving cleaned up some.
+
+2005-May 11  Joe Stewart <joe@php-slash.org> 
 [B] - Author.class, author/index.php, Story_base.class - correct permission 
       issues when saving profile and saving stories reported by tobozo and 
       crashfr.

phpslash-dev/public_html
config_setup.php 1.19 -> 1.20
diff -u -r1.19 -r1.20
--- config_setup.php	26 Jan 2005 18:44:40 -0000	1.19
+++ config_setup.php	11 May 2005 21:27:09 -0000	1.20
@@ -2,7 +2,7 @@
 /* Back-End configurator 0.4.2
  * Evan Hughes (evan@openconcept.ca), OpenConcept Consulting
  *
- * $Id: config_setup.php,v 1.19 2005/01/26 18:44:40 joestewart Exp $
+ * $Id: config_setup.php,v 1.20 2005/05/11 21:27:09 joestewart Exp $
  *
  * This is the backend configurator. It's a quick and dirty configuration tool
  * designed to be used to configure an initial install of Back-End. It is NOT 
@@ -45,7 +45,7 @@
 define('PSL_INIFILE_PATH','/etc/'.strtolower(PRODUCT).'/'); // Location for phpslash configurations. This is the location that phpslash will fall back to if config.ini.php is not found in "public_html" (the publicly accessible files of phpslash): HINT check config.php for $psl_inifile_path content
 
 define('CONFIG_IN', 'config-dist.ini.php'); // Name of the blank config file. 
-define('CONFIG_OUT', $_SERVER['SERVER_NAME'].'-config.ini.php'); // Name of the target config file. FQDN-config.ini.php or config.ini.php are both good. (where FQDN is: www.domain.com)
+define('CONFIG_OUT', 'config.ini.php'); // Name of the target config file. FQDN-config.ini.php or config.ini.php are both good. (where FQDN is: www.domain.com)
 
 define('TABLE_PATH', '/tables/0.8/'); // Path to the sql table directory.
 define('DEBIAN_DOC_PATH', '/usr/share/doc/'.strtolower(PRODUCT).'/'); // Path to the sql table directory under debian (for .deb package. strings are all lowercase)
@@ -559,9 +559,9 @@
         $vars["/<$name>/"] = $value;
     }
 
-    // Generate a ranom value
-    if (!isset($vars['RANDOMIZATION']) || empty($vars['RANDOMIZATION'])) {
-       $vars['RANDOMIZATION'] = rand();
+    // Generate a random value
+    if (!isset($vars['/<RANDOMIZATION>/']) || empty($vars['/<RANDOMIZATION>/'])) {
+       $vars['/<RANDOMIZATION>/'] = rand();
     }
 
     $result = _filterFile(CONFIG_IN, CONFIG_OUT, $vars);
@@ -1221,11 +1221,15 @@
 function _parse_ini_file ($filename)
 {
     $parse=array();
-    if (!is_file($filename)) {
-        // fallback to default multi-hosts localtion:
-        $parse = parse_ini_file( PSL_INIFILE_PATH . $filename );
+    if (is_file($filename)) {
+       // found config.ini.php in public_html
+       $parse = parse_ini_file( $filename );
+    } elseif (is_file($_SERVER['SERVER_NAME'].'-'.$filename)) {
+       // found host-config.ini.php in public_html
+       $parse = parse_ini_file($_SERVER['SERVER_NAME'].'-'.$filename );
     } else {
-        $parse = parse_ini_file( $filename );
+        // fallback to default multi-hosts location:
+        $parse = parse_ini_file( PSL_INIFILE_PATH .$_SERVER['SERVER_NAME'].'-'. $filename );
     }
     return $parse;
 }
@@ -1239,28 +1243,32 @@
 
    global $modifiedConfigFile;
 
-    if (!$in = @fopen($fileIn, "r")) {
-        // fallback to default multi-hosts localtion:
-        $fileIn = PSL_INIFILE_PATH . $fileIn;
-        if (!$in = @fopen($fileIn, "r")) {
-            return FF_READ_FAIL;
-        }
-    }
-
-    if (!$out = @fopen($fileOut, "w")) {
-        // fallback to default multi-hosts localtion:
-        $fileOut = PSL_INIFILE_PATH . $fileOut;
-        if (!$out = @fopen($fileOut, "w")) {
-            // spit out configuration
-            while (!feof ($in)) {
+   if (!$in = @fopen($fileIn, "r")) {
+      // fallback to default multi-hosts localtion:
+      $fileIn = PSL_INIFILE_PATH . $fileIn;
+      if (!$in = @fopen($fileIn, "r")) {
+          return FF_READ_FAIL;
+      }
+   }
+
+   if (!$out = @fopen($fileOut, "w")) {
+       // config.ini.php not found check for host-config.ini.php
+       $fileOut = $_SERVER['SERVER_NAME'].'-'.$fileOut;
+       if (!$out = @fopen($fileOut, "w")) {
+          // fallback to default multi-hosts location:
+          $fileOut = PSL_INIFILE_PATH . $fileOut;
+          if (!$out = @fopen($fileOut, "w")) {
+             // spit out configuration
+             while (!feof ($in)) {
                 $buffer = fgets($in);
                 foreach ($variables as $regex => $replacement) {
-                    $buffer = preg_replace($regex, $replacement, $buffer);
+                   $buffer = preg_replace($regex, $replacement, $buffer);
                 }
                 $modifiedConfigFile .= htmlentities($buffer);
-            }
-            return FF_WRITE_FAIL;
-        }
+             }
+             return FF_WRITE_FAIL;
+          }
+       }
     }
 
     while (!feof ($in)) {

phpslash-dev/public_html
config-dist.ini.php 1.30 -> 1.31
diff -u -r1.30 -r1.31
--- config-dist.ini.php	26 Jan 2005 18:44:40 -0000	1.30
+++ config-dist.ini.php	11 May 2005 21:27:09 -0000	1.31
@@ -1,7 +1,7 @@
 ; <?php die(); DO NOT REMOVE THIS LINE
 ;;;;;;;;;; 
 ;; config.ini.php - Configuration File for PHPSlash
-;; $Id: config-dist.ini.php,v 1.30 2005/01/26 18:44:40 joestewart Exp $
+;; $Id: config-dist.ini.php,v 1.31 2005/05/11 21:27:09 joestewart Exp $
 ;; vi: set ft=dosini :
 ;;;;;;;;;;
 
@@ -283,7 +283,7 @@
 ;; The "skin" is the basic look for your site.  PHPSlash ships with two,
 ;; both HTML 4.0 Transitional.  The "basic" skin does all formatting
 ;; with CSS, whereas the "default" skin uses <font> tags and such.
-defaultskin = "default"
+defaultskin = "basic"
 
 ;;;
 ;; Authorization mode:
CVSspam 0.2.10