summaryrefslogtreecommitdiffstats
path: root/lib/class/api.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-02-01 01:06:46 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-02-01 01:06:46 +0000
commitb9a2603025483deefbf7636de3f6c0786e95d293 (patch)
tree5d2ece594fbed8a58874830c42d8182f025ef16b /lib/class/api.class.php
parent1891fd835cc3cd60d7c3a2ec8bf90b51ca261bf0 (diff)
downloadampache-b9a2603025483deefbf7636de3f6c0786e95d293.tar.gz
ampache-b9a2603025483deefbf7636de3f6c0786e95d293.tar.bz2
ampache-b9a2603025483deefbf7636de3f6c0786e95d293.zip
Finish IPv6 support
Diffstat (limited to 'lib/class/api.class.php')
-rw-r--r--lib/class/api.class.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/class/api.class.php b/lib/class/api.class.php
index 6d65ec24..63d7c017 100644
--- a/lib/class/api.class.php
+++ b/lib/class/api.class.php
@@ -72,10 +72,10 @@ class Api {
// Clean incomming variables
$user_id = Dba::escape($user_id);
$timestamp = intval($timestamp);
- $ip = sprintf("%u",ip2long($ip));
+ $ip = Dba::escape(inet_pton($ip));
// Log this attempt
- debug_event('API','Login Attempt, IP:' . long2ip($ip) . ' Time:' . $timestamp . ' User:' . $username . '(' . $user_id . ') Auth:' . $passphrase,'1');
+ debug_event('API','Login Attempt, IP:' . inet_ntop($ip) . ' Time:' . $timestamp . ' User:' . $username . '(' . $user_id . ') Auth:' . $passphrase,'1');
// Run the query and return the passphrases as we'll have to mangle them
// to figure out if they match what we've got