mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-05-12 03:16:24 +03:00
fixes #1838 ability to hide connections from activities with a config setting
This commit is contained in:
parent
80b64e32fa
commit
3b36ff0a91
2 changed files with 28 additions and 23 deletions
|
@ -750,6 +750,12 @@ $conf['dashboard_check_for_updates'] = true;
|
||||||
// Number Weeks displayed on activity chart on the dashboard
|
// Number Weeks displayed on activity chart on the dashboard
|
||||||
$conf['dashboard_activity_nb_weeks'] = 4;
|
$conf['dashboard_activity_nb_weeks'] = 4;
|
||||||
|
|
||||||
|
// On the Admin>Users>Activity page, should we display the connection/disconnections?
|
||||||
|
// 'all' = do not filter, display all
|
||||||
|
// 'admins_only' = only display connections of admin users
|
||||||
|
// 'none' = don't even display connections of admin users
|
||||||
|
$conf['activity_display_connections'] = 'admins_only';
|
||||||
|
|
||||||
// On album mover page, number of seconds before auto openning album when
|
// On album mover page, number of seconds before auto openning album when
|
||||||
// dragging an album. In milliseconds. 3 seconds by default.
|
// dragging an album. In milliseconds. 3 seconds by default.
|
||||||
$conf['album_move_delay_before_auto_opening'] = 3*1000;
|
$conf['album_move_delay_before_auto_opening'] = 3*1000;
|
||||||
|
|
|
@ -434,8 +434,7 @@ function ws_getActivityList($param, &$service)
|
||||||
|
|
||||||
$user_ids = array();
|
$user_ids = array();
|
||||||
|
|
||||||
if (isset($param['uid'])) {
|
$query = '
|
||||||
$query = '
|
|
||||||
SELECT
|
SELECT
|
||||||
activity_id,
|
activity_id,
|
||||||
performed_by,
|
performed_by,
|
||||||
|
@ -447,29 +446,29 @@ SELECT
|
||||||
occured_on,
|
occured_on,
|
||||||
details,
|
details,
|
||||||
user_agent
|
user_agent
|
||||||
FROM '.ACTIVITY_TABLE.'
|
FROM '.ACTIVITY_TABLE;
|
||||||
WHERE performed_by = '.$param['uid'].'
|
|
||||||
ORDER BY activity_id DESC LIMIT '.$page_size.' OFFSET '.$page_offset.';
|
if (isset($param['uid']))
|
||||||
;';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
$query = '
|
$query.= '
|
||||||
SELECT
|
WHERE performed_by = '.$param['uid'];
|
||||||
activity_id,
|
|
||||||
performed_by,
|
|
||||||
object,
|
|
||||||
object_id,
|
|
||||||
action,
|
|
||||||
session_idx,
|
|
||||||
ip_address,
|
|
||||||
occured_on,
|
|
||||||
details,
|
|
||||||
user_agent
|
|
||||||
FROM '.ACTIVITY_TABLE.'
|
|
||||||
ORDER BY activity_id DESC LIMIT '.$page_size.' OFFSET '.$page_offset.';
|
|
||||||
;';
|
|
||||||
}
|
}
|
||||||
|
elseif ('none' == $conf['activity_display_connections'])
|
||||||
|
{
|
||||||
|
$query.= '
|
||||||
|
WHERE action NOT IN (\'login\', \'logout\')';
|
||||||
|
}
|
||||||
|
elseif ('admins_only' == $conf['activity_display_connections'])
|
||||||
|
{
|
||||||
|
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
||||||
|
$query.= '
|
||||||
|
WHERE NOT (action IN (\'login\', \'logout\') AND object_id NOT IN ('.implode(',', get_admins()).'))';
|
||||||
|
}
|
||||||
|
|
||||||
|
$query.= '
|
||||||
|
ORDER BY activity_id DESC
|
||||||
|
LIMIT '.$page_size.' OFFSET '.$page_offset.'
|
||||||
|
;';
|
||||||
|
|
||||||
$line_id = 0;
|
$line_id = 0;
|
||||||
$result = pwg_query($query);
|
$result = pwg_query($query);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue