diff options
-rw-r--r-- | bin/print_tags.inc | 2 | ||||
-rw-r--r-- | server/ajax.server.php | 4 | ||||
-rw-r--r-- | server/flag.ajax.php | 49 |
3 files changed, 54 insertions, 1 deletions
diff --git a/bin/print_tags.inc b/bin/print_tags.inc index 67c56ebb..610d57e6 100644 --- a/bin/print_tags.inc +++ b/bin/print_tags.inc @@ -33,7 +33,7 @@ else { echo "Reading: $filename\n"; /* Attempt to figure out what catalog it comes from */ -$sql = "SELECT `catalog`.`id` FROM `song` INNER JOIN `catalog` ON `song`.`catalog`=`catalog`.`id` WHERE `song`.`file`='%" . Dba::escape($filename) . "'"; +$sql = "SELECT `catalog`.`id` FROM `song` INNER JOIN `catalog` ON `song`.`catalog`=`catalog`.`id` WHERE `song`.`file` LIKE '%" . Dba::escape($filename) . "'"; $db_results = Dba::query($sql); $results = Dba::fetch_assoc($db_results); diff --git a/server/ajax.server.php b/server/ajax.server.php index cd71ab83..6f3237c6 100644 --- a/server/ajax.server.php +++ b/server/ajax.server.php @@ -37,6 +37,10 @@ header("Cache-Control: no-store, no-cache, must-revalidate"); header("Pragma: no-cache"); switch ($_REQUEST['page']) { + case 'flag': + require_once Config::get('prefix') . '/server/flag.ajax.php'; + exit; + break; case 'stats': require_once Config::get('prefix') . '/server/stats.ajax.php'; exit; diff --git a/server/flag.ajax.php b/server/flag.ajax.php new file mode 100644 index 00000000..f06a4db6 --- /dev/null +++ b/server/flag.ajax.php @@ -0,0 +1,49 @@ +<?php +/* + + Copyright (c) 2001 - 2007 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 v2 + as published by the Free Software Foundation. + + 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. + +*/ + +/** + * Sub-Ajax page, requires AJAX_INCLUDE as one + */ +if (AJAX_INCLUDE != '1') { exit; } + +switch ($_REQUEST['action']) { + case 'reject': + if (!Access::check('interface','75')) { + $results['rfc3514'] = '0x1'; + break; + } + + break; + case 'accept': + if (!Access::check('interface','75')) { + $results['rfc3514'] = '0x1'; + break; + } + + break; + default: + $results['rfc3514'] = '0x1'; + break; +} // switch on action; + +// We always do this +echo xml_from_array($results); +?> |