mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-01 20:04:51 +02:00
fixes #1920 new output parameter save_visits for pwg.session.getStatus
This commit is contained in:
+30
-13
@@ -385,6 +385,35 @@ SELECT id, name
|
||||
return $languages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does the current user must log visits in history table
|
||||
*
|
||||
* @since 14
|
||||
*
|
||||
* @param int $image_id
|
||||
* @param string $image_type
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function do_log($image_id = null, $image_type = null)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$do_log = $conf['log'];
|
||||
if (is_admin())
|
||||
{
|
||||
$do_log = $conf['history_admin'];
|
||||
}
|
||||
if (is_a_guest())
|
||||
{
|
||||
$do_log = $conf['history_guest'];
|
||||
}
|
||||
|
||||
$do_log = trigger_change('pwg_log_allowed', $do_log, $image_id, $image_type);
|
||||
|
||||
return $do_log;
|
||||
}
|
||||
|
||||
/**
|
||||
* log the visit into history table
|
||||
*
|
||||
@@ -414,19 +443,7 @@ UPDATE '.USER_INFOS_TABLE.'
|
||||
pwg_query($query);
|
||||
}
|
||||
|
||||
$do_log = $conf['log'];
|
||||
if (is_admin())
|
||||
{
|
||||
$do_log = $conf['history_admin'];
|
||||
}
|
||||
if (is_a_guest())
|
||||
{
|
||||
$do_log = $conf['history_guest'];
|
||||
}
|
||||
|
||||
$do_log = trigger_change('pwg_log_allowed', $do_log, $image_id, $image_type);
|
||||
|
||||
if (!$do_log)
|
||||
if (!do_log($image_id, $image_type))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user