1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-04 10:19:25 +02:00

Fixed two PHP warnings, and some issues with how users were being constructed

in init (which makes me wonder) and started trying to figure out why libre.fm broke
This commit is contained in:
Karl Vollmer 2011-12-01 15:59:33 -04:00
parent d1af05595c
commit 56eb2ac7dc
5 changed files with 10 additions and 5 deletions

View file

@ -45,7 +45,7 @@ if (!vauth::session_exists('interface',$_COOKIE[Config::get('session_name')]) AN
} }
// If we aren't resizing just trash thumb // If we aren't resizing just trash thumb
if (!Config::get('resize_images')) { unset($_GET['thumb']); } if (!Config::get('resize_images')) { $_GET['thumb'] = null; }
// FIXME: Legacy stuff - should be removed after a version or so // FIXME: Legacy stuff - should be removed after a version or so
if (!isset($_GET['object_type'])) { if (!isset($_GET['object_type'])) {

View file

@ -2182,7 +2182,7 @@ class Catalog extends database_object {
*/ */
// Strip the SSID off of the url, we will need to regenerate this every time // Strip the SSID off of the url, we will need to regenerate this every time
$url = preg_replace("/SSID=.*&/","",$song['url']); $url = preg_replace("/ssid=.*&/","",$song['url']);
$title = Dba::escape($song['title']); $title = Dba::escape($song['title']);
$album = self::check_album($song['album'],$song['year'],null,$song['album_mbid']); $album = self::check_album($song['album'],$song['year'],null,$song['album_mbid']);
$artist = self::check_artist($song['artist'],$song['artist_mbid']); $artist = self::check_artist($song['artist'],$song['artist_mbid']);

View file

@ -146,7 +146,7 @@ class scrobbler {
"\n---------\nExpeceted:" . print_r($response,1); "\n---------\nExpeceted:" . print_r($response,1);
return false; return false;
} }
debug_event('ZZZZZ',print_r($split_response,1),1);
$data['challenge'] = $response[1]; $data['challenge'] = $response[1];
return $data; return $data;
@ -219,6 +219,10 @@ class scrobbler {
return false; return false;
} }
// Need to debug this
$string = "POST ".$this->submit_url." HTTP/1.0\r\n"."Host: ".$this->submit_host."\r\n"."Accept: */*\r\n"."User-Agent: Ampache/3.6\r\n".
"Content-type: application/x-www-form-urlencoded\r\n"."Content-length: ".strlen($query_str)."\r\n\r\n".$query_str."\r\n\r\n";
debug_event('SCROBBLER',$string,1);
$action = "POST ".$this->submit_url." HTTP/1.0\r\n"; $action = "POST ".$this->submit_url." HTTP/1.0\r\n";
fwrite($as_socket, $action); fwrite($as_socket, $action);
fwrite($as_socket, "Host: ".$this->submit_host."\r\n"); fwrite($as_socket, "Host: ".$this->submit_host."\r\n");

View file

@ -195,7 +195,7 @@ if (!defined('NO_SESSION') && Config::get('use_auth')) {
vauth::check_session(); vauth::check_session();
/* Create the new user */ /* Create the new user */
$GLOBALS['user'] = User::get_from_username($_SESSION['userdata']['username']); $GLOBALS['user'] = new User($_SESSION['userdata']['uid']);
/* If the user ID doesn't exist deny them */ /* If the user ID doesn't exist deny them */
if (!$GLOBALS['user']->id AND !Config::get('demo_mode')) { vauth::logout(session_id()); exit; } if (!$GLOBALS['user']->id AND !Config::get('demo_mode')) { vauth::logout(session_id()); exit; }
@ -243,7 +243,7 @@ else {
session_name(Config::get('session_name')); session_name(Config::get('session_name'));
session_id(scrub_in($_REQUEST['sid'])); session_id(scrub_in($_REQUEST['sid']));
session_start(); session_start();
$GLOBALS['user'] = User::get_from_username($_SESSION['userdata']['username']); $GLOBALS['user'] = new User($_SESSION['userdata']['uid']);
} }
else { else {
$GLOBALS['user'] = new User(); $GLOBALS['user'] = new User();

View file

@ -322,6 +322,7 @@ if (((Config::get('transcode') == 'always' AND !$video) ||
} // end if downsampling } // end if downsampling
else { else {
$fp = fopen($media->file, 'rb'); $fp = fopen($media->file, 'rb');
$transcoded = false;
} }
if (!is_resource($fp)) { if (!is_resource($fp)) {