summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-25 22:03:25 +0100
committerSimon Rettberg2019-03-25 22:03:25 +0100
commita3f4485b329db673b679b0470c61a80fe8a717de (patch)
treeec72dc69d457c855fa1e7f74f93dc2ab5fff3768
parent[serversetup-bwlp-ipxe] Don't compile iPXE if serverip is invalid (diff)
downloadslx-admin-a3f4485b329db673b679b0470c61a80fe8a717de.tar.gz
slx-admin-a3f4485b329db673b679b0470c61a80fe8a717de.tar.xz
slx-admin-a3f4485b329db673b679b0470c61a80fe8a717de.zip
[inc/Trigger] Fix Trigger::ipxe() when called multiple times
If during one execution we end up in Trigger::ipxe multiple times, we wouldn't execute any hooks because of include_once. This should be OK however, so instead of changing it to include, just remember the $taskId and return it later.
-rw-r--r--inc/trigger.inc.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/trigger.inc.php b/inc/trigger.inc.php
index cc603719..988b31c6 100644
--- a/inc/trigger.inc.php
+++ b/inc/trigger.inc.php
@@ -21,7 +21,7 @@ class Trigger
public static function ipxe()
{
$hooks = Hook::load('ipxe-update');
- $taskId = false;
+ static $taskId = false;
foreach ($hooks as $hook) {
$ret = function($taskId) use ($hook) {
$ret = include_once($hook->file);