Ejemplo n.º 1
0
$cmd = new Cmd();
if (@$_POST['a'] == 'getstatus') {
    include_once 'engine/users.engine.php';
    $users = new Users();
    $users->getAllStatut();
}
if (@$_POST['a'] == 'updatestatus' && is_numeric(@$_POST['s'])) {
    include_once 'engine/users.engine.php';
    $users = new Users();
    $users->updateStatut(@$_POST['s']);
}
if (@$_POST['a'] == 'getnewshout' && is_numeric(@$_POST['i'])) {
    $new_count = count($database->getAllShout());
    $lastest = $new_count - @$_POST['i'];
    if ($lastest <= 0) {
        $lastest = 0;
        echo '-1';
    } else {
        echo $shoutbox->getLastShout($lastest);
    }
}
if (@$_POST['a'] == 'postnewshout' && @$_POST['m'] != "") {
    $message = trim(htmlspecialchars(@$_POST['m']));
    echo $shoutbox->postShout($message);
}
if (@$_GET['a'] == 'getUsage') {
    $cpu = $cmd->CPUutilization();
    $ram = $cmd->RAMutilization();
    $bandwidth = $cmd->bandwithUsage();
    echo $cpu . ' ' . $ram . ' ' . $bandwidth;
}