summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules-available/remoteaccess/inc/remoteaccess.inc.php7
-rw-r--r--modules-available/remoteaccess/page.inc.php6
2 files changed, 3 insertions, 10 deletions
diff --git a/modules-available/remoteaccess/inc/remoteaccess.inc.php b/modules-available/remoteaccess/inc/remoteaccess.inc.php
index 1dbe02c3..fc719b37 100644
--- a/modules-available/remoteaccess/inc/remoteaccess.inc.php
+++ b/modules-available/remoteaccess/inc/remoteaccess.inc.php
@@ -34,7 +34,8 @@ class RemoteAccess
$active = Database::queryFirst("SELECT Count(*) AS cnt FROM machine m
INNER JOIN remoteaccess_machine rm USING (machineuuid)
WHERE m.locationid IN ($locs) AND m.state = 'IDLE'");
- $wantNum = $row['wolcount'] - (isset($active['cnt']) ? $active['cnt'] : 0);
+ $active = (isset($active['cnt']) ? $active['cnt'] : 0);
+ $wantNum = $row['wolcount'] - $active;
if ($wantNum <= 0)
continue;
self::tryWakeMachines($locs, $wantNum);
@@ -59,11 +60,9 @@ class RemoteAccess
}
if (empty($list))
break; // No more clients in this location
- error_log('Trying to wake ' . count($list) . " in $locs");
RebootControl::wakeMachines($list, $fails);
$num -= count($list) - count($fails);
if (!empty($fails)) {
- error_log(count($fails) . ' failed');
$failIds = ArrayUtil::flattenByKey($fails, 'machineuuid');
// Reduce time so they won't be marked as wol_in_progress
Database::exec('UPDATE remoteaccess_machine SET woltime = :faketime WHERE machineuuid IN (:fails)',
@@ -71,7 +70,7 @@ class RemoteAccess
}
}
if ($num > 0) {
- error_log("Could not wake $num clients...");
+ error_log("Could not wake $num clients in ($locs)...");
}
}
diff --git a/modules-available/remoteaccess/page.inc.php b/modules-available/remoteaccess/page.inc.php
index 27b7ca6b..68781ffa 100644
--- a/modules-available/remoteaccess/page.inc.php
+++ b/modules-available/remoteaccess/page.inc.php
@@ -1,11 +1,5 @@
<?php
-/*
- * TODO TODO TODO TODO
- * ### PERMISSIONS ###
- * TODO TODO TODO TODO
- */
-
class Page_RemoteAccess extends Page
{