summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJonathan Bauer2014-06-04 18:11:24 +0200
committerJonathan Bauer2014-06-04 18:11:24 +0200
commit9f14e302af77b5a8f72b4785e7376cc346519ef7 (patch)
treeaa3be844d8b879b3eab06793c4ae33ac0e6c233b /modules
parentlisting of module's content (diff)
parentAdd RO-Credentials to CIFS VMStore (diff)
downloadslx-admin-9f14e302af77b5a8f72b4785e7376cc346519ef7.tar.gz
slx-admin-9f14e302af77b5a8f72b4785e7376cc346519ef7.tar.xz
slx-admin-9f14e302af77b5a8f72b4785e7376cc346519ef7.zip
Merge branch 'master' of git.openslx.org:openslx-ng/slx-admin
Diffstat (limited to 'modules')
-rw-r--r--modules/minilinux.inc.php21
-rw-r--r--modules/serversetup.inc.php2
-rw-r--r--modules/vmstore.inc.php2
3 files changed, 19 insertions, 6 deletions
diff --git a/modules/minilinux.inc.php b/modules/minilinux.inc.php
index f3fb6dce..f947ef41 100644
--- a/modules/minilinux.inc.php
+++ b/modules/minilinux.inc.php
@@ -40,6 +40,16 @@ class Page_MiniLinux extends Page
if (!file_exists($local) || filesize($local) !== $file['size'] || md5_file($local) !== substr($file['md5'], 0, 32)) {
$file['changed'] = true;
}
+ $taskId = Property::getDownloadTask($file['md5']);
+ if ($taskId !== false) {
+ $task = Taskmanager::status($taskId);
+ if (isset($task['data']['progress'])) {
+ $file['download'] = Render::parse('minilinux/download', array(
+ 'task' => $taskId,
+ 'name' => $file['name']
+ ));
+ }
+ }
}
}
echo Render::parse('minilinux/filelist', array(
@@ -54,16 +64,16 @@ class Page_MiniLinux extends Page
echo "Invalid download request";
return;
}
- $found = false;
+ $file = false;
foreach ($data['systems'] as &$system) {
if ($system['id'] !== $id) continue;
- foreach ($system['files'] as &$file) {
- if ($file['name'] !== $name) continue;
- $found = true;
+ foreach ($system['files'] as &$f) {
+ if ($f['name'] !== $name) continue;
+ $file = $f;
break;
}
}
- if (!$found) {
+ if ($file === false) {
echo "Nonexistent system/file: $id / $name";
return;
}
@@ -75,6 +85,7 @@ class Page_MiniLinux extends Page
echo 'Error launching download task: ' . $task['statusCode'];
return;
}
+ Property::setDownloadTask($file['md5'], $task['id']);
echo Render::parse('minilinux/download', array(
'name' => $name,
'task' => $task['id']
diff --git a/modules/serversetup.inc.php b/modules/serversetup.inc.php
index 73a1a8fc..46a8fb4e 100644
--- a/modules/serversetup.inc.php
+++ b/modules/serversetup.inc.php
@@ -48,6 +48,8 @@ class Page_ServerSetup extends Page
$data = $this->currentMenu;
$data['token'] = Session::get('token');
$data['taskid'] = Property::getIPxeTaskId();
+ if (!isset($data['defaultentry']))
+ $data['defaultentry'] = 'net';
if ($data['defaultentry'] === 'net')
$data['active-net'] = 'checked';
if ($data['defaultentry'] === 'hdd')
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'];