get_session(); $request = http_request::getInstance(); $parm = $request->get_parms('fil', 'id', 'clr'); ?>
get_registry(); $logdir = p4string::addEndSlash($registry->get('GV_RootPath') . 'logs'); $name = str_replace('..', '', $parm['fil']); $rname = $name; if ($parm['id']) { $rname .= '_' . $parm['id']; } $rname = '/' . $rname . '((\.log)|(-.*\.log))$/'; $finder = new Finder(); $finder ->files()->name($rname) ->in($logdir) ->date('> now - 1 days') ->sortByModifiedTime() ->sort(function($a, $b) { return -1; }); $found = false; foreach ($finder->getIterator() as $file) { if ($parm['clr'] == $file->getFilename()) { file_put_contents($file->getRealPath(), ''); $found = true; } } if ($found) { return phrasea::redirect(sprintf("/admin/showlogtask.php?fil=%s&id=%s" , urlencode($parm['fil']) , urlencode($parm['id'])) ); } $found = false; foreach ($finder->getIterator() as $file) { { printf("\n"); print(htmlentities(file_get_contents($file->getRealPath()))); print("\n"); } $found = true; } if ( ! $found) { printf("