From 5f0a2054f48d19257383850ddd5f3814e21f5e32 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Wed, 12 Sep 2012 13:06:57 +0000 Subject: list files for rejected status (log files layout is inconsistent across various statuses) --- log_files.php | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'log_files.php') diff --git a/log_files.php b/log_files.php index 4c301cf..7f33a9e 100644 --- a/log_files.php +++ b/log_files.php @@ -28,24 +28,43 @@ $path = realpath($upload_dir . $key); $job = explode('/', $key); $job = end($job); -if (!is_dir($path)) { +if (false !== strpos($key, 'rejected')) { + $valid = file_exists($path); + $type = 'rejected'; + $job = str_replace('.youri', '', $job); + $path = str_replace('.youri', '', $path); +} else { + $valid = is_dir($path); + $type = 'regular'; +} + +if (!$valid) { header('Status: 404 Not Found'); header('HTTP/1.0 404 Not Found'); die('Sorry, not found'); } -$list = glob_recursive_tree($path . '/*'); +$list = array(); + +if ($type == 'rejected') { + + $list = glob($path . '.*'); -$others = array( - '.youri', - '_i586.done', - '_x86_64.done' -); +} else { -foreach ($others as $suffix) { - $f = $path . $suffix; - if (file_exists($f)) { - $list[] = $f; + $list = glob_recursive_tree($path . '/*'); + + $others = array( + '.youri', + '_i586.done', + '_x86_64.done' + ); + + foreach ($others as $suffix) { + $f = $path . $suffix; + if (file_exists($f)) { + $list[] = $f; + } } } -- cgit v1.2.1