diff options
author | Simon Rettberg | 2014-06-04 15:18:30 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-06-04 15:18:30 +0200 |
commit | 2b2df5bf91f06cbc64368b9a0816fd3c5a60f4d2 (patch) | |
tree | 1b7ae71d2d19eb502f7b4efd52401a48a9afbd25 /apis/getconfig.inc.php | |
parent | Remove old download stuff (diff) | |
download | slx-admin-2b2df5bf91f06cbc64368b9a0816fd3c5a60f4d2.tar.gz slx-admin-2b2df5bf91f06cbc64368b9a0816fd3c5a60f4d2.tar.xz slx-admin-2b2df5bf91f06cbc64368b9a0816fd3c5a60f4d2.zip |
Add RO-Credentials to CIFS VMStore
Diffstat (limited to 'apis/getconfig.inc.php')
-rw-r--r-- | apis/getconfig.inc.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/apis/getconfig.inc.php b/apis/getconfig.inc.php index f29118c8..0a8db6be 100644 --- a/apis/getconfig.inc.php +++ b/apis/getconfig.inc.php @@ -1,6 +1,9 @@ <?php -require_once 'inc/property.inc.php'; +function escape($string) +{ + return str_replace("'", "\\'", $string); +} // Dump config from DB $res = Database::simpleQuery('SELECT setting.setting, setting.defaultvalue, setting.permissions, setting.description, tbl.value @@ -12,20 +15,24 @@ while ($row = $res->fetch(PDO::FETCH_ASSOC)) { echo $row['setting'] . "='" . str_replace("'", "'\"'\"'", $row['value']) . "'\n"; } // Additional "intelligent" config -echo "SLX_REMOTE_LOG='http://${_SERVER['SERVER_ADDR']}/slxadmin/api.php?do=clientlog'\n"; -$vmstore = Property::getVmStoreConfig(); +// Remote log URL +echo "SLX_REMOTE_LOG='http://" . escape($_SERVER['SERVER_ADDR']) . "/slxadmin/api.php?do=clientlog'\n"; +// VMStore path and type +$vmstore = Property::getVmStoreConfig(); if (is_array($vmstore)) { switch ($vmstore['storetype']) { case 'internal'; - echo "SLX_VM_NFS='{$_SERVER['SERVER_ADDR']}:/srv/openslx/nfs'\n"; + echo "SLX_VM_NFS='" . escape($_SERVER['SERVER_ADDR']) . ":/srv/openslx/nfs'\n"; break; case 'nfs'; - echo "SLX_VM_NFS='{$vmstore['nfsaddr']}'\n"; + echo "SLX_VM_NFS='" . escape($vmstore['nfsaddr']) . "'\n"; break; case 'cifs'; - echo "SLX_VM_NFS='{$vmstore['cifsaddr']}'\n"; + echo "SLX_VM_NFS='" . escape($vmstore['cifsaddr']) . "'\n"; + echo "SLX_VM_NFS_USER='" . escape($vmstore['cifsuserro']) . "'\n"; + echo "SLX_VM_NFS_PASSWD='" . escape($vmstore['cifspasswdro']) . "'\n"; break; } } |