include_once 'lib/jzcomp.lib.php'; include_once 'services/class.php'; include_once 'frontend/display.php'; $this_page = setThisPage(); // Let's create our user object for later $jzUSER = new jzUser(); if (isset($_GET['user']) && isset($_GET['pass'])) { $store_cookie = true; // Are they ok? if ($jzUSER->login($_GET['user'], $_GET['pass'], $store_cookie, false) === false) { echo "login failed"; exit; } } // Let's make sure this user has the right permissions if ($jzUSER->getSetting("view") === false) { echo "must log in (user=x&pass=y)"; exit; } // Let's create our services object // This object lets us do things like get metadata, resize images, get lyrics, etc $jzSERVICES = new jzServices(); $jzSERVICES->loadStandardServices(); $display = new jzDisplay(); if (isset($_GET['page'])) { $args = $_GET; unset($args['page']); $func = 'jzApi_' . $_GET['page']; } else { $args = array(); $func = 'jzApi_main';
</tr><?php } else { ?> <input type="hidden" name="field1" value="jznoupd"> <?php } ?> <tr> <td width="30%" valign="top" align="right"> <?php echo word("Full Name"); ?> : </td> <td width="70%"> <input type="input" name="fullname" class="jz_input" value="<?php echo $jzUSER2->getSetting('fullname'); ?> "> </td> </tr> <tr> <td width="30%" valign="top" align="right"> <?php echo word("Email Address"); ?> : </td> <td width="70%"> <input type="input" name="email" class="jz_input" value="<?php echo $jzUSER2->getSetting('email'); ?>
// -type (is this a track or a node? default: assume node.) // -playlist (if this is set, ignore path) // // image [for displaying images; this makes it possible for images to not be in the webroot] // -path (image path) // // The following are for GD-based resizing, NOT HTML tag resizing: // -width (resize the width) // -height (resize the height) // -constrain (constrained resize) if (!isset($_GET['action'])) { $_GET['action'] = "play"; } // Handle $resample $resample = isset($_GET['resample']) ? $_GET['resample'] : false; if ($jzUSER->getSetting('resample_lock')) { $resample = $jzUSER->getSetting('resample_rate'); } if (isset($no_resample_subnets) && $no_resample_subnets != "" && preg_match("/^{$no_resample_subnets}\$/", $_SERVER['REMOTE_ADDR'])) { $resample = false; } switch ($_GET['action']) { // play a track: case "play": if (!(isset($_GET['jz_path']) || isset($_GET['file']))) { exit; } // send file directly, not with path: if (isset($_GET['file'])) { if (preg_match("/\\.({$audio_types})\$/i", $_GET['fname'])) { sendMedia($_GET['file'], $_GET['fname'], $resample);
/** * Universal Constructor for a jzMediaElement * * @author Ben Dodson * @version 5/13/04 * @since 5/13/04 */ function _constructor($arg = array(), $mode) { global $backend, $include_path, $jzUSER; if (!isset($jzUSER)) { $jzUSER = new jzUser(false); $remove_user = true; } else { $remove_user = false; } $this->data_dir = $include_path . "data/{$backend}"; if ($mode == "filename") { $arg = $this->filenameToPath($arg); } else { if ($mode != "path") { $arg = $this->idToPath($arg); } } if (is_string($arg)) { // make sure it's well formatted. if ($arg != "") { if ($arg[0] == "/") { $arg = substr($arg, 1); } if ($arg[strlen($arg) - 1] == "/") { $arg = substr($arg, 0, strlen($arg) - 1); } } // root? if ($arg == "") { $dir = $jzUSER->getSetting('home_dir'); if ($dir === false || $jzUSER->getSetting('home_read') === false) { $this->path = array(); $this->name = ""; } else { $this->path = explode("/", $dir); $this->name = $this->path[sizeof($this->path) - 1]; } } else { $arrayize = explode("/", $arg); $this->path = $arrayize; $this->name = $arrayize[sizeof($arrayize) - 1]; } } else { if ($arg == array()) { $dir = $jzUSER->getSetting('home_dir'); if ($dir === false || $jzUSER->getSetting('home_read') === false) { $this->path = array(); $this->name = ""; } else { $this->path = explode("/", $dir); $this->name = $this->path[sizeof($this->path) - 1]; } } else { $this->name = $arg[sizeof($arg) - 1]; $this->path = $arg; } } if ($remove_user) { unset($jzUSER); } }
$params = array(); $params['limit'] = $limit; if (empty($_REQUEST['request']) && (isset($_REQUEST['query']) || isset($_REQUEST['search']))) { $_REQUEST['request'] = 'search'; } // Non authenticated API requests. switch ($_REQUEST['request']) { case "trackinfo": return trackInfo(); break; case "gettrackart": return getTrackArt(); break; } // Let's make sure this user has the right permissions if ($jzUSER->getSetting("view") === false || isset($_REQUEST['user'])) { if (isset($_REQUEST['user'])) { $store_cookie = true; // Are they ok? $prehashed = isset($_REQUEST['pw_hashed']) && $_REQUEST['pw_hashed'] == 'true'; if ($jzUSER->login($_REQUEST['user'], $_REQUEST['pass'], $store_cookie, $prehashed) === false) { echoXMLHeader(); echo "<login>false</login>"; echoXMLFooter(); exit; } } else { // Nope, error... echoXMLHeader(); echo "<login>false</login>"; echoXMLFooter();
} else { ?> <input type="hidden" name="field1" value="jznoupd"> <input type="hidden" name="field2" value="jznoupd"> <?php } ?> <tr> <td width="30%" valign="top" align="right"> <?php echo word("Full Name"); ?> : </td> <td width="70%"> <input type="input" name="fullname" class="jz_input" value="<?php echo $jzUSER2->getSetting('fullname'); ?> "> </td> </tr> <tr> <td width="30%" valign="top" align="right"> <?php echo word("Email Address"); ?> : </td> <td width="70%"> <input type="input" name="email" class="jz_input" value="<?php echo $jzUSER2->getSetting('email'); ?>