aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2006-04-27 21:05:07 +0000
committerplegall <plg@piwigo.org>2006-04-27 21:05:07 +0000
commit46900fece3a0ffb09a0a4fe58bae841a3978f79d (patch)
tree7922f66a8f62a2eacf810ac75ed90344094f26fb /include/functions.inc.php
parent321d7d474c0c88316472e96d9740b2c4bbb6f6a6 (diff)
bug 228 fixed one more time ;-): use boolean_to_string on
$conf['newuser_default_enabled_high'] during user infos creation. Useless use of boolean_to_string on $conf['newcat_default_status'] was removed. modification: loading configuration parameter from database was moved to a dedicated function to be called from include/common.inc.php and from install.php. improvement: use of clean insert function during install. bug fixed: during user information creation, support new status webmaster/normal/guest instead of admin/guest. bug fixed: during install, no need to insert obsolete mail_webmaster configuration parameter. git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1282 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions.inc.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 35b1e7935..166b0798f 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -881,4 +881,36 @@ function get_available_upgrade_ids()
return $available_upgrade_ids;
}
+/**
+ * Add configuration parameters from database to global $conf array
+ *
+ * @return void
+ */
+function load_conf_from_db()
+{
+ global $conf;
+
+ $query = '
+SELECT param,value
+ FROM '.CONFIG_TABLE.'
+;';
+ $result = pwg_query($query);
+
+ if (mysql_num_rows($result) == 0)
+ {
+ die('No configuration data');
+ }
+
+ while ($row = mysql_fetch_array($result))
+ {
+ $conf[ $row['param'] ] = isset($row['value']) ? $row['value'] : '';
+
+ // If the field is true or false, the variable is transformed into a
+ // boolean value.
+ if ($conf[$row['param']] == 'true' or $conf[$row['param']] == 'false')
+ {
+ $conf[ $row['param'] ] = get_boolean($conf[ $row['param'] ]);
+ }
+ }
+}
?>