summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2014-06-02 16:03:40 +0200
committerSimon Rettberg2014-06-02 16:03:40 +0200
commit9d6af837983261c0f35dc64e075e4f6917784eca (patch)
treebe75fd19fe45273d3d2c73d25ba6c09504eee35f
parentFixed some bugs from Sateserver v05 (diff)
downloadslx-admin-9d6af837983261c0f35dc64e075e4f6917784eca.tar.gz
slx-admin-9d6af837983261c0f35dc64e075e4f6917784eca.tar.xz
slx-admin-9d6af837983261c0f35dc64e075e4f6917784eca.zip
Zeug
-rw-r--r--inc/property.inc.php12
-rw-r--r--inc/trigger.inc.php2
-rw-r--r--modules/minilinux.inc.php1
-rw-r--r--modules/serversetup.inc.php2
4 files changed, 15 insertions, 2 deletions
diff --git a/inc/property.inc.php b/inc/property.inc.php
index 77d2b985..0aa1841e 100644
--- a/inc/property.inc.php
+++ b/inc/property.inc.php
@@ -45,7 +45,7 @@ class Property
. " ON DUPLICATE KEY UPDATE value = VALUES(value), dateline = VALUES(dateline)", array(
'key' => $key,
'value' => $value,
- 'dateline' => time() + ($minage * 60)
+ 'dateline' => ($minage === 0 ? 0 : time() + ($minage * 60))
));
if (self::$cache !== false) {
self::$cache[$key] = $value;
@@ -139,4 +139,14 @@ class Property
self::set('vmstore-config', json_encode($value));
}
+ public static function getDownloadTask($name)
+ {
+ return self::get('dl-' . $name);
+ }
+
+ public static function setDownloadTask($name, $taskId)
+ {
+ self::set('dl-' . $name, $taskId, 5);
+ }
+
}
diff --git a/inc/trigger.inc.php b/inc/trigger.inc.php
index b7cc67cc..c22f8c5b 100644
--- a/inc/trigger.inc.php
+++ b/inc/trigger.inc.php
@@ -67,7 +67,7 @@ class Trigger
if ($storetype === 'nfs') $addr = $vmstore['nfsaddr'];
if ($storetype === 'cifs') $addr = $vmstore['cifsaddr'];
if ($storetype === 'internal') $addr = 'none';
- $this->mountTask = Taskmanager::submit('MountVmStore', array(
+ return Taskmanager::submit('MountVmStore', array(
'address' => $addr,
'type' => 'images',
'username' => $vmstore['cifsuser'],
diff --git a/modules/minilinux.inc.php b/modules/minilinux.inc.php
index f3fb6dce..78535ba6 100644
--- a/modules/minilinux.inc.php
+++ b/modules/minilinux.inc.php
@@ -39,6 +39,7 @@ class Page_MiniLinux extends Page
$local = CONFIG_HTTP_DIR . '/' . $system['id'] . '/' . $file['name'];
if (!file_exists($local) || filesize($local) !== $file['size'] || md5_file($local) !== substr($file['md5'], 0, 32)) {
$file['changed'] = true;
+ $file['taskid'] = Property::getDownloadTask($file['md5']);
}
}
}
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')