Changeset 15283 for trunk/FACT++


Ignore:
Timestamp:
04/08/13 20:14:24 (12 years ago)
Author:
tbretz
Message:
Show the log according to the link in /users/fact/operation if no path is given.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/showlog.php

    r15189 r15283  
    311311unset($_GET['refresh']);
    312312
    313 $name = empty($_GET['log']) ? "dimserver.log" : $_GET['log'].".log";
    314 $dir  = empty($_GET['dir']) ? "FACT++"        : $_GET['dir'];
    315 
    316 if (!strpos($name, "/")===false || !strpos($dir, "/")===false)
     313$prg = empty($_GET['log']) ? "dimserver" : $_GET['log'];
     314$dir = $_GET['dir'];
     315
     316if (!strpos($prg, "/")===false || !strpos($dir, "/")===false)
    317317    return header('HTTP/1.0 403 Access forbidden.');
    318318
    319 $filename = "/users/fact/".$dir."/".$name;
     319if (empty($dir))
     320{
     321    if ($prg=="schedule")
     322        $prg = "scripts/schedule.js";
     323
     324    $filename = "/users/fact/operation/".$prg;
     325    if (is_link($filename))
     326        $filename = "/users/fact/operation/".dirname(readlink($filename))."/".$prg.".log";
     327}
     328
     329if (empty($filename))
     330    $filename = "/users/fact/".$dir."/".$prg.".log";
    320331
    321332$size = filesize($filename);
     
    337348    array_splice($file, $pos+1, $n-$max);
    338349}
     350
     351$dir  = basename(dirname($filename));
     352$name = basename($filename);
    339353
    340354?>
Note: See TracChangeset for help on using the changeset viewer.