summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-09-05 18:19:22 +0000
committerRomain d'Alverny <rda@mageia.org>2012-09-05 18:19:22 +0000
commitb6d042a0ccb3b3d8c7bd36a0b38483f15fe940c9 (patch)
treea1bafd64ceba1726f79f7b95634c6012832ecddb
parent0c1377115e3c6e64b866bdf0cb72ee72b67ec8d1 (diff)
downloadpkgsubmit-b6d042a0ccb3b3d8c7bd36a0b38483f15fe940c9.tar
pkgsubmit-b6d042a0ccb3b3d8c7bd36a0b38483f15fe940c9.tar.gz
pkgsubmit-b6d042a0ccb3b3d8c7bd36a0b38483f15fe940c9.tar.bz2
pkgsubmit-b6d042a0ccb3b3d8c7bd36a0b38483f15fe940c9.tar.xz
pkgsubmit-b6d042a0ccb3b3d8c7bd36a0b38483f15fe940c9.zip
fix check of $typelink, relative to upload dir; explicit Web app own path.
-rw-r--r--conf.php3
-rw-r--r--test_index.php15
2 files changed, 9 insertions, 9 deletions
diff --git a/conf.php b/conf.php
index b8fd708..a644ed8 100644
--- a/conf.php
+++ b/conf.php
@@ -18,6 +18,9 @@
*
*/
+/** Where is the current app located. */
+$g_webapp_dir = '/var/www/bs';
+
/** Full system path where packages are uploaded. */
$upload_dir = '/var/lib/schedbot/uploads';
diff --git a/test_index.php b/test_index.php
index 55ee644..f96f3ed 100644
--- a/test_index.php
+++ b/test_index.php
@@ -201,7 +201,6 @@ $tmpl = <<<T
T;
if ($total > 0) {
- echo getcwd();
foreach ($pkgs as $key => $p) {
if (trim($p['package']) == '') {
continue;
@@ -220,16 +219,14 @@ if ($total > 0) {
$typelink = '';
if ($p['type'] == 'failure') {
- $typelink = '/uploads/' . $p['type'] . '/' . $p['path'];
+ $typelink = '/uploads/' . $p['type'] . '/' . $p['path'];
} elseif ($p['type'] == 'rejected') {
- $typelink = '/uploads/' . $p['type'] . '/' . $p['path'] . '.youri';
+ $typelink = '/uploads/' . $p['type'] . '/' . $p['path'] . '.youri';
} else {
- $typelink = '/uploads/done/' . $p['path'];
- echo ".$typelink", ' = ', print_r(is_dir(".$typelink"), true), '<br>';
-
- if (!is_dir(".$typelink")) {
- $typelink = '';
- }
+ $typelink = '/uploads/done/' . $p['path'];
+ if (!is_dir(realpath($upload_dir . '/..' . $typelink))) {
+ $typelink = '';
+ }
}
$typestr = $p['type'];
if ($p['status']['build']) {