source: spip-zone/_plugins_/_stable_/console/console.html @ 16373

Last change on this file since 16373 was 16373, checked in by booz@…, 13 years ago

censure de l'auto log et integration nulle dans l'admin

File size: 888 bytes
Line 
1#CACHE{0}
2#HTTP_HEADER{Content-Type: text/html}
3<?php
4
5if(!($auteur_session['statut'] == "0minirezo")) {echo "reservé aux admins"; return ;}
6
7function console_lit_log($logname = "#ENV{log}"){
8        $files = preg_files(defined('_DIR_TMP')?_DIR_TMP:_DIR_SESSION ,"$logname\.log(\.[0-9])?");
9        krsort($files);
10
11        $log = "";
12        foreach($files as $nom){
13                if (lire_fichier($nom,$contenu))
14                        $log.=$contenu;
15        }
16        $contenu = explode("<br />",nl2br($contenu));
17       
18        $out = "";
19        $maxlines = 40;
20        while ($contenu && $maxlines--){
21                $hop = array_pop($contenu) ;
22                if(preg_match(",page='console',", $hop)) continue ;
23                if (preg_match_all("/.{100}/UmsS", $hop, $longs, PREG_SET_ORDER)) {
24                foreach ($longs as $long) {
25                    $hop = str_replace($long[0], $long[0].'<br>', $hop);
26                }
27            }
28               
29                $out .= $hop."\n";
30        }
31        return $out;
32}
33
34
35echo "<pre>";
36echo console_lit_log();
37echo "</pre>";
38?>
Note: See TracBrowser for help on using the repository browser.