diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-06-16 17:55:08 -0400 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-06-16 17:55:08 -0400 |
commit | b06fec41d7f0e4b998dc6753a3d4c50b16621000 (patch) | |
tree | 31e1215fd11e81154183ee6e25efc65b9331cbd3 /mod/logbrowser/views/default/admin | |
parent | 61bc345d16a51c44078d684032ec50bb16b2bc47 (diff) | |
download | elgg-b06fec41d7f0e4b998dc6753a3d4c50b16621000.tar.gz elgg-b06fec41d7f0e4b998dc6753a3d4c50b16621000.tar.bz2 |
Fixes #3787 not showing all logs if user does not exist
Diffstat (limited to 'mod/logbrowser/views/default/admin')
-rw-r--r-- | mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php index 2581f954c..9506c9d9f 100644 --- a/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php +++ b/mod/logbrowser/views/default/admin/administer_utilities/logbrowser.php @@ -15,11 +15,17 @@ if ($search_username) { $user = get_user_by_username($search_username); if ($user) { $user_guid = $user->guid; + } else { + $user_guid = null; } } else { $user_guid = get_input('user_guid', null); if ($user_guid) { $user_guid = (int) $user_guid; + $user = get_entity($user_guid); + if ($user) { + $search_username = $user->username; + } } else { $user_guid = null; } @@ -38,10 +44,10 @@ if ($timeupper) { $ip_address = get_input('ip_address'); $refine = elgg_view('logbrowser/refine', array( - 'user_guid' => $user_guid, 'timeupper' => $timeupper, 'timelower' => $timelower, 'ip_address' => $ip_address, + 'username' => $search_username, )); // Get log entries @@ -50,6 +56,12 @@ $log = get_system_log($user_guid, "", "", "","", $limit, $offset, false, $timeup $count = get_system_log($user_guid, "", "", "","", $limit, $offset, true, $timeupper, $timelower, 0, $ip_address); +// if user does not exist, we have no results +if ($search_username && is_null($user_guid)) { + $log = false; + $count = 0; +} + $table = elgg_view('logbrowser/table', array('log_entries' => $log)); $nav = elgg_view('navigation/pagination',array( |