forked from Cavemanon/cavepaintings
Show logged event IPs on user page
This commit is contained in:
@@ -240,7 +240,9 @@ class UserPage extends Extension {
|
||||
$this->theme->display_ip_list(
|
||||
$page,
|
||||
$this->count_upload_ips($event->display_user),
|
||||
$this->count_comment_ips($event->display_user));
|
||||
$this->count_comment_ips($event->display_user),
|
||||
$this->count_log_ips($event->display_user)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -587,6 +589,21 @@ class UserPage extends Extension {
|
||||
return $rows;
|
||||
}
|
||||
|
||||
private function count_log_ips(User $duser): array {
|
||||
if(!class_exists('LogDatabase')) return array();
|
||||
global $database;
|
||||
$rows = $database->get_pairs("
|
||||
SELECT
|
||||
address,
|
||||
COUNT(id) AS count,
|
||||
MAX(date_sent) AS most_recent
|
||||
FROM score_log
|
||||
WHERE username=:username
|
||||
GROUP BY address
|
||||
ORDER BY most_recent DESC", array("username"=>$duser->name));
|
||||
return $rows;
|
||||
}
|
||||
|
||||
private function delete_user(Page $page, bool $with_images=false, bool $with_comments=false) {
|
||||
global $user, $config, $database;
|
||||
|
||||
|
Reference in New Issue
Block a user