LoGD Standardrelease steht hier zum Download zur Verfügung!
<?php
/*
View faillogs and user mail
Find multi accounts and cheaters
22052004 by anpera
2021-06-05 aragon bugfix php8
*/
require_once("common.php");
require_once "lib/savebackup.php";
page_header("Logs und Mail");
addnav("G?Zurück zur Grotte", "superuser.php");
addnav("W?Zurück zum Weltlichen", "village.php");
addnav("Multilogs", "multilogs.php");
$op = $_GET['op'] ?? "";
$in = $_GET['in'] ?? "";
$ip = $_GET['ip'] ?? "";
$out = $_GET['out'] ?? "";
$act = $_GET['act'] ?? "";
$id = $_GET['id'] ?? 0;
$pw = ($_GET['pw'] ?? "") == "true";
$order = $_GET['order'] ?? "";
$details = $_GET['details'] ?? "";
$searchby = $_GET['searchby'] ?? "";
$id = $_GET["id"] ?? "";
$page = $_GET['limit'] ?? 0;
$limit = "";
if ($op == "faillog") {
if ($id) {
$ppp = 25; // Player Per Page to display
if (!$limit) {
$page = 0;
} else {
$page = (int)$limit;
addnav("Vorherige Seite", "logs.php?op=faillog&id=$id&limit=" . ($page - 1) . "&order=$sort&pw=$pw");
}
$limit = "" . ($page * $ppp) . "," . ($ppp + 1);
$sort = "date";
if ($order) {
$sort = $order;
}
$sql = "SELECT * FROM faillog WHERE acctid=$id ORDER BY $sort DESC LIMIT $limit";
$result = db_query($sql) or die(db_error(LINK));
output("Fehlgeschlagene Logins (" . ($page * $ppp) . "-" . ($page * $ppp + $ppp) . ") für ID $id`n`n");
if (db_num_rows($result) > $ppp) {
addnav("Nächste Seite", "logs.php?op=faillog&id=$id&limit=" . ($page + 1) . "&order=$sort&pw=$pw");
}
output("<table align='center'><tr><td>`b<a href='logs.php?op=faillog&id=$id&limit=$page&order=date'>Datum</a>`b</td><td>`b<a href='logs.php?op=faillog&id=$id&limit=$page&order=ip'>IP</a>`b</td>" . ($pw ? "<td>`bfalsches PW`b</td>" : "") . "</tr>", true);
addnav("", "logs.php?op=faillog&id=$id&limit=$page&order=date");
addnav("", "logs.php?op=faillog&id=$id&limit=$page&order=ip");
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
print_r($row);
if ($pw && $session['user']['superuser'] >= 3) {
$row['post'] = unserialize($row['post']);
}
print_r($row);
// output("<tr><td>$row['date']</td><td>$row['ip']</td>".($pw?"<td>".$row['post']['password']."</td>":"")."</tr>",true);
output("<tr><td>{$row['date']}</td><td>{$row['ip']}</td>" . ($pw ? "<td>" . $row['post'] . "</td>" : "") . "</tr>", true);
}
addnav("Zurück", "logs.php?op=faillog&order=$order");
output("</table>", true);
if ($session['user']['superuser'] >= 3) addnav("PWs " . ($pw ? "ausblenden" : "einblenden") . "", "logs.php?op=faillog&id=$id" . ($pw ? "" : "&pw=true") . "&order=$order&limit=$limit");
if ($pw && $i >= 3) output("`n`iDie Anzeige der falsch eingegebenen Passwörter dient dazu, um festzustellen, wo Passwörter geraten werden und wo nur ein Tippfehler vorliegt.`i");
} else if ($ip) {
$ppp = 25; // Player Per Page to display
if (!$limit) {
$page = 0;
} else {
$page = (int)$limit;
addnav("Vorherige Seite", "logs.php?op=faillog&ip=$ip&limit=" . ($page - 1) . "&pw=$pw");
}
$limit = "" . ($page * $ppp) . "," . ($ppp + 1);
$sql = "SELECT faillog.*,accounts.name AS absender FROM faillog LEFT JOIN accounts ON accounts.acctid=faillog.acctid WHERE ip='$ip' ORDER BY date DESC LIMIT $limit";
$result = db_query($sql) or die(db_error(LINK));
$begin = $page * $ppp;
$end = $page * $ppp + $ppp;
output("Fehlgeschlagene Logins (" . ($begin) . "-" . ($end) . ") von IP " . $ip . "`n`n");
if (db_num_rows($result) > $ppp) {
addnav("Nächste Seite", "logs.php?op=faillog&ip=$ip&limit=" . ($page + 1) . "&pw=$pw");
}
output("<table align='center'><tr><td>`bDatum`b</td><td>`bName`b</td>" . ($pw ? "<td>`bfalsches PW`b</td>" : "") . "</tr>", true);
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
if ($pw && $session['user']['superuser'] >= 3) {
$row['post'] = unserialize($row['post']);
}
// output("<tr><td>".$row['date']."</td><td>".$row['absender']."</td>".($pw?"<td>".$row['post']['password']."</td>":"")."</tr>",true);
output("<tr><td>" . $row['date'] . "</td><td>" . $row['absender'] . "</td>" . ($pw ? "<td>" . $row['post'] . "</td>" : "") . "</tr>", true);
}
addnav("Zurück", "logs.php?op=faillog&order=$order");
output("</table>", true);
if ($session['user']['superuser'] >= 3) {
addnav("PWs " . ($pw ? "ausblenden" : "einblenden") . "", "logs.php?op=faillog&ip=$ip" . ($pw ? "" : "&pw=true") . "&order=$order&limit=$limit");
}
if ($pw && $i >= 3) {
output("`n`iDie Anzeige der falsch eingegebenen Passwörter dient dazu, um festzustellen, wo Passwörter geraten werden und wo nur ein Tippfehler vorliegt.`i");
}
} else {
$ppp = 25; // Player Per Page to display
output("Fehlgeschlagene Logins (" . ($page * $ppp) . "-" . ($page * $ppp + $ppp) . ")`n`iSpielername oder IP anklicken, um alle Fehlversuche anzuzeigen.`i`n`n");
if (!$limit) {
$page = 0;
} else {
$page = (int)$limit;
addnav("Vorherige Seite", "logs.php?op=faillog&limit=" . ($page - 1) . "&order=$sort");
}
$limit = "" . ($page * $ppp) . "," . ($ppp + 1);
$sort = "date";
if ($order) {
$sort = $order;
}
$sql = "SELECT faillog.*,accounts.name AS absender FROM faillog LEFT JOIN accounts ON accounts.acctid=faillog.acctid WHERE 1 ORDER BY $sort DESC LIMIT $limit";
$result = db_query($sql) or die(db_error(LINK));
if (db_num_rows($result) > $ppp) {
addnav("Nächste Seite", "logs.php?op=faillog&limit=" . ($page + 1) . "&order=$sort");
}
output("<table align='center'><tr><td>`b<a href='logs.php?op=faillog&limit=$page&order=date'>Datum</a>`b</td><td>`b<a href='logs.php?op=faillog&limit=$page&order=acctid'>Acctid</a>`b</td><td>`bName`b</td><td>`b<a href='logs.php?op=faillog&limit=$page&order=ip'>IP</a>`b</td></tr>", true);
addnav("", "logs.php?op=faillog&limit=$page&order=date");
addnav("", "logs.php?op=faillog&limit=$page&order=acctid");
addnav("", "logs.php?op=faillog&limit=$page&order=ip");
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
output("<tr><td>{$row['date']}</td><td>{$row['acctid']}</td><td><a href='logs.php?op=faillog&id={$row['acctid']}&order=$sort'>{$row['absender']}</a></td><td><a href='logs.php?op=faillog&ip={$row['ip']}&order=$sort'>{$row['ip']}</a></td></tr>", true);
addnav("", "logs.php?op=faillog&id={$row['acctid']}&order=$sort");
addnav("", "logs.php?op=faillog&ip={$row['ip']}&order=$sort");
}
output("</table>", true);
addnav("Zurück", "logs.php");
}
} elseif ($op == 'multi') {
if (!empty($_POST['setupban']) && count($_POST['userid']) > 0) {
output("<form action='logs.php?op=multi&act=saveban&searchby=$searchby' method='POST'>", true);
if ($_POST['setupban'] == 'IPs bannen') {
$sql = 'SELECT lastip FROM accounts WHERE acctid IN ("' . implode('","', $_POST['userid']) . '") GROUP BY lastip';
$result = db_query($sql);
$ips = array();
while ($row = db_fetch_assoc($result)) $ips[] = $row['lastip'];
output('Sperre für die IP ' . implode(', ', $ips) . '`n');
output('<input type="hidden" name="type" value="ip"><input type="hidden" name="ip" value="' . implode('|', $ips) . '">', true);
} else {
$sql = 'SELECT uniqueid FROM accounts WHERE acctid IN ("' . implode('","', $_POST['userid']) . '") GROUP BY uniqueid';
$result = db_query($sql);
$ids = array();
while ($row = db_fetch_assoc($result)) $ids[] = $row['uniqueid'];
output('Sperre für die ID ' . implode(', ', $ids) . '`n');
output('<input type="hidden" name="type" value="id"><input type="hidden" name="id" value="' . implode('|', $ids) . '">', true);
}
output("Dauer: <input name='duration' id='duration' size='3' value='14'> days (0 for permanent)`n", true);
output("Grund für die Verbannung: <input name='reason' value=\"Ärger mich nicht.\">`n", true);
output("<input type='submit' class='button' value='Post Ban' onClick='if (document.getElementById(\"duration\").value==0) {return confirm(\"Willst du wirklich eine permanente Verbannung aussprechen?\");} else {return true;}'></form>", true);
addnav("", "logs.php?op=multi&act=saveban&searchby=$searchby");
} elseif ($act == 'saveban') {
if ($_POST['type'] == 'ip') $vals = explode('|', $_POST['ip']);
else $vals = explode('|', $_POST['id']);
foreach ($vals as $tihs) {
$sql = "INSERT INTO bans (";
if ($_POST['type'] == "ip") {
$sql .= "ipfilter";
} else {
$sql .= "uniqueid";
}
$sql .= ",banexpire,banreason) VALUES (";
$sql .= "\"$tihs\"";
$sql .= ",\"" . ((int)$_POST['duration'] == 0 ? "0000-00-00" : date("Y-m-d", strtotime("+{$_POST['duration']} days"))) . "\",";
$sql .= "\"{$_POST['reason']}\")";
if ($_POST['type'] == "ip") {
if (substr($_SERVER['REMOTE_ADDR'], 0, strlen($tihs)) == $tihs) {
$sql = "";
output("Du willst dich doch nicht wirklich selbst verbannen, oder?? Das ist deine eigene IP-Adresse!");
}
} else {
if ($_COOKIE['lgi'] == $tihs) {
$sql = "";
output("Du willst dich doch nicht wirklich selbst verbannen, oder?? Das ist deine eigene ID!");
}
}
if ($sql != "") {
db_query($sql) or die(db_error(LINK));
output(db_affected_rows() . " Bann eingetragen.`n`n");
output(db_error(LINK));
adminlog();
}
}
output('`n');
} elseif (!empty($_POST['deleteuser']) && count($_POST['userid']) > 0) {
$sql = "SELECT name FROM accounts WHERE acctid IN (" . implode(',', $_POST['userid']) . ")";
$result = db_query($sql) or die(sql_error($sql));
$delnames = array();
while ($row = db_fetch_assoc($result)) {
$delnames[] = '`$' . $row['name'] . '`0';
}
output('User ' . implode(', ', $delnames) . ' löschen? ');
output("`n`n`c`b-- <a href='logs.php?op=multi&act=dodeleteuser&searchby=" . $searchby . "&userid=" . implode(',', $_POST['userid']) . "'>Löschen bestätigen</a>--`b`c`n`n`n", true);
addnav('', 'logs.php?op=multi&act=dodeleteuser&searchby=' . $searchby . '&userid=' . implode(',', $_POST['userid']));
} elseif ($act == 'dodeleteuser') {
$userid = explode(',', $_GET['userid']);
foreach ($userid as $tihs) {
$sql = "SELECT name from accounts WHERE acctid='{$tihs}'";
$res = db_query($sql);
// inventar und haus löschen und partner und ei freigeben
if ($tihs == getsetting("hasegg", 0)) savesetting("hasegg", "0");
$sql = "UPDATE items SET owner=0 WHERE owner=$tihs";
db_query($sql);
$sql = "UPDATE houses SET owner=0,status=3 WHERE owner=$tihs AND status=1";
db_query($sql);
$sql = "UPDATE houses SET owner=0,status=4 WHERE owner=$tihs AND status=0";
db_query($sql);
$sql = "UPDATE accounts SET charisma=0,marriedto=0 WHERE marriedto=$tihs";
db_query($sql);
$sql = "DELETE FROM pvp WHERE acctid2=$tihs OR acctid1=$tihs";
db_query($sql) or die(db_error(LINK));
$sql = "DELETE FROM accounts WHERE acctid='$tihs'";
savebackup($tihs); // *** save backup inb4 delete
db_query($sql);
output(db_affected_rows() . " Benutzer gelöscht.`n");
}
adminlog();
output('`n');
} else output('`n');
$in_ip = $in_id = '';
if ($searchby != 'id') {
$sql = 'SELECT lastip FROM accounts WHERE lastip!="" GROUP BY lastip HAVING COUNT(*) > 1';
$result = db_query($sql) or die(db_error(LINK));
while ($row = db_fetch_assoc($result)) {
$in_ip .= ',"' . $row['lastip'] . '"';
}
}
if ($searchby != 'ip') {
$sql = 'SELECT uniqueid FROM accounts WHERE uniqueid!="" GROUP BY uniqueid HAVING COUNT(*) > 1';
$result = db_query($sql) or die(db_error(LINK));
while ($row = db_fetch_assoc($result)) {
$in_id .= ',"' . $row['uniqueid'] . '"';
}
}
$ip = $id = $users = array();
$sql = 'SELECT acctid,name,lastip,uniqueid,dragonkills,level FROM accounts WHERE (lastip IN (-1' . $in_ip . ') OR uniqueid IN (-1' . $in_id . ')) AND locked="0" AND activated="1" ORDER BY dragonkills ASC, level ASC';
$result = db_query($sql) or die(db_error(LINK));
while ($row = db_fetch_assoc($result)) {
if ((!isset($id[$row['uniqueid']]) || $searchby == 'ip') && (!isset($ip[$row['lastip']]) || $searchby == 'id')) {
if ($searchby != 'id') $ip[$row['lastip']] = count($users);
if ($searchby != 'ip') $id[$row['uniqueid']] = count($users);
$users[] = array($row);
} elseif (isset($id[$row['uniqueid']])) {
$ip[$row['lastip']] = $id[$row['uniqueid']];
$users[$id[$row['uniqueid']]][] = $row;
} else {
$id[$row['uniqueid']] = $ip[$row['lastip']];
$users[$ip[$row['lastip']]][] = $row;
}
}
output('`n`bMultiaccounts`b`nNaaa, wer cheatet denn so alles?`n`n');
output('Multiaccounts suchen nach: ');
if ($searchby != 'ip') {
output('<a href="logs.php?op=multi&searchby=ip">IP</a> ', true);
addnav('', 'logs.php?op=multi&searchby=ip');
} else {
output('`&`bIP`b`0 ');
}
if ($searchby != 'id') {
output('<a href="logs.php?op=multi&searchby=id">ID</a> ', true);
addnav('', 'logs.php?op=multi&searchby=id');
} else {
output('`&`bID`b`0 ');
}
if (!empty($searchby)) {
output('<a href="logs.php?op=multi&searchby=">Beidem</a> ', true);
addnav('', 'logs.php?op=multi&searchby=');
} else {
output('`&`bBeidem`b`0 ');
}
output('<table><tr><td>', true);
foreach ($users as $list) {
//Angel will alle sehen! :P
//if (count($list)<3) continue;
if (count($list) < 2) {
continue;
}
$tmpstr = '';
$ips = $ids = $accts = array();
foreach ($list as $tihs) {
$tmpstr .= ('<tr><td><input type="checkbox" name="userid[]" value="' . $tihs['acctid'] . '"></td>
<td>' . $tihs['name'] . '</td>
<td>' . $tihs['lastip'] . '</td>
<td>' . $tihs['uniqueid'] . '</td>
<td>' . $tihs['dragonkills'] . '</td>
<td>' . $tihs['level'] . '</td></tr>');
}
output('<form action="logs.php?op=multi&searchby=' . $searchby . '" method="post">', true);
addnav('', 'logs.php?op=multi&searchby=' . $searchby);
output("<table align='center' class='input' width='100%'><tr><td> </td>
<td>`bName`b</td>
<td>`bIP`b</td>
<td>`bID`b</td>
<td>`bDK`b</td>
<td>`bLevel`b</td>
</tr>", true);
output($tmpstr, true);
output('<tr><td colspan="6" align="left">
<input type="submit" name="deleteuser" value="löschen">
<input type="submit" name="setupban" value="IPs bannen">
<input type="submit" name="setupban" value="IDs bannen">', true);
//output('</td>',true);
if ($searchby == 'id') {
output("<a href='multilogs.php?id={$tihs['uniqueid']}'>Multilogs</a></td></tr>", true);
addnav("", "multilogs.php?id={$tihs['uniqueid']}");
}
output('</table>`n`n', true);
output('</form>', true);
}
output('</td></tr></table>', true);
addnav('Aktualisieren', 'logs.php?op=multi&searchby=' . $searchby);
addnav('Zurück', 'logs.php');
} elseif ($op == 'adminlog') {
addnav("Zurück", "logs.php");
addnav('Aktualisieren', 'logs.php?op=adminlog');
output("`c`bAdmin-Log`b`c`n`n");
if (!empty($_REQUEST['startdate'])) {
if (preg_match('/\d{4}-\d{2}-\d{2}/', $_REQUEST['startdate'])) {
$startdate = $_REQUEST['startdate'];
if (preg_match('/\d{4}-\d{2}-\d{2}/', $_REQUEST['enddate'])) {
if ($_REQUEST['enddate'] < $startdate) {
$enddate = $startdate;
$startdate = $_REQUEST['enddate'];
} else {
$enddate = $_REQUEST['enddate'];
}
} else {
$enddate = $startdate;
}
} else {
$startdate = $enddate = date('Y-m-d');
output('`4Du hast ein falsches Datumsformat als Startdatum angegeben!`0`n');
}
} else {
$startdate = $enddate = date('Y-m-d');
}
$script = trim($_REQUEST['scriptname'] ?? "");
$ip = trim($_REQUEST['ip'] ?? "");
$id = trim($_REQUEST['id'] ?? "");
$username = trim($_REQUEST['username'] ?? "");
$user = 0;
if (!empty($username)) {
$sql = 'SELECT acctid FROM accounts WHERE login="' . trim($username) . '"';
$result = db_query($sql) or die(db_error(LINK));
if (db_num_rows($result) == 0) {
$user = 0;
output('`4Der Loginname wurde nicht gefunden!`0`n');
} else {
$row = db_fetch_assoc($result);
$user = $row['acctid'];
}
}
if ($details > 0) {
$sql = 'SELECT adminlog.*, accounts.login FROM adminlog LEFT JOIN accounts USING(acctid) WHERE adminlog.eventid="' . $details . '"';
$result = db_query($sql) or die(db_error(LINK));
if (db_num_rows($result) > 0) {
output("<table border=0 cellpadding=2 cellspacing=1 bgcolor='#999999'>", true);
output("<tr class='trhead'><td><b>Datum</b></td><td><b>Script</b></td><td><b>User</b></td><td><b>IP</b></td><td><b>ID</b></td></tr>", true);
$row = db_fetch_assoc($result);
output("<tr class='trlight'><td>", true);
output($row['date']);
output('</td><td>', true);
output($row['scriptname']);
output('</td><td>', true);
output($row['login']);
output('</td><td>', true);
output($row['ip']);
output('</td><td>', true);
output($row['id']);
output('</td></tr>', true);
$logget = unserialize($row['get_vars']);
output('<tr class="trdark"><td colspan="5">`bGET-Variablen:`b`n', true);
foreach ($logget as $key => $val) {
output('$_GET["' . $key . '"] = "' . $val . '", ');
}
output('</td></tr>', true);
$logpost = unserialize($row['post_vars']);
output('<tr class="trlight"><td colspan="5">`bPOST-Variablen:`b`n', true);
foreach ($logpost as $key => $val) {
output('$_POST["' . $key . '"] = "' . $val . '", ');
}
output('</td></tr></table>', true);
}
}
output('<form action="logs.php?op=adminlog" method="POST">', true);
addnav('', 'logs.php?op=adminlog');
output('Suche von (YYYY-MM-DD) <input type="text" name="startdate" value="' . $startdate . '" size="10" maxlength="10">', true);
output(' bis <input type="text" name="enddate" value="' . $enddate . '" size="10" maxlength="10">', true);
output('<table><tr><td>Script</td><td><input type="text" name="scriptname" value="' . $script . '"></td>', true);
output('<td> Loginname</td><td><input type="text" name="username" value="' . $username . '"></td></tr>', true);
output('<tr><td>IP</td><td><input type="text" name="ip" value="' . $ip . '"></td>', true);
output('<td> Unique-ID</td><td><input type="text" name="id" value="' . $id . '"></td></tr></table>', true);
output('<input type="submit" value="Suchen">', true);
output('</form>', true);
output("<table border=0 cellpadding=2 cellspacing=1 bgcolor='#999999'>", true);
output("<tr class='trhead'><td><b>Datum</b></td><td><b>Script</b></td><td><b>User</b></td><td><b>IP</b></td><td><b>ID</b></td><td> </td></tr>", true);
$sql = 'SELECT al.eventid, al.date, al.scriptname, al.ip, al.id, acc.login FROM adminlog al LEFT JOIN accounts acc USING(acctid) WHERE al.date >= "' . $startdate . ' 00:00:00" AND al.date <= "' . $enddate . ' 23:59:59"' . ($script != '' ? ' AND al.scriptname="' . $script . '"' : '') . ($user != 0 ? ' AND al.acctid="' . $user . '"' : '') . ($ip != '' ? ' AND al.ip="' . $ip . '"' : '') . ($id != '' ? ' AND al.id="' . $id . '"' : '') . ' ORDER BY al.date DESC';
$result = db_query($sql);
$i = 0;
while ($row = db_fetch_assoc($result)) {
output("<tr class='" . ($i % 2 ? "trdark" : "trlight") . "'><td>", true);
output("<a href='logs.php?op=adminlog&startdate=" . substr($row['date'], 0, 10) . "&scriptname=$script&ip=$ip&id=$id&username={$username}'>", true);
addnav('', "logs.php?op=adminlog&startdate=" . substr($row['date'], 0, 10) . "&scriptname=$script&ip=$ip&id=$id&username={$username}");
output($row['date']);
output('</a>', true);
output('</td><td>', true);
output("<a href='logs.php?op=adminlog&startdate=$startdate&enddate=$enddate&scriptname={$row['scriptname']}&ip=$ip&id=$id&username={$username}'>", true);
addnav('', "logs.php?op=adminlog&startdate=$startdate&enddate=$enddate&scriptname={$row['scriptname']}&ip=$ip&id=$id&username={$username}");
output($row['scriptname']);
output('</a>', true);
output('</td><td>', true);
output("<a href='logs.php?op=adminlog&startdate=$startdate&enddate=$enddate&scriptname=$script&ip=$ip&id=$id&username={$row['login']}'>", true);
addnav('', "logs.php?op=adminlog&startdate=$startdate&enddate=$enddate&scriptname=$script&ip=$ip&id=$id&username={$row['login']}");
output($row['login']);
output('</a>', true);
output('</td><td>', true);
output("<a href='logs.php?op=adminlog&startdate=$startdate&enddate=$enddate&scriptname=$script&ip={$row['ip']}&id=$id&username={$username}'>", true);
addnav('', "logs.php?op=adminlog&startdate=$startdate&enddate=$enddate&scriptname=$script&ip={$row['ip']}&id=$id&username={$username}");
output($row['ip']);
output('</a>', true);
output('</td><td>', true);
output("<a href='logs.php?op=adminlog&startdate=$startdate&enddate=$enddate&scriptname=$script&ip=$ip&id={$row['id']}&username={$username}'>", true);
addnav('', "logs.php?op=adminlog&startdate=$startdate&enddate=$enddate&scriptname=$script&ip=$ip&id={$row['id']}&username={$username}");
output($row['id']);
output('</a>', true);
output('</td><td>', true);
output("<a href='logs.php?op=adminlog&startdate=$startdate&enddate=$enddate&scriptname=$script&ip=$ip&id=$id&username={$username}&details={$row['eventid']}'>", true);
addnav('', "logs.php?op=adminlog&startdate=$startdate&enddate=$enddate&scriptname=$script&ip=$ip&id=$id&username={$username}&details={$row['eventid']}");
output('Details');
output('</a>', true);
output('</td></tr>', true);
$i++;
}
output('</table>', true);
} else {
output("Die 5 letzten fehlgeschlagenen Logins:`n`n");
$sql = "SELECT faillog.*,accounts.name AS absender FROM faillog LEFT JOIN accounts ON accounts.acctid=faillog.acctid WHERE 1 ORDER BY date DESC LIMIT 5";
$result = db_query($sql) or die(db_error(LINK));
output("<table align='center'><tr><td>`bDatum`b</td><td>`bAcctid`b</td><td>`bName`b</td><td>`bIP`b</td></tr>", true);
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
tablerow($row['date'], $row['acctid'], $row['absender'], $row['ip']);
}
output("</table>`n`nDie 5 letzten Systemmails:`n`n", true);
$sql = "SELECT mail.*,accounts.name AS empfaenger FROM mail LEFT JOIN accounts ON accounts.acctid=mail.msgto WHERE msgfrom=0 ORDER BY sent DESC LIMIT 5";
$result = db_query($sql) or die(db_error(LINK));
output("<table align='center'><tr><td>`bDatum`b</td><td>`bEmpfänger`b</td><td>`bBetreff`b</td></tr>", true);
for ($i = 0; $i < db_num_rows($result); $i++) {
$row = db_fetch_assoc($result);
tablerow($row['sent'], $row['empfaenger'], $row['subject']);
}
output("</table>`n", true);
addnav("Multiaccounts", "logs.php?op=multi");
if ($session['user']['superuser'] >= 4) {
addnav("Adminlog", "logs.php?op=adminlog");
}
addnav("Faillog", "logs.php?op=faillog");
//addnav("Usermails","logs.php?op=mail");
addnav("Aktualisieren", "logs.php");
}
output("`n<div align='right'>`)2004 by anpera</div>", true);
page_footer();