diff options
author | Simon Rettberg | 2014-05-26 22:49:54 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-05-26 22:49:54 +0200 |
commit | a4f4147b6fe5f2a003a61cf8a8f7508c94130b31 (patch) | |
tree | de34472a2b9bd83909469affb884619b4858efc1 /apis | |
parent | WIP (diff) | |
download | slx-admin-a4f4147b6fe5f2a003a61cf8a8f7508c94130b31.tar.gz slx-admin-a4f4147b6fe5f2a003a61cf8a8f7508c94130b31.tar.xz slx-admin-a4f4147b6fe5f2a003a61cf8a8f7508c94130b31.zip |
WIP
Diffstat (limited to 'apis')
-rw-r--r-- | apis/getconfig.inc.php | 17 | ||||
-rw-r--r-- | apis/init.inc.php | 7 | ||||
-rw-r--r-- | apis/taskmanager.inc.php | 10 |
3 files changed, 31 insertions, 3 deletions
diff --git a/apis/getconfig.inc.php b/apis/getconfig.inc.php index 1e7a4f53..f29118c8 100644 --- a/apis/getconfig.inc.php +++ b/apis/getconfig.inc.php @@ -1,5 +1,7 @@ <?php +require_once 'inc/property.inc.php'; + // Dump config from DB $res = Database::simpleQuery('SELECT setting.setting, setting.defaultvalue, setting.permissions, setting.description, tbl.value FROM setting @@ -12,3 +14,18 @@ while ($row = $res->fetch(PDO::FETCH_ASSOC)) { // Additional "intelligent" config echo "SLX_REMOTE_LOG='http://${_SERVER['SERVER_ADDR']}/slxadmin/api.php?do=clientlog'\n"; +$vmstore = Property::getVmStoreConfig(); + +if (is_array($vmstore)) { + switch ($vmstore['storetype']) { + case 'internal'; + echo "SLX_VM_NFS='{$_SERVER['SERVER_ADDR']}:/srv/openslx/nfs'\n"; + break; + case 'nfs'; + echo "SLX_VM_NFS='{$vmstore['nfsaddr']}'\n"; + break; + case 'cifs'; + echo "SLX_VM_NFS='{$vmstore['cifsaddr']}'\n"; + break; + } +} diff --git a/apis/init.inc.php b/apis/init.inc.php new file mode 100644 index 00000000..cdd6ac05 --- /dev/null +++ b/apis/init.inc.php @@ -0,0 +1,7 @@ +<?php + +if ($_SERVER['REMOTE_ADDR'] !== '127.0.0.1') + exit(0); + +Trigger::ldadp(); +Trigger::mount(); diff --git a/apis/taskmanager.inc.php b/apis/taskmanager.inc.php index 78cd101c..7bb38a98 100644 --- a/apis/taskmanager.inc.php +++ b/apis/taskmanager.inc.php @@ -16,11 +16,15 @@ foreach ($_POST['ids'] as $id) { } $return[] = $status; // HACK HACK - should be pluggable - if (isset($status['statusCode']) && $status['statusCode'] === TASK_FINISHED - && $status['id'] === Property::getIPxeTaskId() && Property::getServerIp() !== Property::getIPxeIp()) { + if (isset($status['statusCode']) && $status['statusCode'] === TASK_FINISHED // iPXE Update + && $id === Property::getIPxeTaskId() && Property::getServerIp() !== Property::getIPxeIp()) { Property::setIPxeIp(Property::getServerIp()); } - // + if (isset($status['statusCode']) && $status['statusCode'] === TASK_FINISHED // MiniLinux Version check + && $id === Property::getVersionCheckTaskId()) { + Property::setVersionCheckInformation(Property::getServerIp()); + } + // -- END HACKS -- if (!isset($status['statusCode']) || ($status['statusCode'] !== TASK_WAITING && $status['statusCode'] !== TASK_PROCESSING)) { Taskmanager::release($id); } |