diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-07-11 07:14:49 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-07-11 07:14:49 +0000 |
commit | b29feaca4960b7190744a12c34f8a587ab008966 (patch) | |
tree | 4bcf5522cfd7d1b75a8b7aa56192f09ef790aa88 /play | |
parent | 53028c86faa8039a87bbdcabef6bc7441757ac18 (diff) | |
download | ampache-b29feaca4960b7190744a12c34f8a587ab008966.tar.gz ampache-b29feaca4960b7190744a12c34f8a587ab008966.tar.bz2 ampache-b29feaca4960b7190744a12c34f8a587ab008966.zip |
more xmlrpc mojo, along with some misc cleanup
Diffstat (limited to 'play')
-rw-r--r-- | play/index.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/play/index.php b/play/index.php index a72231c3..4d843bc4 100644 --- a/play/index.php +++ b/play/index.php @@ -41,8 +41,12 @@ $sid = htmlspecialchars($_REQUEST['sid']); $dbh = dbh(); $user = new User($uid); -if (conf('require_session') && !conf('xml_rpc')) { - if(!session_exists($sid)) { +if (conf('xml_rpc')) { + $xml_rpc = $_GET['xml_rpc']; +} + +if (conf('require_session')) { + if(!session_exists($sid,$xml_rpc)) { die(_("Session Expired: please log in again at") . " " . conf('web_path') . "/login.php"); } @@ -125,7 +129,13 @@ $catalog = new Catalog($song->catalog); if ( $catalog->catalog_type == 'remote' ) { // redirect to the remote host's play path - header("Location: $song->file"); + /* Break Up the Web Path */ + preg_match("/http:\/\/([^\/]+)\/*(.*)/", conf('web_path'), $match); + $server = rawurlencode($match[1]); + $path = rawurlencode($match[2]); + + $extra_info = "&xml_rpc=1&xml_path=$path&xml_server=$server&xml_port=80&sid=$sid"; + header("Location: " . $song->file . $extra_info); } else { if ($user->prefs['play_type'] == 'downsample') { |