Merge pull request #196 from privatehosting/patch-1

Fix undefined offset if no entries are in the quotaused-array in cron-tasks
This commit is contained in:
Michael Kaufmann
2014-09-06 08:05:32 +02:00

View File

@@ -342,6 +342,9 @@ while ($row = $result_tasks_stmt->fetch(PDO::FETCH_ASSOC)) {
$usedquota = getFilesystemQuota(); $usedquota = getFilesystemQuota();
// Fixed: PHP Notice: Undefined offset
if(is_array($usedquota) && count($usedquota) > 0)
{
// Select all customers Froxlor knows about // Select all customers Froxlor knows about
$result_stmt = Database::query("SELECT `guid`, `loginname`, `diskspace` FROM `" . TABLE_PANEL_CUSTOMERS . "`;"); $result_stmt = Database::query("SELECT `guid`, `loginname`, `diskspace` FROM `" . TABLE_PANEL_CUSTOMERS . "`;");
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
@@ -373,6 +376,7 @@ while ($row = $result_tasks_stmt->fetch(PDO::FETCH_ASSOC)) {
} }
} }
} }
}
if ($num_results != 0) { if ($num_results != 0) {
$where = array(); $where = array();