diff --git a/ajax_queuesong.php b/ajax_queuesong.php index 2c70cf1..b895b23 100644 --- a/ajax_queuesong.php +++ b/ajax_queuesong.php @@ -5,13 +5,14 @@ require 'header.php'; if ( !isset($_REQUEST['songid']) ) { exit(); } -$songid = intval($_REQUEST['songid']); +$song = new Song($_REQUEST['songid']); +if ( (substr($song->getPath(), 0, 10) == "Christmas/") && (intval(date("n")) != 12) ) exit(); if ( $_SESSION['queuetarget'] == 0 ) { $query = "INSERT INTO " . INSTANTQTABLE . " (songid) VALUES(:songid)"; $sth = $globaldbh->prepare($query); $fields = array(); - $fields[':songid'] = $songid; + $fields[':songid'] = $song->getID(); $sth->execute($fields); } else { if ( RESTRICTQUEUES && (substr($_SERVER['REMOTE_ADDR'], 0, strlen(LOCALNETWORK)) != LOCALNETWORK) ) exit(); @@ -19,7 +20,7 @@ if ( $_SESSION['queuetarget'] == 0 ) { $sth = $globaldbh->prepare($query); $fields = array(); $fields[':qid'] = $_SESSION['queuetarget']; - $fields[':songid'] = $songid; + $fields[':songid'] = $song->getID(); $sth->execute($fields); }