From ee27ec0d2bc44fece8b438a4ea58ac956198d300 Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Sat, 24 May 2014 18:42:23 +0200
Subject: WIP
---
inc/configmodule.inc.php | 3 ++-
inc/message.inc.php | 2 +-
inc/property.inc.php | 10 ++++++++++
inc/trigger.inc.php | 8 ++++----
4 files changed, 17 insertions(+), 6 deletions(-)
(limited to 'inc')
diff --git a/inc/configmodule.inc.php b/inc/configmodule.inc.php
index 55f76cf3..e9fa40bb 100644
--- a/inc/configmodule.inc.php
+++ b/inc/configmodule.inc.php
@@ -3,7 +3,7 @@
class ConfigModule
{
- public static function insertAdConfig($title, $server, $searchbase, $binddn, $bindpw)
+ public static function insertAdConfig($title, $server, $searchbase, $binddn, $bindpw, $home)
{
// TODO: Lock table, race condition if about 500 admins insert a config at the same time
Database::exec("INSERT INTO configtgz_module (title, moduletype, filepath, contents) "
@@ -31,6 +31,7 @@ class ConfigModule
'searchbase' => $searchbase,
'binddn' => $binddn,
'bindpw' => $bindpw,
+ 'home' => $home,
'proxyport' => $port
);
$data = json_encode($ownEntry);
diff --git a/inc/message.inc.php b/inc/message.inc.php
index 2ed9e79a..75292e09 100644
--- a/inc/message.inc.php
+++ b/inc/message.inc.php
@@ -31,7 +31,7 @@ $error_text = array(
'error-extract' => 'Konnte Archiv nicht nach {{0}} entpacken - {{1}}',
'module-added' => 'Modul erfolgreich hinzugefügt',
'module-deleted' => 'Modul {{0}} wurde gelöscht',
- 'module-in-use' => 'Modul {{0}} wird noch durch Konfiguration {{1}} verwendet',
+ 'module-in-use' => 'Modul {{0}} wird noch durch Konfiguration {{1}} verwendet',
'taskmanager-error' => 'Verbindung zum Taskmanager fehlgeschlagen',
'taskmanager-format' => 'Taskmanager hat ungültige Daten zurückgeliefert',
'task-error' => 'Ausführung fehlgeschlagen: {{0}}',
diff --git a/inc/property.inc.php b/inc/property.inc.php
index c6f3e8ad..d186193a 100644
--- a/inc/property.inc.php
+++ b/inc/property.inc.php
@@ -74,5 +74,15 @@ class Property
{
self::set('ipxe-task', $value);
}
+
+ public static function getBootMenu()
+ {
+ return json_decode(self::get('ipxe-menu'), true);
+ }
+
+ public static function setBootMenu($value)
+ {
+ self::set('ipxe-menu', json_encode($value));
+ }
}
diff --git a/inc/trigger.inc.php b/inc/trigger.inc.php
index 40d9c491..af12955f 100644
--- a/inc/trigger.inc.php
+++ b/inc/trigger.inc.php
@@ -25,12 +25,12 @@ class Trigger
$last = Property::getIPxeTaskId();
if ($last !== false) {
$status = Taskmanager::status($last);
- if (isset($status['statusCode']) && ($status['statusCode'] === TASK_WAITING || $status['statusCode'] === TASK_RUNNING))
+ if (isset($status['statusCode']) && ($status['statusCode'] === TASK_WAITING || $status['statusCode'] === TASK_PROCESSING))
return false; // Already compiling
}
- $task = Taskmanager::submit('CompileIPxe', array(
- 'ip' => Property::getServerIp()
- ));
+ $data = Property::getBootMenu();
+ $data['ip'] = Property::getServerIp();
+ $task = Taskmanager::submit('CompileIPxe', $data);
if (!isset($task['id']))
return false;
Property::setIPxeTaskId($task['id']);
--
cgit v1.2.3-55-g7522