Gazelle/sections/userhistory/password_history.php

58 lines
1.6 KiB
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
/************************************************************************
||------------|| Password reset history page ||------------------------||
2013-02-22 08:00:24 +00:00
This page lists password reset IP and Times a user has made on the site.
2011-03-28 14:21:28 +00:00
It gets called if $_GET['action'] == 'password'.
It also requires $_GET['userid'] in order to get the data for the correct
user.
************************************************************************/
$UserID = $_GET['userid'];
2013-04-20 08:01:01 +00:00
if (!is_number($UserID)) {
error(404);
}
2011-03-28 14:21:28 +00:00
2013-04-20 08:01:01 +00:00
$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();
2013-04-20 08:01:01 +00:00
if (!check_perms('users_view_keys', $Class)) {
error(403);
}
2011-03-28 14:21:28 +00:00
2012-10-11 08:00:15 +00:00
View::show_header("Password reset history for $Username");
2011-03-28 14:21:28 +00:00
2013-04-20 08:01:01 +00:00
$DB->query("
SELECT
ChangeTime,
ChangerIP
2011-03-28 14:21:28 +00:00
FROM users_history_passwords
WHERE UserID=$UserID
ORDER BY ChangeTime DESC");
?>
2012-08-19 08:00:19 +00:00
<div class="header">
<h2>Password reset 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>Changed</td>
2013-02-09 08:01:01 +00:00
<td>IP <a href="/userhistory.php?action=ips&amp;userid=<?=$UserID?>" class="brackets">H</a></td>
2011-03-28 14:21:28 +00:00
</tr>
2013-04-20 08:01:01 +00:00
<? while (list($ChangeTime, $ChangerIP) = $DB->next_record()) { ?>
2011-03-28 14:21:28 +00:00
<tr class="rowa">
<td><?=time_diff($ChangeTime)?></td>
2013-02-09 08:01:01 +00:00
<td><?=display_str($ChangerIP)?> <a href="/user.php?action=search&amp;ip_history=on&amp;ip=<?=display_str($ChangerIP)?>" class="brackets" title="Search">S</a><br /><?=Tools::get_host_by_ajax($ChangerIP)?></td>
2011-03-28 14:21:28 +00:00
</tr>
<? } ?>
</table>
2012-10-11 08:00:15 +00:00
<? View::show_footer(); ?>