X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fsecurity.inc.php;h=d978e5df2c9de97fbb1706f59cc71ea4b5a4607e;hb=bd5dad646a43b336ede8c679389a3448b5d7f2a3;hp=47b38dac43bc8b1474111b36a70b26f6046716e2;hpb=2ab3486b89b57e612d6f412afa97f7442a0e2ac0;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)