mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 06:18:52 +00:00
[ticket/11402] Fix undefined index in post/topic_in_queue
PHPBB3-11402
This commit is contained in:
parent
2bf98dcead
commit
0eb6f56a9a
2 changed files with 35 additions and 8 deletions
|
@ -64,9 +64,9 @@ class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post
|
||||||
*/
|
*/
|
||||||
public function is_available()
|
public function is_available()
|
||||||
{
|
{
|
||||||
$m_approve = $this->auth->acl_getf($this->permission, true);
|
$has_permission = $this->auth->acl_getf($this->permission, true);
|
||||||
|
|
||||||
return (!empty($m_approve));
|
return (!empty($has_permission));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,9 +90,19 @@ class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$auth_approve[$post['forum_id']] = array_unique(array_merge($auth_approve[$post['forum_id']], $auth_approve[0]));
|
$has_permission = array();
|
||||||
|
|
||||||
return $this->check_user_notification_options($auth_approve[$post['forum_id']][$this->permission], array_merge($options, array(
|
if (isset($auth_approve[$post['forum_id']][$this->permission]))
|
||||||
|
{
|
||||||
|
$has_permission = $auth_approve[$post['forum_id']][$this->permission];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($auth_approve[0][$this->permission]))
|
||||||
|
{
|
||||||
|
$has_permission = array_unique(array_merge($has_permission, $auth_approve[0][$this->permission]));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->check_user_notification_options($has_permission, array_merge($options, array(
|
||||||
'item_type' => self::$notification_option['id'],
|
'item_type' => self::$notification_option['id'],
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,14 +52,21 @@ class phpbb_notification_type_topic_in_queue extends phpbb_notification_type_top
|
||||||
'group' => 'NOTIFICATION_GROUP_MODERATION',
|
'group' => 'NOTIFICATION_GROUP_MODERATION',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permission to check for (in find_users_for_notification)
|
||||||
|
*
|
||||||
|
* @var string Permission name
|
||||||
|
*/
|
||||||
|
protected $permission = 'm_approve';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is available
|
* Is available
|
||||||
*/
|
*/
|
||||||
public function is_available()
|
public function is_available()
|
||||||
{
|
{
|
||||||
$m_approve = $this->auth->acl_getf('m_approve', true);
|
$has_permission = $this->auth->acl_getf($this->permission, true);
|
||||||
|
|
||||||
return (!empty($m_approve));
|
return (!empty($has_permission));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,9 +90,19 @@ class phpbb_notification_type_topic_in_queue extends phpbb_notification_type_top
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$auth_approve[$topic['forum_id']] = array_unique(array_merge($auth_approve[$topic['forum_id']], $auth_approve[0]));
|
$has_permission = array();
|
||||||
|
|
||||||
return $this->check_user_notification_options($auth_approve[$topic['forum_id']]['m_approve'], array_merge($options, array(
|
if (isset($auth_approve[$topic['forum_id']][$this->permission]))
|
||||||
|
{
|
||||||
|
$has_permission = $auth_approve[$topic['forum_id']][$this->permission];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($auth_approve[0][$this->permission]))
|
||||||
|
{
|
||||||
|
$has_permission = array_unique(array_merge($has_permission, $auth_approve[0][$this->permission]));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->check_user_notification_options($has_permission, array_merge($options, array(
|
||||||
'item_type' => self::$notification_option['id'],
|
'item_type' => self::$notification_option['id'],
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue