--- a/ajax.php Mon Sep 01 16:50:03 2008 -0400
+++ b/ajax.php Mon Sep 01 16:51:13 2008 -0400
@@ -39,27 +39,8 @@
global $playlist, $mime_types, $json, $allowcontrol;
global $use_auth, $auth_data;
- if ( $use_auth )
- {
- if ( !isset($_SERVER['PHP_AUTH_USER']) )
- {
- $httpd->header('WWW-Authenticate: basic');
- $httpd->send_http_error($socket, 401, "A username and password are required to access this resource. Either you did not specify a username and password, or the supplied credentials were incorrect.");
- return true;
- }
- if ( !isset($auth_data[$_SERVER['PHP_AUTH_USER']]) )
- {
- $httpd->header('WWW-Authenticate: basic');
- $httpd->send_http_error($socket, 401, "A username and password are required to access this resource. Either you did not specify a username and password, or the supplied credentials were incorrect.");
- return true;
- }
- else if ( $_SERVER['PHP_AUTH_PW'] !== $auth_data[$_SERVER['PHP_AUTH_USER']] )
- {
- $httpd->header('WWW-Authenticate: basic');
- $httpd->send_http_error($socket, 401, "A username and password are required to access this resource. Either you did not specify a username and password, or the supplied credentials were incorrect.");
- return true;
- }
- }
+ if ( !session_check() )
+ return true;
// Set content type
$httpd->header("Content-type: {$mime_types['js']}");