1<?php
2
3require_once 'common.php';
4
5function log_handle_ajax() {
6    global $AJAX_JSON;
7    global $ID;
8    $ID = cleanID($_POST['id']);
9    if (isset($_POST['maxcount'])) {
10        $maxcount = (int) $_POST['maxcount'];
11    } else {
12        $maxcount = 5;
13    }
14    try {
15        log_add_log_entry(new action_plugin_log);
16    } catch (Exception $e) {
17        header('HTTP/1.0 500 Internal Server Error');
18        echo $e->getMessage();
19        return;
20    }
21
22    $info = array();
23    echo p_render('xhtml', p_get_instructions('{{log>' . $maxcount . '}}'), $info);
24}
25
26log_handle_ajax();
27