]> git.p6c8.net - jirafeau_project.git/blobdiff - lib/functions.php
[TASK] rework user auth
[jirafeau_project.git] / lib / functions.php
index 1e084fbe33d9064f7153fc366af43a66831910d8..9672fe13deed1fe03f647363dc4decaa51e9043b 100644 (file)
@@ -1476,7 +1476,7 @@ function jirafeau_admin_session_start()
     $_SESSION['admin_csrf'] = md5(uniqid(mt_rand(), true));
 }
 
     $_SESSION['admin_csrf'] = md5(uniqid(mt_rand(), true));
 }
 
-function jirafeau_admin_session_end()
+function jirafeau_session_end()
 {
     $_SESSION = array();
     session_destroy();
 {
     $_SESSION = array();
     session_destroy();
@@ -1496,6 +1496,17 @@ function jirafeau_admin_csrf_field()
     return "<input type='hidden' name='admin_csrf' value='". $_SESSION['admin_csrf'] . "'/>";
 }
 
     return "<input type='hidden' name='admin_csrf' value='". $_SESSION['admin_csrf'] . "'/>";
 }
 
+function jirafeau_user_session_start()
+{
+    $_SESSION['user_auth'] = true;
+}
+
+function jirafeau_user_session_logged()
+{
+    return isset($_SESSION['user_auth']) &&
+        $_SESSION['user_auth'] === true;
+}
+
 function jirafeau_dir_size($dir)
 {
     $size = 0;
 function jirafeau_dir_size($dir)
 {
     $size = 0;

patrick-canterino.de