summaryrefslogtreecommitdiffstats
path: root/server/xmlrpc.server.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-11 06:46:47 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-11 06:46:47 +0000
commit911f7d6850a008a84e2bd444dcba1a05b0e24b22 (patch)
tree04b6ccda73060ca039a585c95c98bb63aa1f94c8 /server/xmlrpc.server.php
parent603f145952f39164b961ac94a46b8a459e7adac0 (diff)
downloadampache-911f7d6850a008a84e2bd444dcba1a05b0e24b22.tar.gz
ampache-911f7d6850a008a84e2bd444dcba1a05b0e24b22.tar.bz2
ampache-911f7d6850a008a84e2bd444dcba1a05b0e24b22.zip
homework break!
Diffstat (limited to 'server/xmlrpc.server.php')
-rw-r--r--server/xmlrpc.server.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/server/xmlrpc.server.php b/server/xmlrpc.server.php
new file mode 100644
index 00000000..3ef233bd
--- /dev/null
+++ b/server/xmlrpc.server.php
@@ -0,0 +1,51 @@
+<?php
+/*
+
+ Copyright 2001 - 2005 Ampache.org
+ All Rights Reserved
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+$no_session = true;
+require_once('modules/init.php');
+
+
+if (conf('xml_rpc')) {
+ require_once(conf('prefix') . "/modules/xmlrpc/xmlrpcs.inc");
+ require_once(conf('prefix') . "/modules/xmlrpc/xmlrpc.inc");
+}
+else { exit(); }
+
+/* Setup the vars we are going to need */
+$access = new Access();
+
+// ** check that the remote server has access to this catalog
+if ($access->check('75',$_SERVER['REMOTE_ADDR'])) {
+
+ /* Setup Possible Actions */
+ $methods['remote_catalog_query'] = array('function' => 'remote_catalog_query');
+ $methods['remote_song_query'] = array('function' => 'remote_song_query');
+ $methods['remote_session_verify'] = array('function' => 'remote_session_verify');
+
+ $s = new xmlrpc_server($methods);
+}
+else {
+ // Access Denied... Sucka!!
+ $s = new xmlrpc_server( array( "remote_catalog_query" => array("function" => "remote_server_denied")));
+}
+
+?>