1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 01:39:28 +02:00

major corrections to reading of preferences and a few misc fixes which I have now forgotten

This commit is contained in:
Karl 'vollmerk' Vollmer 2008-02-29 06:14:46 +00:00
parent c1f2b35e2a
commit 2c337852cf
27 changed files with 329 additions and 478 deletions

View file

@ -4,6 +4,8 @@
--------------------------------------------------------------------------
v.3.4-Beta2
- Added Catalog Last Update and Last Add times to API Handshake.
- Fixed Remember Me Cookie so it's actually set
- Removed some invalid queries that were not needed, tweaked logic
of no_session to avoid useless query
- Added Greek Translation ( Thx Panayotis Tsirigotis )

View file

@ -145,7 +145,7 @@ class Access {
return false;
}
if (Config::get('allow_zip_download') AND $GLOBALS['user']->has_access(25)) {
return $GLOBALS['user']->prefs['download'];
return Config::get('download');
}
break;
default:
@ -237,7 +237,7 @@ class Access {
switch ($type) {
case 'localplay':
// Check their localplay_level
if ($GLOBALS['user']->prefs['localplay_level'] >= $level) {
if (Config::get('localplay_level') >= $level) {
return true;
}
else {

View file

@ -86,13 +86,19 @@ class Api {
$data['type'] = 'api';
$data['value'] = $timestamp;
$token = vauth::session_create($data);
// Insert the token into the streamer
$stream = new Stream();
$stream->user_id = $client->id;
$stream->insert_session($token);
debug_event('API','Login Success, passphrase matched','1');
return array('auth'=>$token,'api'=>self::$version);
// We need to also get the 'last update' of the catalog information in an RFC 2822 Format
$sql = "SELECT MAX(`last_update`) AS `update`,MAX(`last_add`) AS `add` FROM `catalog`";
$db_results = Dba::query($sql);
$row = Dba::fetch_assoc($db_results);
return array('auth'=>$token,'api'=>self::$version,'update'=>date("r",$row['update']),'add'=>date("r",$row['add']));
} // match
} // end while

View file

@ -671,7 +671,7 @@ class Browse {
self::$total_objects = count($object_ids);
// Limit is based on the users preferences
$limit = $GLOBALS['user']->prefs['offset_limit'] ? $GLOBALS['user']->prefs['offset_limit'] : '25';
$limit = Config::get('offset_limit') ? Config::get('offset_limit') : '25';
if (count($object_ids) > self::$start) {
$object_ids = array_slice($object_ids,self::$start,$limit);

View file

@ -206,7 +206,7 @@ class Localplay {
$this->_player->uninstall();
// If its our current player, reset player to nothing
if ($GLOBALS['user']->prefs['localplay_controller'] == $this->type) {
if (Config::get('localplay_controller') == $this->type) {
Preference::update('localplay_controller',$GLOBALS['user']->id,'');
}

View file

@ -47,7 +47,7 @@ class metadata {
// For now it's only mystrands
OpenStrands::set_auth_token(Config::get('mystrands_developer_key'));
$openstrands = new OpenStrands($GLOBALS['user']->prefs['mystrands_user'],$GLOBALS['user']->prefs['mystrands_pass']);
$openstrands = new OpenStrands(Config::get('mystrands_user'),Config::get('mystrands_pass'));
// Make sure auth worked
if (!$openstrands) { return false; }
@ -101,7 +101,7 @@ class metadata {
// For now it's only mystrands
OpenStrands::set_auth_token(Config::get('mystrands_developer_key'));
$openstrands = new OpenStrands($GLOBALS['user']->prefs['mystrands_user'],$GLOBALS['user']->prefs['mystrands_pass']);
$openstrands = new OpenStrands(Config::get('mystrands_user'),Config::get('mystrands_pass'));
if (!$openstrands) { return false; }

View file

@ -223,9 +223,6 @@ class Stream {
}
$song = new Song($song_id);
if ($song->type == ".flac") { $song->type = ".ogg"; }
if ($GLOBALS['user']->prefs['play_type'] == 'downsample') {
$ds = $GLOBALS['user']->prefs['sample_rate'];
}
echo $song->get_url();
} // end foreach
@ -408,7 +405,7 @@ class Stream {
//FIXME: This needs to go in a template, here for now though
//FIXME: This preference doesn't even exists, we'll eventually
//FIXME: just make it the default
if ($GLOBALS['user']->prefs['embed_xspf'] == 1 ){
if (Config::get('embed_xspf') == 1 ){
header("Location: ".Config::get('web_path')."/index.php?xspf&play_info=".$GLOBALS['user']->playlist->id);
}
else {
@ -446,7 +443,7 @@ class Stream {
function create_localplay() {
// First figure out what their current one is and create the object
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$localplay->connect();
//HACK!!!
// Yea.. you know the baby jesus... he's crying right meow
@ -526,7 +523,7 @@ class Stream {
$max_bitrate = Config::get('max_bit_rate');
$min_bitrate = Config::get('min_bit_rate');
$time = time();
$user_sample_rate = $GLOBALS['user']->prefs['sample_rate'];
$user_sample_rate = Config::get('sample_rate');
$browser = new Browser();
if (!$song_name) {
@ -705,9 +702,9 @@ class Stream {
if (AJAX_INCLUDE != '1') { return false; }
// If we're doin the flash magic then run away as well
if ($GLOBALS['user']->prefs['play_type'] == 'xspf_player') { return false; }
if (Config::get('play_type') == 'xspf_player') { return false; }
switch ($GLOBALS['user']->prefs['playlist_method']) {
switch (Config::get('playlist_method')) {
default:
case 'clear':
case 'default':

View file

@ -236,7 +236,7 @@ class vauth {
$session_name = Config::get('session_name');
Config::set('cookie_life',$remember_length,'1');
setcookie($session_name . '_remember',"Rappelez-vous, rappelez-vous le 27 mars",time() + $remember_length,'/',Config::get('cookie_domain'));
setcookie($session_name . '_remember',"Rappelez-vous, rappelez-vous le 27 mars",time() + $remember_length,'/');
} // create_remember_cookie
@ -301,13 +301,6 @@ class vauth {
// No cookie n go!
if (!isset($_COOKIE[$session_name])) { return false; }
$key = scrub_in($_COOKIE[$session_name]);
$data = self::get_session_data($key);
if (!is_array($data)) {
return false;
}
// Check for a remember me
if (isset($_COOKIE[$session_name . '_remember'])) {
self::create_remember_cookie();

View file

@ -144,6 +144,7 @@ require_once $prefix . '/modules/infotools/openstrands.class.php';
$results = Preference::fix_preferences($results);
Config::set_by_array($results,1);
debug_event('ZZWANG IS',$wang,'1');
// Modules (These are conditionaly included depending upon config values)
if (Config::get('ratings')) {
@ -219,11 +220,10 @@ elseif (!Config::get('use_auth')) {
// If Auth, but no session is set
else {
if (isset($_REQUEST['sessid'])) {
$sess_results = vauth::get_session_data($_REQUEST['sessid']);
session_name(Config::get('session_name'));
session_id(scrub_in($_REQUEST['sessid']));
session_start();
$GLOBALS['user'] = User::get_from_username($sess_results['username']);
$GLOBALS['user'] = User::get_from_username($_SESSION['userdata']['username']);
}
else {
$GLOBALS['user'] = new User();
@ -264,5 +264,4 @@ if (! preg_match('/update\.php/', $_SERVER['PHP_SELF'])) {
// For the XMLRPC stuff
$GLOBALS['xmlrpc_internalencoding'] = Config::get('site_charset');
?>

View file

@ -1,136 +0,0 @@
<?php
/*
Copyright (c) 2001 - 2006 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.
*/
/**
* insert_locaplay_preferences
* This takes a controller type and inserts the preferences
* Into the database, it is able to handle existing preferences
* It checks before inserting...
*/
function insert_localplay_preferences($type) {
/* We can't assume the connect so let's just
* create it then get the preferences
*/
$localplay = new Localplay($type);
$preferences = $localplay->get_preferences();
foreach ($preferences as $preference) {
$name = 'localplay_' . $type . '_' . $preference['name'];
/* Check for an existing record */
$sql = "SELECT id FROM preferences WHERE name = '" . sql_escape($name) . "'";
$db_results = mysql_query($sql, dbh());
if (mysql_num_rows($db_results)) { continue; }
insert_preference($name,$preference['description'],$preference['default'],'25',$preference['type'],'streaming');
} // end foreach preferences
/* Fix everyones preferences */
$sql = "SELECT * FROM `user`";
$db_results = Dba::query($sql);
$temp_user = new User();
$temp_user->fix_preferences('-1');
while ($r = mysql_fetch_assoc($db_results)) {
$temp_user->fix_preferences($r['username']);
} // end while
return true;
} // insert_localplay_preferences
/**
* remove_localplay_preferences
* This function has two uses, if it is called with a specific type then it
* just removes the preferences for that type, however it if its called with
* nothing then it removes any set of preferences where the module no longer
* exists
*/
function remove_localplay_preferences($type=0) {
/* If we've gotten a type wipe and go! */
if ($type) {
$sql = "DELETE FROM preferences WHERE name LIKE 'localplay_" . sql_escape($type) . "_%'";
$db_results = mysql_query($sql, dbh());
return true;
}
/* Select everything but our two built-in ones
$sql = "SELECT * FROM preferences WHERE name != 'localplay_level' AND name != 'localplay_controller' AND name LIKE 'localplay_%'";
$db_results = mysql_query($sql, dbh());
$results = array();
/* We need to organize by module to make it easy
* to figure out which modules no longer exist
* and wack the preferences... unless we've
* specified a name then just wack those
* preferences
*/
while ($r = mysql_fetch_assoc($db_results)) {
$name = $r['name'];
preg_match("/localplay_([\w\d\-\]+)_.+/",$name,$matches);
$key = $matches['1'];
$results[$key] = $r;
} // end while
/* If we've got a type */
//FIXME!!!
} // remove_localplay_preferences
/**
* This function stores the Localplay object
* It checks to see what access level you have
* and creates the localplay object based on that
* @package Local Play
*/
function init_localplay($reload=0) {
static $localplay;
if ($GLOBALS['user']->prefs['localplay_level'] == '0') { return false; }
if (!strlen($GLOBALS['user']->prefs['localplay_controller'])) { return false; }
if ($GLOBALS['user']->prefs['localplay_level'] == '1' AND !is_object($localplay)) {
$localplay = new Localplay(conf('localplay_controller'));
$localplay->connect();
}
if ($GLOBALS['user']->prefs['localplay_level'] == '2' AND !is_object($localplay)) {
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay->connect();
}
return $localplay;
} // function init_localplay
?>

View file

@ -35,7 +35,7 @@ switch ($_REQUEST['action']) {
if (!Access::check('localplay','75')) { access_denied(); break; }
// Get the current localplay fields
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$fields = $localplay->get_instance_fields();
require_once Config::get('prefix') . '/templates/show_localplay_add_instance.inc.php';
break;
@ -44,20 +44,20 @@ switch ($_REQUEST['action']) {
if (!Access::check('localplay','75')) { access_denied(); break; }
// Setup the object
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$localplay->add_instance($_POST);
break;
case 'update_instance':
// Make sure they gots them rights
if (!Access::check('localplay','75')) { access_denied(); break; }
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$localplay->update_instance($_REQUEST['instance'],$_POST);
header("Location:" . Config::get('web_path') . "/localplay.php?action=show_instances");
break;
case 'edit_instance':
// Check to make sure they've got the access
if (!Access::check('localplay','75')) { access_denied(); break; }
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$instance = $localplay->get_instance($_REQUEST['instance']);
$fields = $localplay->get_instance_fields();
require_once Config::get('prefix') . '/templates/show_localplay_edit_instance.inc.php';
@ -65,7 +65,7 @@ switch ($_REQUEST['action']) {
case 'show_instances':
// First build the localplay object and then get the instances
if (!Access::check('localplay','5')) { access_denied(); break; }
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$instances = $localplay->get_instances();
$fields = $localplay->get_instance_fields();
require_once Config::get('prefix') . '/templates/show_localplay_instances.inc.php';
@ -74,7 +74,7 @@ switch ($_REQUEST['action']) {
case 'show_playlist':
if (!Access::check('localplay','5')) { access_denied(); break; }
// Init and then connect to our localplay instance
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$localplay->connect();
// Pull the current playlist and require the template

View file

@ -228,7 +228,7 @@ class AmpacheHttpq extends localplay_controller {
*/
public function get_instance($instance='') {
$instance = $instance ? $instance : $GLOBALS['user']->prefs['httpq_active'];
$instance = $instance ? $instance : Config::get('httpq_active');
$instance = Dba::escape($instance);
$sql = "SELECT * FROM `localplay_httpq` WHERE `id`='$instance'";

View file

@ -191,7 +191,7 @@ class AmpacheMpd extends localplay_controller {
*/
public function get_instance($instance='') {
$instance = $instance ? $instance : $GLOBALS['user']->prefs['mpd_active'];
$instance = $instance ? $instance : Config::get('mpd_active');
$instance = Dba::escape($instance);
$sql = "SELECT * FROM `localplay_mpd` WHERE `id`='$instance'";

File diff suppressed because it is too large Load diff

View file

@ -181,7 +181,7 @@ $song_name = $song->f_artist_full . " - " . $song->title . "." . $song->type;
/* If they are just trying to download make sure they have rights
* and then present them with the download file
*/
if ($_GET['action'] == 'download' AND $GLOBALS['user']->prefs['download']) {
if ($_GET['action'] == 'download' AND Config::get('download')) {
// STUPID IE
$song->format_pattern();
@ -199,9 +199,9 @@ if ($_GET['action'] == 'download' AND $GLOBALS['user']->prefs['download']) {
}
// Check to see if we should be throttling because we can get away with it
if ($GLOBALS['user']->prefs['rate_limit'] > 0) {
if (Config::get('rate_limit') > 0) {
while (!feof($fp)) {
echo fread($fp,round($GLOBALS['user']->prefs['rate_limit']*1024));
echo fread($fp,round(Config::get('rate_limit')*1024));
flush();
sleep(1);
}
@ -247,7 +247,7 @@ if (Config::get('downsample_remote')) {
} // if downsample remote is enabled
// If they are downsampling, or if the song is not a native stream or it's non-local
if (($GLOBALS['user']->prefs['transcode'] == 'always' || !$song->native_stream() || $not_local) && $GLOBALS['user']->prefs['transcode'] != 'never') {
if ((Config::get('transcode') == 'always' || !$song->native_stream() || $not_local) && Config::get('transcode') != 'never') {
debug_event('downsample','Starting Downsample...','5');
$fp = Stream::start_downsample($song,$lastid,$song_name,$start);
$song_name = $song->f_artist_full . " - " . $song->title . "." . $song->type;
@ -340,7 +340,7 @@ else {
/* Clean up any open ends */
if ($GLOBALS['user']->prefs['play_type'] == 'downsample' || !$song->native_stream()) {
if (Config::get('play_type') == 'downsample' || !$song->native_stream()) {
@pclose($fp);
}
else {

View file

@ -1,7 +1,7 @@
<?php
/*
Copyright (c) 2001 - 2007 Ampache.org
Copyright (c) 2001 - 2008 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or

View file

@ -34,7 +34,7 @@ switch ($_REQUEST['action']) {
$type = $_REQUEST['instance'] ? 'localplay' : 'stream';
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$localplay->set_active_instance($_REQUEST['instance']);
Preference::update('play_type',$GLOBALS['user']->id,$type);
@ -54,7 +54,7 @@ switch ($_REQUEST['action']) {
exit;
}
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$localplay->connect();
// Switch on valid commands
@ -102,7 +102,7 @@ switch ($_REQUEST['action']) {
debug_event('DENIED','Attempted to delete track without access','1');
exit;
}
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$localplay->connect();
// Scrub in the delete request
@ -129,7 +129,7 @@ switch ($_REQUEST['action']) {
}
// Scrub it in
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$localplay->delete_instance($_REQUEST['instance']);
$key = 'localplay_instance_' . $_REQUEST['instance'];
@ -143,7 +143,7 @@ switch ($_REQUEST['action']) {
}
// Scrub her in
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$localplay->connect();
$localplay->repeat(make_bool($_REQUEST['value']));
@ -161,7 +161,7 @@ switch ($_REQUEST['action']) {
}
// Scrub her in
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$localplay->connect();
$localplay->random(make_bool($_REQUEST['value']));

View file

@ -57,7 +57,7 @@ switch ($_REQUEST['action']) {
case 'basket':
// We need to set the basket up!
$_SESSION['iframe']['target'] = Config::get('web_path') . '/stream.php?action=basket&playlist_method=' . scrub_out($_REQUEST['playlist_method']);
$results['rfc3514'] = '<script type="text/javascript">reload_util("'.$_SESSION['iframe']['target'].'")</script>';
$results['rfc3514'] = '<script type="text/javascript">reload_util(\''.$_SESSION['iframe']['target'] . '\');</script>';
break;
default:
$results['rfc3514'] = '0x1';

View file

@ -1,7 +1,7 @@
<?php
/*
Copyright (c) 2001 - 2007 ampache.org
Copyright (c) 2001 - 2008 ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
@ -18,11 +18,11 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once 'lib/init.php';
/* If we are running a demo, quick while you still can! */
if (Config::get('demo_mode') || !$GLOBALS['user']->has_access('25')) {
access_denied();
exit;
}
@ -62,7 +62,7 @@ switch ($_REQUEST['action']) {
} // end foreach
// Check to see if 'clear' was passed if it was then we need to reset the basket
if ( ($_REQUEST['playlist_method'] == 'clear' || $GLOBALS['user']->prefs['playlist_method'] == 'clear') AND $GLOBALS['user']->prefs['play_method'] != 'xspf_player') {
if ( ($_REQUEST['playlist_method'] == 'clear' || Config::get('playlist_method') == 'clear') AND Config::get('play_method') != 'xspf_player') {
$GLOBALS['user']->playlist->clear();
}
@ -179,15 +179,15 @@ switch ($_REQUEST['method']) {
break;
case 'democratic':
// Don't let them loop it
if ($GLOBALS['user']->prefs['play_type'] == 'democratic') {
$GLOBALS['user']->prefs['play_type'] = 'stream';
if (Config::get('play_type') == 'democratic') {
Config::set('play_type','stream','1');
}
default:
if ($GLOBALS['user']->prefs['play_type'] == 'stream') {
$stream_type = $GLOBALS['user']->prefs['playlist_type'];
if (Config::get('play_type') == 'stream') {
$stream_type = Config::get('playlist_type');
}
else {
$stream_type = $GLOBALS['user']->prefs['play_type'];
$stream_type = Config::get('play_type');
}
break;
}

View file

@ -27,7 +27,7 @@
*/
// Pull these variables out to allow shorthand (easier for lazy programmers)
$limit = $GLOBALS['user']->prefs['offset_limit'] ? $GLOBALS['user']->prefs['offset_limit'] : '25';
$limit = Config::get('offset_limit') ? Config::get('offset_limit') : '25';
$start = Browse::$start;
$total = Browse::$total_objects;
$uid = Config::get('list_header_uid');

View file

@ -70,7 +70,7 @@
</ul>
</li>
</ul>
<?php if ($GLOBALS['user']->prefs['play_type'] == 'localplay') { require_once Config::get('prefix') . '/templates/show_localplay_control.inc.php'; } ?>
<?php if (Config::get('play_type') == 'localplay') { require_once Config::get('prefix') . '/templates/show_localplay_control.inc.php'; } ?>
<ul id="rb_current_playlist">
<?php
//FIXME :: this feels kludgy

View file

@ -1,47 +0,0 @@
<?php
/*
Copyright (c) 2001 - 2006 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.
*/
$web_path = conf('web_path');
$localplay = init_localplay();
?>
<?php show_box_top(ucfirst($localplay->type) . ' ' . _('Localplay')); ?>
<table>
<tr>
<td valign="top">
<strong><?php echo _('Actions'); ?>:</strong><br />
<?php if ($localplay->has_function('delete_all')) { ?>
<div><a class="button" href="<?php echo $web_path; ?>/localplay.php?action=delete_all"><?php echo _('Clear Playlist'); ?></a></div>
<?php } ?>
</td><td>
<?php $add_info = "&amp;return=1"; ?>
<?php require_once(conf('prefix') . '/templates/show_localplay_status.inc.php'); ?>
</td>
</tr>
</table>
<?php show_box_bottom(); ?>
<?php show_box_top(_('Current Playlist')); ?>
<div id="lp_playlist">
<?php require_once(conf('prefix') . '/templates/show_localplay_playlist.inc.php'); ?>
</div>
<?php show_box_bottom(); ?>

View file

@ -28,7 +28,7 @@
<td class="cel_track"><?php echo $song->f_track; ?></td>
<td class="cel_time"><?php echo $song->f_time; ?></td>
<td class="cel_action">
<?php if ($GLOBALS['user']->prefs['download']) { ?>
<?php if (Config::get('download')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&amp;song_id=<?php echo $song->id; ?>">
<?php echo get_user_icon('download',_('Download')); ?>
</a>

View file

@ -20,7 +20,7 @@
*/
?>
<?php
$name = "is_" . $GLOBALS['user']->prefs['play_type'];
$name = "is_" . Config::get('play_type');
${$name} = 'selected="selected" ';
if (Preference::has_access('play_type')) {
@ -42,6 +42,6 @@ if (Preference::has_access('play_type')) {
<?php
} // if they have access
// Else just show what it currently is
else { echo ucwords($GLOBALS['user']->prefs['play_type']);}
else { echo ucwords(Config::get('play_type'));}
?>
</div>

View file

@ -37,7 +37,7 @@
<?php echo get_user_icon('comment',_('Post Shout')); ?>
</a>
<?php } ?>
<?php if ($GLOBALS['user']->prefs['download']) { ?>
<?php if (Config::get('download')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&amp;song_id=<?php echo $song->id; ?>">
<?php echo get_user_icon('download',_('Download')); ?>
</a>

View file

@ -18,14 +18,13 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
?>
<ul class="sb2" id="sb_localplay">
<?php if (Config::get('allow_localplay_playback') AND $GLOBALS['user']->prefs['localplay_controller'] AND Access::check('localplay','5')) { ?>
<?php if (Config::get('allow_localplay_playback') AND Config::get('localplay_controller') AND Access::check('localplay','5')) { ?>
<?php
// Little bit of work to be done here
$localplay = new Localplay($GLOBALS['user']->prefs['localplay_controller']);
$localplay = new Localplay(Config::get('localplay_controller'));
$current_instance = $localplay->current_instance();
$class = $current_instance ? '' : ' class="active_instance"';
?>

View file

@ -18,6 +18,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
$wang = 'util';
require_once 'lib/init.php';
header("Expires: Tuesday, 27 Mar 1984 05:00:00 GMT");