X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=session.php;h=9dc3f4e855b76fcb81fc11f0727edadc00259d93;hb=608ecf965408645758cdca1e5f01ff5ac3eff166;hp=b36af68660469156d8059a3bac5f3f5d8c34ab8c;hpb=856f805c6cbb6e712c662214f3b5821442f808a0;p=wfpl.git diff --git a/session.php b/session.php index b36af68..9dc3f4e 100644 --- a/session.php +++ b/session.php @@ -125,8 +125,13 @@ function session_exists() { return true; } -# return username if a session exists and is authenticated +# depricated function session_exists_and_authed() { + return logged_in(); +} + +# return username if a session exists and is authenticated +function logged_in() { if(!session_exists()) { return false; } @@ -135,6 +140,20 @@ function session_exists_and_authed() { } + +# return username if a session exists and is authenticated +function logged_in_as_admin() { + if(!session_exists()) { + return false; + } + + if(session_get('auth_admin')) { + return true; + } + return false; +} + + # find existing session, or make one function init_session() { if(!session_exists()) {