diff --git a/pm_email_notify/pm_email_notify.module b/pm_email_notify/pm_email_notify.module index 8d26bf5d31bc2939a3d9f79dbb67164bdca1556d..f7bf2acd3b74a5e41543ed31b3eaac7848bfadd2 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 +}