diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-26 08:28:09 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-26 08:28:09 +0000 |
commit | 97bcd214044e30b5078052ee0c523b63966d6833 (patch) | |
tree | 3710825f857adcb0d1926c9063bbc11adb678dc4 /lib/class/api.class.php | |
parent | 13ae6a0371ae26023880a0ad69b3b1587db8dd76 (diff) | |
download | ampache-97bcd214044e30b5078052ee0c523b63966d6833.tar.gz ampache-97bcd214044e30b5078052ee0c523b63966d6833.tar.bz2 ampache-97bcd214044e30b5078052ee0c523b63966d6833.zip |
added direct links back in, added batch download to single artist view, removed useless cruft
Diffstat (limited to 'lib/class/api.class.php')
-rw-r--r-- | lib/class/api.class.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/class/api.class.php b/lib/class/api.class.php index 5ff54906..09cb9997 100644 --- a/lib/class/api.class.php +++ b/lib/class/api.class.php @@ -26,7 +26,7 @@ */ class Api { - public static $version = '340001'; + public static $version = '350001'; /** * constructor @@ -45,7 +45,12 @@ class Api { * can take a username, if non is passed the ACL must be non-use * specific */ - public static function handshake($timestamp,$passphrase,$ip,$username='') { + public static function handshake($timestamp,$passphrase,$ip,$username='',$version) { + + if (intval($version) < self::$version) { + debug_event('API','Login Failed version too old','1'); + return false; + } // If the timestamp is over 2hr old sucks to be them if ($timestamp < (time() - 14400)) { @@ -88,9 +93,7 @@ class Api { $token = vauth::session_create($data); // Insert the token into the streamer - $stream = new Stream(); - $stream->user_id = $client->id; - $stream->insert_session($token); + Stream::insert_session($token,$client->id); debug_event('API','Login Success, passphrase matched','1'); // We need to also get the 'last update' of the catalog information in an RFC 2822 Format @@ -122,6 +125,7 @@ class Api { } // end while debug_event('API','Login Failed, unable to match passphrase','1'); + return false; } // handhsake |