From d59af0296070cd868855564a0280e4be2c16410d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 16 Nov 2009 14:28:55 -0500 Subject: [PATCH] disallow email on faves from sandboxed users --- classes/Profile.php | 1 + lib/mail.php | 4 ++++ lib/right.php | 1 + 3 files changed, 6 insertions(+) diff --git a/classes/Profile.php b/classes/Profile.php index 8754c506ce..d52dff5af6 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -697,6 +697,7 @@ class Profile extends Memcached_DataObject case Right::PUBLICNOTICE: case Right::EMAILONREPLY: case Right::EMAILONSUBSCRIBE: + case Right::EMAILONFAVE: $result = !$this->isSandboxed(); break; default: diff --git a/lib/mail.php b/lib/mail.php index 6e74d18066..dffac32626 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -546,6 +546,10 @@ function mail_notify_message($message, $from=null, $to=null) function mail_notify_fave($other, $user, $notice) { + if (!$user->hasRight(Right::EMAILONFAVE)) { + return; + } + $profile = $user->getProfile(); $bestname = $profile->getBestName(); diff --git a/lib/right.php b/lib/right.php index 90ca75fd5b..5e66eae0ed 100644 --- a/lib/right.php +++ b/lib/right.php @@ -56,5 +56,6 @@ class Right const SUBSCRIBE = 'subscribe'; const EMAILONREPLY = 'emailonreply'; const EMAILONSUBSCRIBE = 'emailonsubscribe'; + const EMAILONFAVE = 'emailonfave'; }