summaryrefslogtreecommitdiffstats
path: root/play/index.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-11 07:14:49 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-11 07:14:49 +0000
commitb29feaca4960b7190744a12c34f8a587ab008966 (patch)
tree4bcf5522cfd7d1b75a8b7aa56192f09ef790aa88 /play/index.php
parent53028c86faa8039a87bbdcabef6bc7441757ac18 (diff)
downloadampache-b29feaca4960b7190744a12c34f8a587ab008966.tar.gz
ampache-b29feaca4960b7190744a12c34f8a587ab008966.tar.bz2
ampache-b29feaca4960b7190744a12c34f8a587ab008966.zip
more xmlrpc mojo, along with some misc cleanup
Diffstat (limited to 'play/index.php')
-rw-r--r--play/index.php16
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') {