From f11576b2077d5d95a2d0dd59c523d655326eed0c Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 30 May 2007 12:16:43 +0000 Subject: create log links, support noexec --- it.class | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'it.class') diff --git a/it.class b/it.class index 04022e7..2258c7d 100644 --- a/it.class +++ b/it.class @@ -38,11 +38,18 @@ function log($name /* ... */) $line = date("Y-m-d H:i:s") . "\t" . implode("\t", array_slice($args, 1)) . "\n"; $fn = $GLOBALS['ULTRAHOME'] . "/log/$name-" . date('Ymd'); + $existed = file_exists($fn); + if ($fh = fopen($fn, "a")) { fputs($fh, $line); fclose($fh); - @chgrp($fn, "www"); + + if (!$existed) + { + @chgrp($fn, "www"); + @symlink($fn, $GLOBALS['ULTRAHOME'] . "/log/$name"); + } } } @@ -319,7 +326,7 @@ function exec(/* $cmd, $values1 = array(), ... */) it::log('exec', $cmd); - return (string)shell_exec($cmd); + return EDC('noexec') ? "" : (string)shell_exec($cmd); } function _exec_quotevalue($value) -- cgit v1.2.3