mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into feature/softdelete-1-permission
* 'develop' of https://github.com/phpbb/phpbb3: [ticket/11402] Fix undefined index in post/topic_in_queue [ticket/11400] If email is disabled, disable it for notifications
This commit is contained in:
@@ -53,8 +53,7 @@ class phpbb_notification_method_email extends phpbb_notification_method_base
|
||||
*/
|
||||
public function is_available()
|
||||
{
|
||||
// Email is always available
|
||||
return true;
|
||||
return (bool) $this->config['email_enable'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -64,9 +64,9 @@ class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post
|
||||
*/
|
||||
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();
|
||||
}
|
||||
|
||||
$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'],
|
||||
)));
|
||||
}
|
||||
|
@@ -52,14 +52,21 @@ class phpbb_notification_type_topic_in_queue extends phpbb_notification_type_top
|
||||
'group' => 'NOTIFICATION_GROUP_MODERATION',
|
||||
);
|
||||
|
||||
/**
|
||||
* Permission to check for (in find_users_for_notification)
|
||||
*
|
||||
* @var string Permission name
|
||||
*/
|
||||
protected $permission = 'm_approve';
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
||||
$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'],
|
||||
)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user