X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fsecurity.inc.php;h=2f77f826b99c4f81a96a9d03f822b0035cb6fac6;hb=0b6c8b36e62b950d1b24088e98c4026a54efe9d0;hp=b202df471a222b3588de8d74f764a673163217fe;hpb=2f41039553d2137c094d58074d918f37f3a4534a;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'); }