summaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2006-05-25 23:36:02 +0200
committerneoraider <devnull@localhost>2006-05-25 23:36:02 +0200
commitfa7c1b717c118d08ba55c5306c4aeeb3e4418ca5 (patch)
tree5896ae9f7a43f27793733e28168ac579b2dd1a0d /code
parent8657d3fb5cbd25f78bc668ea9a0a8b17913dd490 (diff)
downloadneon-fa7c1b717c118d08ba55c5306c4aeeb3e4418ca5.tar
neon-fa7c1b717c118d08ba55c5306c4aeeb3e4418ca5.zip
Konfiguration steht jetzt in der Datenbank.
Diffstat (limited to 'code')
-rw-r--r--code/config.inc.php11
-rw-r--r--code/db.inc.php6
-rw-r--r--code/message.inc.php3
3 files changed, 15 insertions, 5 deletions
diff --git a/code/config.inc.php b/code/config.inc.php
new file mode 100644
index 0000000..b94a74e
--- /dev/null
+++ b/code/config.inc.php
@@ -0,0 +1,11 @@
+<?PHP
+ require_once('config/config.inc.php');
+
+ require_once('code/db.inc.php');
+
+
+ $res = $GLOBALS['db']->Execute('SELECT name, value FROM config WHERE module = 0');
+
+ while($row = $res->FetchRow())
+ $GLOBALS['config'][$row[0]] = $row[1];
+?>
diff --git a/code/db.inc.php b/code/db.inc.php
index 72f9025..706f63d 100644
--- a/code/db.inc.php
+++ b/code/db.inc.php
@@ -4,7 +4,7 @@
require_once('adodb/adodb.inc.php');
- $GLOBALS['db'] = &ADONewConnection($config['driver']);
- $GLOBALS['db']->PConnect($config['server'], $config['user'],
- $config['password'], $config['db']);
+ $GLOBALS['db'] = &ADONewConnection($GLOBALS['config']['driver']);
+ $GLOBALS['db']->PConnect($GLOBALS['config']['server'], $GLOBALS['config']['user'],
+ $GLOBALS['config']['password'], $GLOBALS['config']['db']);
?>
diff --git a/code/message.inc.php b/code/message.inc.php
index f64905f..092f4ec 100644
--- a/code/message.inc.php
+++ b/code/message.inc.php
@@ -1,6 +1,5 @@
<?PHP
- require_once('config/config.inc.php');
-
+ require_once('code/config.inc.php');
require_once('code/util.inc.php');
$message['Error'] = 'Error';