summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Berry2011-04-13 15:28:46 (GMT)
committer Sascha Grossenbacher2011-04-14 09:52:56 (GMT)
commitf22d95a1920600eb12ef5ce4b40dcf5531831f9a (patch)
treeb425be5c66bb124d7f75f3b85827ac2382c1ceeb
parentcbf1d05eb07db7879180cf44b31ecdfc310f334a (diff)
Issue #1126158 by deviantintegral: Use the current account when checking permissions in hook_user().
-rw-r--r--pm_email_notify/pm_email_notify.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/pm_email_notify/pm_email_notify.module b/pm_email_notify/pm_email_notify.module
index 8d26bf5..f7bf2ac 100644
--- a/pm_email_notify/pm_email_notify.module
+++ b/pm_email_notify/pm_email_notify.module
@@ -178,7 +178,7 @@ function _pm_email_notify_text($key, $language = NULL, $translate = TRUE) {
function pm_email_notify_user($op, &$edit, &$account, $category = NULL) {
switch ($op) {
case 'form':
- if ($category == 'account' && privatemsg_user_access('read privatemsg')) {
+ if ($category == 'account' && privatemsg_user_access('read privatemsg', $account)) {
$form['privatemsg']['pm_send_notifications'] = array(
'#type' => 'checkbox',
'#title' => t('Receive email notification for incoming private messages'),
@@ -188,7 +188,7 @@ function pm_email_notify_user($op, &$edit, &$account, $category = NULL) {
return $form;
case 'submit':
- if (isset($edit['pm_send_notifications']) && privatemsg_user_access('read privatemsg')) {
+ if (isset($edit['pm_send_notifications']) && privatemsg_user_access('read privatemsg', $account)) {
$pm_email_enabled = $edit['pm_send_notifications'];
unset($edit['pm_send_notifications']);
// Update database entry with user preference.
@@ -245,4 +245,4 @@ function pm_email_notify_tt($name, $string, $language = NULL, $update = FALSE) {
else {
return $string;
}
-} \ No newline at end of file
+}