Example #1
0
function search_node($addr, $last = null, $ips = '', $port = 7903)
{
    global $ctx, $list;
    foreach ($addr as $key => $value) {
        if (@inet_pton($value) === FALSE) {
            continue;
        }
        $ips = remove_ip(@file_get_contents("http://{$value}:{$port}/peer_addresses", 0, $ctx)) . " " . $ips;
    }
    if ($last != null) {
        $ips = $list . " " . $ips;
    }
    return $ips;
}
Example #2
0
    echo "<tr bgcolor=#" . $cTheme->table_headcolor . "><td><font color=#" . $cTheme->table_headtextcolor . ">Time</font></td><td><font color=#" . $cTheme->table_headtextcolor . ">Event</font></td><td><font color=#" . $cTheme->table_headtextcolor . ">Message</font></td></tr>";
    if (pg_numrows($logs) != 0) {
        if (pg_numrows($logs) >= 5) {
            $max = 5;
        } else {
            $max = pg_numrows($logs);
        }
        for ($row = 0; $row < $max; $row++) {
            $log = pg_fetch_object($logs, $row);
            echo "<tr><td>";
            echo cs_time($log->ts) . " [" . $log->ts . "]</td><td>";
            if ($log->event > count($user_events) || $log->event == 0) {
                echo "(old)</td><td>";
            } else {
                echo $type[$log->event] . "</td><td>";
            }
            if ($admin < SHOW_IP_LEVEL) {
                echo htmlentities(remove_ip($log->message, 2)) . "</td></tr>\n";
            } else {
                echo htmlentities($log->message) . "</td></tr>\n";
            }
        }
        echo "</table>";
    } else {
        echo "There are no log messages for this user\n<br><br>";
    }
}
?>
</body>
</html>
Example #3
0
<!-- $Id: weirdos.php,v 1.7 2005/11/18 04:19:33 nighty Exp $ //-->
<h1>Interesting Channel Events (last 14 days)</h1><h3>
<a href="index.php">Back</a></h3>
<hr>
<?php 
$type = $channel_events;
$res = pg_safe_exec("select " . " channels.name as channel_name, " . " channellog.ts as ts, " . " channellog.channelid as id, " . " channellog.event as event, " . " channellog.message as messages " . "from " . " channels, " . " channellog " . "where " . " channels.id=channellog.channelid " . "and (" . " channellog.event = 4 " . "or " . " channellog.event = 5 " . "or " . " channellog.event = 6 " . "or " . " channellog.event = 9 " . "or " . " channellog.event = 10 " . ") and " . " channellog.ts > now()::abstime::int4-(14*24*60*60) " . "order by channellog.ts desc");
if (pg_numrows($res) < 1) {
    echo "Nothing of interest has happened recently";
    exit;
}
echo "<table bgcolor=#" . $cTheme->table_bgcolor . " border=1 cellpadding=3 cellspacing=0>\n";
echo "<tr bgcolor=#" . $cTheme->table_headcolor . "><th><font color=#" . $cTheme->table_headtextcolor . ">TS</font></th><th><font color=#" . $cTheme->table_headtextcolor . ">Channel</font></th><th><font color=#" . $cTheme->table_headtextcolor . ">Event</font></th><th><font color=#" . $cTheme->table_headtextcolor . ">Message</font></th></tr>\n";
for ($i = 0; $i < pg_numrows($res); $i++) {
    $row = pg_fetch_object($res, $i);
    $e_name = $type[$row->event];
    if ($e_name == "") {
        $e_name = "Event #" . $row->event;
    }
    echo "<tr><td>" . cs_time($row->ts) . "</td><td><a href=\"../channels.php?id=" . $row->id . "\" target=_blank>" . $row->channel_name . "</a></td>" . "<td>" . $e_name . "</td>";
    if ($admin < SHOW_IP_LEVEL) {
        echo "<td>" . htmlentities(remove_ip($row->messages, 2)) . "</td>";
    } else {
        echo "<td>" . htmlentities($row->messages) . "</td>";
    }
    echo "</tr>\n";
}
echo "</table>";
?>
</body></html>
        echo "<tr><td colspan=5 align=center><font color=#" . $cTheme->table_headcolor . " size=+1><b>No 'AdminLog' entry found.</b></font></td></tr>";
    } else {
        echo "<tr><td colspan=5 align=center><font color=#" . $cTheme->table_headcolor . " size=+1><b>Showing " . pg_numrows($adminlogs) . " records.</b></font></td></tr>";
        echo "<tr bgcolor=#" . $cTheme->table_headcolor . ">";
        echo "<td><font color=#" . $cTheme->table_headtextcolor . ">Time</font></td>";
        echo "<td><font color=#" . $cTheme->table_headtextcolor . ">Username</font></td>";
        echo "<td><font color=#" . $cTheme->table_headtextcolor . ">Command</font></td>";
        echo "<td><font color=#" . $cTheme->table_headtextcolor . ">Arguments</font></td>";
        echo "<td><font color=#" . $cTheme->table_headtextcolor . ">Issued by</font></td>";
        echo "</tr>";
        for ($row = 0; $row < pg_numrows($adminlogs); $row++) {
            $log = pg_fetch_object($adminlogs, $row);
            echo "<tr><td>";
            echo cs_time($log->ts) . " [" . $log->ts . "]</td><td>";
            echo htmlentities($log->user_name) . "</td><td>\n";
            echo htmlentities($log->cmd) . "</td><td>\n";
            echo htmlentities($log->args) . "</td><td>\n";
            if ($admin < SHOW_IP_LEVEL) {
                echo htmlentities(remove_ip($log->issue_by)) . "</td></tr>\n";
            } else {
                echo htmlentities($log->issue_by) . "</td></tr>\n";
            }
        }
    }
} else {
    echo "<tr><td align=center><font color=#" . $cTheme->table_headcolor . " size=+1><b>Choosen date is invalid or period end is before start.</b></font></td></tr>\n";
}
echo "</table>";
?>
</body></html>