Garbage collect sessions
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
define("NO_SESSION", 1);
|
||||||
define("SITE_ROOT", realpath(dirname(__file__)));
|
define("SITE_ROOT", realpath(dirname(__file__)));
|
||||||
require_once SITE_ROOT . "/lib/init.php";
|
require_once SITE_ROOT . "/lib/init.php";
|
||||||
|
|
||||||
@@ -67,3 +68,5 @@ if ($nr)
|
|||||||
$rp = $nr != 1 ? "reports" : "report";
|
$rp = $nr != 1 ? "reports" : "report";
|
||||||
IRCNotify::send("#SingularityViewer", "[CrashProcessor] $nr new $rp. http://crash.singularityviewer.org/");
|
IRCNotify::send("#SingularityViewer", "[CrashProcessor] $nr new $rp. http://crash.singularityviewer.org/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Session::GC();
|
||||||
|
|||||||
@@ -263,6 +263,11 @@ class Session
|
|||||||
{
|
{
|
||||||
return ($this->authenticated && $this->user->isAdmin());
|
return ($this->authenticated && $this->user->isAdmin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public function GC()
|
||||||
|
{
|
||||||
|
DBH::$db->query("delete from session where expires > current_timestamp");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
define("NO_SESSION", 1);
|
||||||
define("SITE_ROOT", realpath(dirname(__file__)));
|
define("SITE_ROOT", realpath(dirname(__file__)));
|
||||||
require_once SITE_ROOT . "/lib/init.php";
|
require_once SITE_ROOT . "/lib/init.php";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user