disallow email on faves from sandboxed users

This commit is contained in:
Evan Prodromou 2009-11-16 14:28:55 -05:00
parent 05ff8925bf
commit d59af02960
3 changed files with 6 additions and 0 deletions

View File

@ -697,6 +697,7 @@ class Profile extends Memcached_DataObject
case Right::PUBLICNOTICE: case Right::PUBLICNOTICE:
case Right::EMAILONREPLY: case Right::EMAILONREPLY:
case Right::EMAILONSUBSCRIBE: case Right::EMAILONSUBSCRIBE:
case Right::EMAILONFAVE:
$result = !$this->isSandboxed(); $result = !$this->isSandboxed();
break; break;
default: default:

View File

@ -546,6 +546,10 @@ function mail_notify_message($message, $from=null, $to=null)
function mail_notify_fave($other, $user, $notice) function mail_notify_fave($other, $user, $notice)
{ {
if (!$user->hasRight(Right::EMAILONFAVE)) {
return;
}
$profile = $user->getProfile(); $profile = $user->getProfile();
$bestname = $profile->getBestName(); $bestname = $profile->getBestName();

View File

@ -56,5 +56,6 @@ class Right
const SUBSCRIBE = 'subscribe'; const SUBSCRIBE = 'subscribe';
const EMAILONREPLY = 'emailonreply'; const EMAILONREPLY = 'emailonreply';
const EMAILONSUBSCRIBE = 'emailonsubscribe'; const EMAILONSUBSCRIBE = 'emailonsubscribe';
const EMAILONFAVE = 'emailonfave';
} }