Esempio n. 1
0
function display_log_list()
{
    global $lang_viewlog_php;
    $log_list = getloglist('logs/');
    if (count($log_list) > 0) {
        foreach ($log_list as $log) {
            echo <<<EOT
\t\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t\t\t<td class="tableb">
\t\t\t\t\t\t\t\t\t\t\t\t<img src="images/folder.gif" alt="" />&nbsp;<a href= "{$_SERVER['PHP_SELF']}?log={$log['logname']}">{$log['logname']}</a>
\t\t\t\t\t\t\t\t\t\t\t\t&nbsp;&nbsp;&nbsp; ( <i>{$log['filesize']} KB</i> )
\t\t\t\t\t\t\t\t\t\t</td>
\t\t\t\t\t\t\t\t</tr>
EOT;
        }
        echo <<<EOT
\t\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t\t\t<td class="tableb" align="center">
\t\t\t\t\t\t\t\t\t\t\t\t<input class="button" type="button" value="{$lang_viewlog_php['delete_all']}" name="dall" id="dall" onclick="window.location='viewlog.php?action=dall';" />
\t\t\t\t\t\t\t\t\t\t</td>
\t\t\t\t\t\t\t\t</tr>
EOT;
    } else {
        cpg_die(INFORMATION, $lang_viewlog_php['no_logs'], __FILE__, 1);
    }
}
Esempio n. 2
0
function display_log_list()
{
    global $lang_viewlog_php, $folder_icon, $delete_all_icon, $delete_this_icon, $view_icon, $lang_date;
    $log_list = getloglist('logs/');
    if (count($log_list) > 0) {
        foreach ($log_list as $log) {
            $mtime = localised_date($log['mtime'], $lang_date['log']);
            $filesize = cpg_format_bytes($log['filesize']);
            echo <<<EOT
                            <tr>
                                    <td class="tableb">
                                            {$folder_icon}&nbsp;<a href= "viewlog.php?log={$log['logname']}">{$log['logname']}</a>
                                            &nbsp;&nbsp;&nbsp; ( <em>{$filesize}</em>, {$lang_viewlog_php['last_updated']}: <em>{$mtime}</em>)
                                    </td>
                            </tr>
EOT;
        }
        echo <<<EOT
                                <tr>
                                        <td class="tableb" align="center">
                                                <button type="button" class="button" name="dall" value="{$lang_viewlog_php['delete_all']}" id="dall" onclick="window.location='viewlog.php?action=dall';">{$delete_all_icon}{$lang_viewlog_php['delete_all']}</button>
                                        </td>
                                </tr>
EOT;
    } else {
        cpg_die(INFORMATION, $lang_viewlog_php['no_logs'], __FILE__, __LINE__);
    }
}
Esempio n. 3
0
function log_delete($log = null)
{
    if (is_null($log)) {
        $log_list = getloglist('logs/');
        foreach ($log_list as $log) {
            unlink('logs/' . $log['filename']);
        }
    } else {
        unlink('logs/' . $log . '.log.php');
    }
    header('Location: viewlog.php');
}