diff --git a/admin/history.php b/admin/history.php
index ed0969930..90806d091 100644
--- a/admin/history.php
+++ b/admin/history.php
@@ -102,9 +102,24 @@ else
$form_param['ip'] = isset($_GET['filter_ip']) ? $_GET['filter_ip'] : @$form['ip'];
$form_param['image_id'] = isset($_GET['filter_image_id']) ? $_GET['filter_image_id'] : @$form['image_id'];
+$form_param['user_id'] = isset($_GET['filter_user_id']) ? $_GET['filter_user_id'] : "-1";
+
+if ($form_param['user_id'] != "-1") {
+ $query = '
+ SELECT
+ username
+ FROM '.USERS_TABLE.'
+ WHERE id = '.$form_param['user_id'].'
+ ;';
+
+ list($form_param['user_name']) = pwg_db_fetch_row(pwg_query($query));
+ $form_param['user_id'] = empty(pwg_db_fetch_row(pwg_query($query))) ? "-1" : $form_param['user_id'];
+}
$template->assign(
array(
+ 'USER_ID' => $form_param['user_id'],
+ 'USER_NAME' => @$form_param['user_name'],
'IMAGE_ID' => $form_param['image_id'],
'FILENAME' => @$form['filename'],
'IP' => $form_param['ip'],
diff --git a/admin/themes/default/js/history.js b/admin/themes/default/js/history.js
index c27494a1a..8c1792c4f 100644
--- a/admin/themes/default/js/history.js
+++ b/admin/themes/default/js/history.js
@@ -9,6 +9,9 @@ $(document).ready(() => {
if (current_param.image_id != "") {
addImageFilter(current_param.image_id);
}
+ if (current_param.user_id != "-1") {
+ addUserFilter(filter_user_name);
+ }
$(".elem-type-select").on("change", function (e) {
console.log($(".elem-type-select option:selected").attr("value"));
diff --git a/admin/themes/default/js/user_list.js b/admin/themes/default/js/user_list.js
index ad7067c28..cfe8efe87 100644
--- a/admin/themes/default/js/user_list.js
+++ b/admin/themes/default/js/user_list.js
@@ -1002,6 +1002,7 @@ function fill_user_edit_summary(user_to_edit, pop_in, isGuest) {
pop_in.find('.user-property-register').tipTip({content:`${registered_str}
${user_to_edit.registration_date_since}`});
pop_in.find('.user-property-last-visit').html(get_formatted_date(user_to_edit.last_visit));
pop_in.find('.user-property-last-visit').tipTip({content: `${last_visit_str}
${user_to_edit.last_visit_since}`});
+ pop_in.find('.user-property-history a').attr('href', history_base_url + user_to_edit.id);
}
function fill_user_edit_properties(user_to_edit, pop_in) {
diff --git a/admin/themes/default/template/history.tpl b/admin/themes/default/template/history.tpl
index 70a7bc182..607d5c85f 100644
--- a/admin/themes/default/template/history.tpl
+++ b/admin/themes/default/template/history.tpl
@@ -11,6 +11,8 @@ var month = dateObj.getUTCMonth() + 1; //months from 1-12
var day = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();
+var filter_user_name = "{$USER_NAME}";
+
if (month < 10) month = "0" + month;
if (day < 10) day = "0" + day;
@@ -24,10 +26,10 @@ var current_param = {
2: "high",
3: "other"
},
- user_id: "-1",
+ user_id: {$USER_ID},
image_id: {if isset($IMAGE_ID)}"{$IMAGE_ID}"{else}""{/if},
filename: "",
- ip:{if isset($IP)}"{$IP}"{else}""{/if},
+ ip: {if isset($IP)}"{$IP}"{else}""{/if},
display_thumbnail: "display_thumbnail_classic",
pageNumber: 0 {* fetch lines from line 0 to line 100*}
}
diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl
index 7ced62739..2df6b5d23 100644
--- a/admin/themes/default/template/user_list.tpl
+++ b/admin/themes/default/template/user_list.tpl
@@ -34,6 +34,7 @@ const hide_str = '{'Hide'|@translate}';
const show_str = '{'Show'|@translate}';
const user_added_str = '{'User %s added'|@translate}';
const str_popin_update_btn = '{'Update'|@translate}';
+const history_base_url = "{$U_HISTORY}";
const view_selector = '{$view_selector}';
@@ -637,6 +638,11 @@ $(document).ready(function() {