diff options
author | Eudyptula <eitan@mosenkis.net> | 2009-07-24 11:09:15 -0400 |
---|---|---|
committer | Eudyptula <eitan@mosenkis.net> | 2009-07-24 11:09:15 -0400 |
commit | b006cfcdd1245105f9e22b104ca8527229b17ae4 (patch) | |
tree | 9e6f43bdb614bdd079c6da58392bd95633279cdd /frontend/pages/builds/log.php | |
parent | Clean up backend API (diff) | |
download | ingenue-b006cfcdd1245105f9e22b104ca8527229b17ae4.tar.gz ingenue-b006cfcdd1245105f9e22b104ca8527229b17ae4.tar.bz2 ingenue-b006cfcdd1245105f9e22b104ca8527229b17ae4.zip |
Broke log viewer into segments, added build deletion
Diffstat (limited to 'frontend/pages/builds/log.php')
-rw-r--r-- | frontend/pages/builds/log.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/frontend/pages/builds/log.php b/frontend/pages/builds/log.php new file mode 100644 index 0000000..ee652f3 --- /dev/null +++ b/frontend/pages/builds/log.php @@ -0,0 +1,29 @@ +<?php +function init_builds_log() { + global $S, $request; + $S['title']='Log Viewer'; + if (!isset($S['user'])) return 'login'; + if (!(isset($request['build']) && strlen($request['build']) == 6 && ctype_alnum($request['build']))) return '404'; + $r=$S['pdo']->query('SELECT * FROM `builds` WHERE `id`="'.$request['build'].'"'); + if ($r->rowCount()) { + $S['builds_log']=new sql_build($r->fetch(PDO::FETCH_ASSOC)); + if (!owner_or_admin($S['builds_log']->owner)) return '404'; // TODO permission denied + } else + return '404'; + if (isset($request['task']) && is_numeric($request['task'])) + return 'builds/task'; +} +function body_builds_log() { + global $S; + $build=&$S['builds_log']; + echo $build->display(); + $r=$S['pdo']->query('SELECT * FROM `tasks` WHERE `build`="'.$build->id.'" ORDER BY `order` ASC'); + if ($r->rowCount() == 0) { + echo '<b>No tasks found.</b>'; + } + while ($task=$r->fetch(PDO::FETCH_ASSOC)) { + $task=new sql_task($task); + echo $task->display(); + } +} +?> |