Gazelle/sections/userhistory/passkey_history.php

55 lines
1.7 KiB
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
/************************************************************************
||------------|| User passkey history page ||--------------------------||
This page lists previous passkeys a user has used on the site. It gets
called if $_GET['action'] == 'passkey'.
It also requires $_GET['userid'] in order to get the data for the correct
user.
************************************************************************/
$UserID = $_GET['userid'];
if (!is_number($UserID)) { error(404); }
$DB->query("SELECT um.Username, p.Level AS Class FROM users_main AS um LEFT JOIN permissions AS p ON p.ID=um.PermissionID WHERE um.ID = ".$UserID);
list($Username, $Class) = $DB->next_record();
if(!check_perms('users_view_keys', $Class)) {
error(403);
}
2011-03-28 14:21:28 +00:00
show_header("PassKey history for $Username");
$DB->query("SELECT
OldPassKey,
NewPassKey,
ChangeTime,
ChangerIP
FROM users_history_passkeys
WHERE UserID=$UserID
ORDER BY ChangeTime DESC");
?>
2012-08-19 08:00:19 +00:00
<div class="header">
<h2>Passkey history for <a href="/user.php?id=<?=$UserID?>"><?=$Username?></a></h2>
</div>
2011-03-28 14:21:28 +00:00
<table width="100%">
<tr class="colhead">
<td>Old</td>
<td>New</td>
<td>Changed</td>
2012-09-09 08:00:26 +00:00
<td>IP [<a href="/userhistory.php?action=ips&amp;userid=<?=$UserID?>">H</a>]</td>
2011-03-28 14:21:28 +00:00
</tr>
<? while(list($OldPassKey, $NewPassKey, $ChangeTime, $ChangerIP) = $DB->next_record()){ ?>
<tr class="rowa">
<td><?=display_str($OldPassKey)?></td>
<td><?=display_str($NewPassKey)?></td>
<td><?=time_diff($ChangeTime)?></td>
2012-09-09 08:00:26 +00:00
<td><?=display_str($ChangerIP)?> [<a href="user.php?action=search&amp;ip_history=on&amp;ip=<?=display_str($ChangerIP)?>" title="Search">S</a>]<br /><?=display_str(gethostbyip($ChangerIP))?></td>
2011-03-28 14:21:28 +00:00
</tr>
<? } ?>
</table>
<? show_footer(); ?>