From d2a64865a7089133345dc9eed63ddab691d43575 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 20 May 2011 02:25:46 -0400
Subject: [PATCH] - Fix func_get_args() usage for PHP<5.3 (#1487928)

---
 installer/rcube_install.php |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/installer/rcube_install.php b/installer/rcube_install.php
index 3f2d1a4..c8c103a 100644
--- a/installer/rcube_install.php
+++ b/installer/rcube_install.php
@@ -123,8 +123,8 @@
     
     return $value !== null && $value !== '' ? $value : $default;
   }
-  
-  
+
+
   /**
    * Take the default config file and replace the parameters
    * with the submitted form data
@@ -135,13 +135,14 @@
   function create_config($which, $force = false)
   {
     $out = @file_get_contents(RCMAIL_CONFIG_DIR . "/{$which}.inc.php.dist");
-    
+
     if (!$out)
       return '[Warning: could not read the config template file]';
 
     foreach ($this->config as $prop => $default) {
+
       $value = (isset($_POST["_$prop"]) || $this->bool_config_props[$prop]) ? $_POST["_$prop"] : $default;
-      
+
       // convert some form data
       if ($prop == 'debug_level') {
         $val = 0;
@@ -193,9 +194,9 @@
       else if (is_numeric($value)) {
         $value = intval($value);
       }
-      
+
       // skip this property
-      if (!$force && ($value == $default))
+      if (!$force && !$this->configured && ($value == $default))
         continue;
 
       // save change
@@ -511,6 +512,20 @@
     return $select;
   }
   
+  /**
+   * Return a list with available subfolders of the skin directory
+   */
+  function list_skins()
+  {
+    $skins = array();
+    $skindir = INSTALL_PATH . 'skins/';
+    foreach (glob($skindir . '*') as $path) {
+      if (is_dir($path) && is_readable($path)) {
+        $skins[] = substr($path, strlen($skindir));
+      }
+    }
+    return $skins;
+  }
   
   /**
    * Display OK status

--
Gitblit v1.9.1