summaryrefslogtreecommitdiffstats
path: root/apis/getconfig.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2014-05-26 22:49:54 +0200
committerSimon Rettberg2014-05-26 22:49:54 +0200
commita4f4147b6fe5f2a003a61cf8a8f7508c94130b31 (patch)
treede34472a2b9bd83909469affb884619b4858efc1 /apis/getconfig.inc.php
parentWIP (diff)
downloadslx-admin-a4f4147b6fe5f2a003a61cf8a8f7508c94130b31.tar.gz
slx-admin-a4f4147b6fe5f2a003a61cf8a8f7508c94130b31.tar.xz
slx-admin-a4f4147b6fe5f2a003a61cf8a8f7508c94130b31.zip
WIP
Diffstat (limited to 'apis/getconfig.inc.php')
-rw-r--r--apis/getconfig.inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/apis/getconfig.inc.php b/apis/getconfig.inc.php
index 1e7a4f53..f29118c8 100644
--- a/apis/getconfig.inc.php
+++ b/apis/getconfig.inc.php
@@ -1,5 +1,7 @@
<?php
+require_once 'inc/property.inc.php';
+
// Dump config from DB
$res = Database::simpleQuery('SELECT setting.setting, setting.defaultvalue, setting.permissions, setting.description, tbl.value
FROM setting
@@ -12,3 +14,18 @@ while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
// Additional "intelligent" config
echo "SLX_REMOTE_LOG='http://${_SERVER['SERVER_ADDR']}/slxadmin/api.php?do=clientlog'\n";
+$vmstore = Property::getVmStoreConfig();
+
+if (is_array($vmstore)) {
+ switch ($vmstore['storetype']) {
+ case 'internal';
+ echo "SLX_VM_NFS='{$_SERVER['SERVER_ADDR']}:/srv/openslx/nfs'\n";
+ break;
+ case 'nfs';
+ echo "SLX_VM_NFS='{$vmstore['nfsaddr']}'\n";
+ break;
+ case 'cifs';
+ echo "SLX_VM_NFS='{$vmstore['cifsaddr']}'\n";
+ break;
+ }
+}