mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
#11791 Prevent any user from changing another user's notification settings in AJAX
This commit is contained in:
parent
c5e30c774b
commit
748238a7ea
@ -38,6 +38,10 @@ if ($change_label === '1') {
|
|||||||
$source = get_parameter('source', 0);
|
$source = get_parameter('source', 0);
|
||||||
$user = get_parameter('user', '');
|
$user = get_parameter('user', '');
|
||||||
$value = get_parameter('value', 0) ? 1 : 0;
|
$value = get_parameter('value', 0) ? 1 : 0;
|
||||||
|
$user_info = get_user_info($config['id_user']);
|
||||||
|
if ((bool) $user_info['is_admin'] === false && $config['id_user'] !== $user) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Update the label value.
|
// Update the label value.
|
||||||
ob_clean();
|
ob_clean();
|
||||||
|
@ -661,7 +661,8 @@ function notifications_set_user_label_status($source, $user, $label, $value)
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === false && $config['id_user'] !== $user) {
|
$user_info = get_user_info($config['id_user']);
|
||||||
|
if ((bool) $user_info['is_admin'] === false && $config['id_user'] !== $user) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user