From 2b2df5bf91f06cbc64368b9a0816fd3c5a60f4d2 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 4 Jun 2014 15:18:30 +0200 Subject: Add RO-Credentials to CIFS VMStore --- apis/getconfig.inc.php | 19 +++++++++++++------ modules/vmstore.inc.php | 2 +- style/default.css | 6 +++++- templates/page-vmstore.html | 32 ++++++++++++++++++-------------- 4 files changed, 37 insertions(+), 22 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 @@ 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; } } diff --git a/modules/vmstore.inc.php b/modules/vmstore.inc.php index a8f2ec48..602ab258 100644 --- a/modules/vmstore.inc.php +++ b/modules/vmstore.inc.php @@ -39,7 +39,7 @@ class Page_VmStore extends Page private function setStore() { - foreach (array('storetype', 'nfsaddr', 'cifsaddr', 'cifsuser', 'cifspasswd') as $key) { + foreach (array('storetype', 'nfsaddr', 'cifsaddr', 'cifsuser', 'cifspasswd', 'cifsuserro', 'cifspasswdro') as $key) { $vmstore[$key] = trim(Request::post($key, '')); } $storetype = $vmstore['storetype']; diff --git a/style/default.css b/style/default.css index 3e5f1a56..813e54c2 100644 --- a/style/default.css +++ b/style/default.css @@ -98,4 +98,8 @@ body { .input-group { margin-bottom: 2px; -} \ No newline at end of file +} + +.slx-md-width { + max-width: 600px; +} diff --git a/templates/page-vmstore.html b/templates/page-vmstore.html index 8732276f..1dde2734 100644 --- a/templates/page-vmstore.html +++ b/templates/page-vmstore.html @@ -6,7 +6,7 @@
VM Speicherort
-
+

Bitte wählen Sie, wo die Images der Virtuellen Maschinen gespeichert werden sollen.

@@ -21,12 +21,8 @@ NFS
-
- - NFS-Export - - -
+ +
@@ -34,23 +30,31 @@ CIFS
+ + +
+
- UNC-Pfad + Benutzername + + + + Passwort - +
+
+
Benutzername - -
-
- + + Passwort - +
-- cgit v1.2.3-55-g7522