diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-10-29 06:47:00 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-10-29 06:47:00 +0000 |
commit | e8559dd683eba762b2bd374c731e7f7e8116bf70 (patch) | |
tree | d14ca2253febee2ea214d3501b02ca4e59010d2f /lib/class/vauth.class.php | |
parent | f593f18131d6a0cbf30b558b208e86b9fc957f13 (diff) | |
download | ampache-e8559dd683eba762b2bd374c731e7f7e8116bf70.tar.gz ampache-e8559dd683eba762b2bd374c731e7f7e8116bf70.tar.bz2 ampache-e8559dd683eba762b2bd374c731e7f7e8116bf70.zip |
fix http auth issues, fix missing line sfrom dipsols patch, few other minor things
Diffstat (limited to 'lib/class/vauth.class.php')
-rw-r--r-- | lib/class/vauth.class.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/class/vauth.class.php b/lib/class/vauth.class.php index 7bf4d16c..b9aeee6a 100644 --- a/lib/class/vauth.class.php +++ b/lib/class/vauth.class.php @@ -149,6 +149,9 @@ class vauth { // If no key is passed try to find the session id $key = $key ? $key : session_id(); + + // Nuke the cookie before all else + self::destroy($key); // Do a quick check to see if this is an AJAX'd logout request // if so use the iframe to redirect @@ -169,7 +172,6 @@ class vauth { echo xml_from_array($results); } - self::destroy($key); /* Redirect them to the login page */ if (AJAX_INCLUDE != '1') { @@ -648,7 +650,7 @@ class vauth { public static function http_auth($username) { /* Check if the user exists */ - if ($user = new User($username)) { + if ($user = User::get_from_username($username)) { $results['success'] = true; $results['type'] = 'mysql'; $results['username'] = $username; @@ -658,8 +660,8 @@ class vauth { } /* If not then we auto-create the entry as a user.. :S */ - $user->create($username,$username,'',md5(rand()),'25'); - $user = new User($username); + $user_id = $user->create($username,$username,'',md5(rand()),'25'); + $user = new User($user_id); $results['success'] = true; $results['type'] = 'mysql'; |