diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-04-19 19:18:48 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-04-19 19:18:48 +0000 |
commit | 6a8795b049a7566350efb369f4990f4f8189c9f1 (patch) | |
tree | 255b12a6d5f2acb61c6c1189702079fd88b6ef53 | |
parent | ac62e1a07458facafd255a5e24344e9f60ef38f3 (diff) | |
download | ampache-6a8795b049a7566350efb369f4990f4f8189c9f1.tar.gz ampache-6a8795b049a7566350efb369f4990f4f8189c9f1.tar.bz2 ampache-6a8795b049a7566350efb369f4990f4f8189c9f1.zip |
no longer passes the sid with the urls if require_session is turned off
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/class/song.class.php | 43 | ||||
-rw-r--r-- | templates/show_songs.inc | 2 |
3 files changed, 26 insertions, 21 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index ad13d094..e0d04edf 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.3.2-Beta3 + - Fixed a problem where if require_session was disabled it would + still pass the sid with the urls - Fixed problem where jpegs wouldn't get resized (Thx blueorder) - New Install and Update screen styles (Thx Ros) - Fixed a glitch that was causing m3u's to be built on every diff --git a/lib/class/song.class.php b/lib/class/song.class.php index 271d96fd..d1a985b4 100644 --- a/lib/class/song.class.php +++ b/lib/class/song.class.php @@ -126,37 +126,37 @@ class Song { $this->type = strtolower($results['1']); switch ($this->type) { - case "spx": - case "ogg": + case 'spx': + case 'ogg': $this->mime = "application/x-ogg"; - break; - case "wma": - case "asf": + break; + case 'wma': + case 'asf': $this->mime = "audio/x-ms-wma"; - break; - case "mp3": - case "mpeg3": + break; + case 'mp3': + case 'mpeg3': $this->mime = "audio/mpeg"; - break; - case "rm": - case "ra": + break; + case 'rm': + case 'ra': $this->mime = "audio/x-realaudio"; - break; - case "flac"; + break; + case 'flac'; $this->mime = "audio/x-flac"; - break; + break; case 'aac': case 'mp4': case 'm4a': $this->mime = "audio/mp4"; - break; + break; case 'mpc': $this->mime = "audio/x-musepack"; $this->type = "MPC"; - break; + break; default: $this->mime = "audio/mpeg"; - break; + break; } } // get_type @@ -710,7 +710,9 @@ class Song { /* Define Variables we are going to need */ $username = $GLOBALS['user']->username; $song_id = $this->id; - $session = session_id(); + if (conf('require_session')) { + $session_string = "&sid=" . session_id(); + } // if they are requiring a session $type = $this->type; if ($GLOBALS['user']->prefs['play_type'] == 'downsample') { @@ -719,9 +721,10 @@ class Song { /* Account for retarded players */ if ($song->type == 'flac') { $type = 'ogg'; } - $song_name = rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); + $this->format_song(); + $song_name = rawurlencode($this->f_artist_full . " - " . $this->title . "." . $this->type); - $url = conf('web_path') . "/play/index.php?song=$song_id&uid=$username&sid=$session$ds_string&name=$song_name"; + $url = conf('web_path') . "/play/index.php?song=$song_id&uid=$username$session_string$ds_string&name=$song_name"; return $url; diff --git a/templates/show_songs.inc b/templates/show_songs.inc index e01b8a20..4ab38820 100644 --- a/templates/show_songs.inc +++ b/templates/show_songs.inc @@ -131,7 +131,7 @@ foreach ($song_ids as $song_id) { | <a href="<?php echo $web_path; ?>/download/index.php?action=download&song_id=<?php echo $song->id; ?>&sid=<?php echo scrub_out(session_id()); ?>&fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _('Download'); ?></a> <?php } ?> <?php if ($GLOBALS['user']->prefs['direct_link']) { ?> - | <a href="<?php echo $web_path; ?>/play/index.php?song=<?php echo $song->id; ?>&uid=<?php echo $GLOBALS['user']->username . "&sid=" . scrub_out(session_id()); ?>&fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _('Direct Link'); ?></a> + | <a href="<?php echo $song->get_url(); ?>"><?php echo _('Direct Link'); ?></a> <?php } ?> </td> <?php if(conf('ratings')) { ?> |