X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fsecurity.inc.php;h=d978e5df2c9de97fbb1706f59cc71ea4b5a4607e;hb=3d57237e2ce44f487ebef727aa957c63643f5c1c;hp=47b38dac43bc8b1474111b36a70b26f6046716e2;hpb=8dda254648e0ebf8ba0e6a7b2d58acff730ada2c;p=platal.git diff --git a/include/security.inc.php b/include/security.inc.php index 47b38da..d978e5d 100644 --- a/include/security.inc.php +++ b/include/security.inc.php @@ -1,6 +1,6 @@ numRows()) { + $res = XDB::fetchOneCell('SELECT COUNT(*) + FROM email_watch + WHERE state != \'safe\' AND email = {?}', + $email); + if ($res) { send_warning_mail($message); return true; } @@ -78,7 +79,10 @@ function check_email($email, $message) function check_account() { - return S::user()->watch; + if (S::user()) { + return S::user()->watch; + } + return false; } function check_redirect($red = null)