summaryrefslogtreecommitdiffstats
path: root/lib/class/api.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-20 06:23:05 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-20 06:23:05 +0000
commit5869da3fe58876644364941fa7216caee09adbf5 (patch)
tree66d981851a8e3d024ccd662c26cdad6612f7e6b0 /lib/class/api.class.php
parentc1829308f4207eda5fbfff668ad0fcd6e1f16143 (diff)
downloadampache-5869da3fe58876644364941fa7216caee09adbf5.tar.gz
ampache-5869da3fe58876644364941fa7216caee09adbf5.tar.bz2
ampache-5869da3fe58876644364941fa7216caee09adbf5.zip
little more work on the xml api, artists and albums now works
Diffstat (limited to 'lib/class/api.class.php')
-rw-r--r--lib/class/api.class.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/class/api.class.php b/lib/class/api.class.php
index 861b9b8d..29bc0bff 100644
--- a/lib/class/api.class.php
+++ b/lib/class/api.class.php
@@ -43,7 +43,7 @@ class Api {
* can take a username, if non is passed the ACL must be non-use
* specific
*/
- public static function handshake($timesamp,$passphrase,$ip,$username='') {
+ public static function handshake($timestamp,$passphrase,$ip,$username='') {
// First we'll filter by username and IP
if (!$username) {
@@ -56,18 +56,18 @@ class Api {
// Clean incomming variables
$user_id = Dba::escape($user_id);
- $timestampe = intval($timestamp);
+ $timestamp = intval($timestamp);
$ip = ip2int($ip);
// Run the query and return the passphrases as we'll have to mangle them
// to figure out if they match what we've got
- $sql = "SELECT * FROM `access_list` WHERE `user`='$user_id' AND `start` >= '$ip' AND `end` <= '$ip'";
+ $sql = "SELECT * FROM `access_list` WHERE `user`='$user_id' AND `start` <= '$ip' AND `end` >= '$ip'";
$db_results = Dba::query($sql);
while ($row = Dba::fetch_assoc($db_results)) {
// Combine and MD5 this mofo
- $md5pass = md5($timestamp . $row);
+ $md5pass = md5($timestamp . $row['key']);
if ($md5pass === $passphrase) {
// Create the Session, in this class for now needs to be moved
@@ -96,7 +96,7 @@ class Api {
"VALUES ('$token','$user_id','$agent','$level','$expire','$ip')";
$db_results = Dba::query($sql);
- if (Dba::affected_rows($db_results)) {
+ if ($db_results) {
return $token;
}