X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fsecurity.inc.php;h=d978e5df2c9de97fbb1706f59cc71ea4b5a4607e;hb=948cae2109c11dccb75c83f7a2af6009b9d528d4;hp=c909f2d04e9eebe4f24596b969b2a0dc15892804;hpb=fb813fb52d5ab65ca9a5b92b5cb9089523380d79;p=platal.git diff --git a/include/security.inc.php b/include/security.inc.php index c909f2d..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::v('watch_account'); + if (S::user()) { + return S::user()->watch; + } + return false; } function check_redirect($red = null)