Merge remote branch 'origin/xorg/maint' into xorg/master
[platal.git] / include / reminder / email_warning.inc.php
index 1b8f901..6fc5c40 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -41,8 +41,12 @@ class ReminderEmailWarning extends Reminder
         return true;
     }
 
-    public static function IsCandidate(User &$user, $candidate)
+    public static function IsCandidate(User $user, $candidate)
     {
+        if (!$user->checkPerms(User::PERM_MAIL)) {
+            return false;
+        }
+
         return count(S::v('mx_failures', array())) > 0;
     }
 }