X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fsecurity.inc.php;h=2f77f826b99c4f81a96a9d03f822b0035cb6fac6;hb=1c0419d6b4c94643bfa7bed9a6b435bbdbbae02f;hp=b202df471a222b3588de8d74f764a673163217fe;hpb=f2ef84b551f385edbdc07afe5459967c5b89ec60;p=platal.git diff --git a/include/security.inc.php b/include/security.inc.php index b202df4..2f77f82 100644 --- a/include/security.inc.php +++ b/include/security.inc.php @@ -1,6 +1,6 @@ numRows()) { send_warning_mail($message); @@ -78,7 +78,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) @@ -108,7 +111,7 @@ function send_warning_mail($title) function kill_sessions() { - assert(S::has_perms()); + assert(S::admin()); shell_exec('sudo -u root ' . dirname(dirname(__FILE__)) . '/bin/kill_sessions.sh'); }