diff --git a/runs.php b/runs.php index 1e6febc..e227484 100644 --- a/runs.php +++ b/runs.php @@ -3,7 +3,7 @@ /* * The MIT License * - * Copyright 2017 Jeroen De Meerleer . + * Copyright 2017-2018 Jeroen De Meerleer . * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,9 +34,9 @@ if ($jobnameResult[0]["user"] != $_SESSION["userID"]) { exit; } $jobName = $jobnameResult[0]['name']; -$rebootjob = $jobnameResult[0]['name'] ? true : false; +$rebootjob = $jobnameResult[0]['url'] == 'reboot' ? true : false; -$runsForJobQry = "SELECT runs.*, FROM runs, jobs WHERE runs.job = jobs.jobID AND runs.job = ?"; +$runsForJobQry = "SELECT runs.*, jobs.jobID FROM runs, jobs WHERE runs.job = jobs.jobID AND runs.job = ?"; $allruns = true; if(!(isset($_GET['allruns']) && $_GET['allruns'] == 1)) { $runsForJobQry .= " AND runs.statuscode <> jobs.expected"; @@ -49,9 +49,6 @@ $runsForJobResult = $runsForJob->fetchAll(PDO::FETCH_ASSOC); $loader = new Twig_Loader_Filesystem('templates'); $twig = new Twig_Environment($loader, array('cache' => 'cache', "debug" => true)); -//var_dump($alljobsResult); -//exit; - $runsForJobRendered = array();$count = 0; foreach($runsForJobResult as $key=>$value) { $runsForJobRendered[$count]["runID"] = $value["runID"]; diff --git a/webcron.php b/webcron.php index cd4131c..dd2f02e 100644 --- a/webcron.php +++ b/webcron.php @@ -46,7 +46,7 @@ if (file_exists("cache/get-services.trigger")) { $services = implode("\n", $services); $stmt = $db->prepare("INSERT INTO runs(job, statuscode, result, timestamp) VALUES(?, ?, ?, ?)"); - $stmt->execute(array($job['jobID'], '1', $services, time())); + $stmt->execute(array($job['jobID'], '0', $services, time())); } unlink("cache/get-services.trigger"); unlink("cache/reboot-time.trigger");