aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/notification
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/notification')
-rw-r--r--phpBB/includes/notification/method/email.php3
-rw-r--r--phpBB/includes/notification/method/jabber.php2
-rw-r--r--phpBB/includes/notification/type/post.php2
-rw-r--r--phpBB/includes/notification/type/post_in_queue.php18
-rw-r--r--phpBB/includes/notification/type/topic.php2
-rw-r--r--phpBB/includes/notification/type/topic_in_queue.php25
6 files changed, 39 insertions, 13 deletions
diff --git a/phpBB/includes/notification/method/email.php b/phpBB/includes/notification/method/email.php
index 429dfda2ba..4a7fea6df3 100644
--- a/phpBB/includes/notification/method/email.php
+++ b/phpBB/includes/notification/method/email.php
@@ -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'];
}
/**
diff --git a/phpBB/includes/notification/method/jabber.php b/phpBB/includes/notification/method/jabber.php
index e3eb571fbc..863846b8a5 100644
--- a/phpBB/includes/notification/method/jabber.php
+++ b/phpBB/includes/notification/method/jabber.php
@@ -53,7 +53,7 @@ class phpbb_notification_method_jabber extends phpbb_notification_method_email
*/
public function is_available()
{
- return ($this->global_available() && $this->user->data['jabber']);
+ return ($this->global_available() && $this->user->data['user_jabber']);
}
/**
diff --git a/phpBB/includes/notification/type/post.php b/phpBB/includes/notification/type/post.php
index ddfa720e5e..d8ffdea81d 100644
--- a/phpBB/includes/notification/type/post.php
+++ b/phpBB/includes/notification/type/post.php
@@ -216,7 +216,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base
}
else
{
- $username = $this->user_loader->get_username($this->get_data('poster_id'), 'no_profile');
+ $username = $this->user_loader->get_username($this->get_data('poster_id'), 'username');
}
return array(
diff --git a/phpBB/includes/notification/type/post_in_queue.php b/phpBB/includes/notification/type/post_in_queue.php
index 1c29bee3cd..9c719205e6 100644
--- a/phpBB/includes/notification/type/post_in_queue.php
+++ b/phpBB/includes/notification/type/post_in_queue.php
@@ -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'],
)));
}
diff --git a/phpBB/includes/notification/type/topic.php b/phpBB/includes/notification/type/topic.php
index 2549b29409..22436d3fb1 100644
--- a/phpBB/includes/notification/type/topic.php
+++ b/phpBB/includes/notification/type/topic.php
@@ -178,7 +178,7 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base
}
else
{
- $username = $this->user_loader->get_username($this->get_data('poster_id'), 'no_profile');
+ $username = $this->user_loader->get_username($this->get_data('poster_id'), 'username');
}
return array(
diff --git a/phpBB/includes/notification/type/topic_in_queue.php b/phpBB/includes/notification/type/topic_in_queue.php
index dc0b9f9869..c501434c43 100644
--- a/phpBB/includes/notification/type/topic_in_queue.php
+++ b/phpBB/includes/notification/type/topic_in_queue.php
@@ -53,13 +53,20 @@ class phpbb_notification_type_topic_in_queue extends phpbb_notification_type_top
);
/**
+ * 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();
+
+ 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($auth_approve[$topic['forum_id']]['m_approve'], array_merge($options, array(
+ return $this->check_user_notification_options($has_permission, array_merge($options, array(
'item_type' => self::$notification_option['id'],
)));
}