summaryrefslogtreecommitdiffstats
path: root/lib/class/vauth.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-24 01:28:07 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-24 01:28:07 +0000
commit34b92d2dd5da0298f9d27a230ca3ffa2da061d36 (patch)
treeba4a2bf5b17c093a8127317087272e2117fcff45 /lib/class/vauth.class.php
parent3d8ff28ac56f30075bd9c485e2ee94f486717e6f (diff)
downloadampache-34b92d2dd5da0298f9d27a230ca3ffa2da061d36.tar.gz
ampache-34b92d2dd5da0298f9d27a230ca3ffa2da061d36.tar.bz2
ampache-34b92d2dd5da0298f9d27a230ca3ffa2da061d36.zip
fixed now playing for the API and lack of session extend when using the API
Diffstat (limited to 'lib/class/vauth.class.php')
-rw-r--r--lib/class/vauth.class.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/class/vauth.class.php b/lib/class/vauth.class.php
index 8fa547d9..94210381 100644
--- a/lib/class/vauth.class.php
+++ b/lib/class/vauth.class.php
@@ -354,7 +354,6 @@ class vauth {
$key = Dba::escape($key);
$time = time();
$sql = "SELECT * FROM `session` WHERE `id`='$key' AND `expire` > '$time' AND `type`!='api' AND `type`!='xml-rpc'";
-debug_event('testo',$sql,'1');
$db_results = Dba::query($sql);
if (Dba::num_rows($db_results)) {
@@ -384,6 +383,25 @@ debug_event('testo',$sql,'1');
} // session_exists
/**
+ * session_extend
+ * This should really be extend_session but hey you gotta go with the flow
+ * this takes a SID and extends it's expire
+ */
+ public static function session_extend($sid) {
+
+ $sid = Dba::escape($sid);
+ $expire = isset($_COOKIE[Config::get('session_name') . '_remember']) ? time() + Config::get('remember_length') : time() + Config::get('session_length');
+
+ $sql = "UPDATE `session` SET `expire`='$expire' WHERE `id`='$sid'";
+ $db_results = Dba::query($sql);
+
+ debug_event('SESSION','Session:' . $sid . ' Has been Extended to ' . $expire,'5');
+
+ return $db_results;
+
+ } // session_extend
+
+ /**
* _auto_init
* This function is called when the object is included, this sets up the session_save_handler
*/