diff options
-rw-r--r-- | albums.php | 23 | ||||
-rw-r--r-- | lib/class/access.class.php | 42 | ||||
-rw-r--r-- | lib/class/album.class.php | 33 | ||||
-rw-r--r-- | lib/class/rating.class.php | 12 | ||||
-rw-r--r-- | lib/class/user.class.php | 26 | ||||
-rw-r--r-- | lib/general.lib.php | 25 | ||||
-rw-r--r-- | lib/preferences.php | 8 | ||||
-rw-r--r-- | lib/rating.lib.php | 2 | ||||
-rw-r--r-- | lib/themes.php | 23 | ||||
-rw-r--r-- | lib/ui.lib.php | 2 | ||||
-rw-r--r-- | login.php | 2 | ||||
-rw-r--r-- | play/index.php | 6 | ||||
-rw-r--r-- | preferences.php | 22 | ||||
-rw-r--r-- | stream.php | 4 | ||||
-rw-r--r-- | templates/show_album.inc | 32 | ||||
-rw-r--r-- | templates/show_object_rating.inc.php | 6 | ||||
-rw-r--r-- | templates/show_preference_box.inc.php | 10 | ||||
-rw-r--r-- | templates/show_preferences.inc.php (renamed from templates/show_preferences.inc) | 21 |
18 files changed, 117 insertions, 182 deletions
@@ -21,23 +21,10 @@ require_once 'lib/init.php'; -show_template('header'); - -// We'll set any input parameters here -if(!isset($_REQUEST['match'])) { $_REQUEST['match'] = "Browse"; } -if(isset($_REQUEST['match'])) $match = scrub_in($_REQUEST['match']); -if(isset($_REQUEST['album'])) $album = scrub_in($_REQUEST['album']); -if(isset($_REQUEST['artist'])) $artist = scrub_in($_REQUEST['artist']); -$_REQUEST['artist_id'] = scrub_in($_REQUEST['artist_id']); -$min_album_size = conf('min_object_count'); -if ($min_album_size == '') { - $min_album_size = '0'; -} - -$action = scrub_in($_REQUEST['action']); +require_once Config::get('prefix') . '/templates/header.inc.php'; /* Switch on Action */ -switch ($action) { +switch ($_REQUEST['action']) { case 'clear_art': if (!$GLOBALS['user']->has_access('75')) { access_denied(); } $album = new Album($_REQUEST['album_id']); @@ -48,12 +35,10 @@ switch ($action) { $album = new Album($_REQUEST['album']); $album->format(); - require (conf('prefix') . '/templates/show_album.inc'); + require Config::get('prefix') . '/templates/show_album.inc'; /* Get the song ids for this album */ - $song_ids = $album->get_song_ids($_REQUEST['artist']); - - show_songs($song_ids,0,$album); + $song_ids = $album->get_songs(0,$_REQUEST['artist']); break; // Upload album art case 'upload_art': diff --git a/lib/class/access.class.php b/lib/class/access.class.php index fc01adfb..dae463de 100644 --- a/lib/class/access.class.php +++ b/lib/class/access.class.php @@ -144,26 +144,50 @@ class Access { $db_results = mysql_query($sql, dbh()); } // delete + + /** + * check_function + * This checks if a specific functionality is enabled + * it takes a type only + */ + public static function check_function($type) { + + switch ($type) { + case 'batch_download': + if (!function_exists('gzcompress')) { + debug_event('gzcompress','ZLIB Extensions not loaded, batch download disabled','3'); + return false; + } + if (Config::get('allow_zip_download') AND $GLOBALS['user']->has_access(25)) { + return $GLOBALS['user']->prefs['download']; + } + break; + default: + return false; + break; + } // end switch + + } // check_function /** - * check + * check_network * This takes a type, ip, user, level and key * and then returns true or false if they have access to this * the IP is passed as a dotted quad */ - public static function check($type,$ip,$user,$level,$key='') { + public static function check_network($type,$ip,$user,$level,$key='') { // They aren't using access control // lets just keep on trucking - if (!conf('access_control')) { + if (!Config::get('access_control')) { return true; } // Clean incomming variables $ip = ip2int($ip); - $user = sql_escape($user); - $key = sql_escape($key); - $level = sql_escape($level); + $user = Dba::escape($user); + $key = Dba::escape($key); + $level = Dba::escape($level); switch ($type) { /* This is here because we want to at least check IP before even creating the xml-rpc server @@ -190,10 +214,10 @@ class Access { break; } // end switch on type - $db_results = mysql_query($sql, dbh()); + $db_results = Dba::query($sql); // Yah they have access they can use the mojo - if (mysql_fetch_row($db_results)) { + if (Dba::fetch_row($db_results)) { return true; } @@ -202,7 +226,7 @@ class Access { return false; } - } // check + } // check_network /** * validate_type diff --git a/lib/class/album.class.php b/lib/class/album.class.php index 5e44af8b..72abfab4 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -97,11 +97,15 @@ class Album { * get_songs * gets the songs for this album */ - public function get_songs($limit = 0) { + public function get_songs($limit = 0,$artist='') { $results = array(); + + if ($artist) { + $artist_sql = "AND `artist`='" . Dba::escape($artist) . "'"; + } - $sql = "SELECT `id` FROM `song` WHERE `album`='$this->id' ORDER BY `track`, `title`"; + $sql = "SELECT `id` FROM `song` WHERE `album`='$this->id' $artist_sql ORDER BY `track`, `title`"; if ($limit) { $sql .= " LIMIT $limit"; } $db_results = Dba::query($sql); @@ -114,31 +118,6 @@ class Album { } // get_songs /** - * get_song_ids - * This returns an array of the song id's that are on this album. This is used by the - * show_songs function and can be pased and artist if you so desire to limit it to that - */ - function get_song_ids($artist='') { - - /* If they pass an artist then constrain it based on the artist as well */ - if ($artist) { - $artist_sql = " AND artist='" . sql_escape($artist) . "'"; - } - - $sql = "SELECT id FROM song WHERE album='" . sql_escape($this->id) . "' $artist_sql ORDER BY track"; - $db_results = mysql_query($sql, dbh()); - - $results = array(); - - while ($r = mysql_fetch_assoc($db_results)) { - $results[] = $r['id']; - } - - return $results; - - } // get_song_ids - - /** * format * This is the format function for this object. It sets cleaned up * albumĀ information with the base required diff --git a/lib/class/rating.class.php b/lib/class/rating.class.php index 32a85253..43200f90 100644 --- a/lib/class/rating.class.php +++ b/lib/class/rating.class.php @@ -41,7 +41,7 @@ class Rating { function Rating($id,$type) { $this->id = intval($id); - $this->type = sql_escape($type); + $this->type = Dba::escape($type); // Check for the users rating if ($rating = $this->get_user($GLOBALS['user']->id)) { @@ -62,12 +62,12 @@ class Rating { */ function get_user($user_id) { - $user_id = sql_escape($user_id); + $user_id = Dba::escape($user_id); $sql = "SELECT rating FROM ratings WHERE user='$user_id' AND object_id='$this->id' AND object_type='$this->type'"; - $db_results = mysql_query($sql, dbh()); + $db_results = Dba::query($sql); - $results = mysql_fetch_assoc($db_results); + $results = Dba::fetch_assoc($db_results); return $results['rating']; @@ -83,11 +83,11 @@ class Rating { function get_average() { $sql = "SELECT user_rating as rating FROM ratings WHERE object_id='$this->id' AND object_type='$this->type'"; - $db_results = mysql_query($sql, dbh()); + $db_results = Dba::query($sql); $i = 0; - while ($r = mysql_fetch_assoc($db_results)) { + while ($r = Dba::fetch_assoc($db_results)) { $i++; $total += $r['rating']; } // while we're pulling results diff --git a/lib/class/user.class.php b/lib/class/user.class.php index e50b6bb8..d678ad1c 100644 --- a/lib/class/user.class.php +++ b/lib/class/user.class.php @@ -111,36 +111,36 @@ class User { * []['admin'] = t/f value if this is an admin only section */ function get_preferences($user_id=0,$type=0) { - - if (!$user_id) { - $user_id = $this->id; - } + + // Fill out the user id + $user_id = $user_id ? Dba::escape($user_id) : Dba::escape($this->id); - if (!conf('use_auth')) { $user_id = '-1'; } + if (!Config::get('use_auth')) { $user_id = '-1'; } if ($user_id != '-1') { $user_limit = "AND preferences.catagory != 'system'"; } - + if ($type != '0') { - $user_limit = "AND preferences.catagory = '" . sql_escape($type) . "'"; + $user_limit = "AND preferences.catagory = '" . Dba::escape($type) . "'"; } - $sql = "SELECT preferences.name, preferences.description, preferences.catagory, user_preference.value FROM preferences,user_preference " . - "WHERE user_preference.user='$user_id' AND user_preference.preference=preferences.id $user_limit ORDER BY id"; - $db_results = mysql_query($sql, dbh()); + $sql = "SELECT preferences.name, preferences.description, preferences.catagory, user_preference.value " . + "FROM preferences RIGHT JOIN user_preference ON user_preference.preference=preferences.id " . + "WHERE user_preference.user='$user_id' $user_limit"; + $db_results = Dba::query($sql); /* Ok this is crapy, need to clean this up or improve the code FIXME */ - while ($r = mysql_fetch_assoc($db_results)) { + while ($r = Dba::fetch_assoc($db_results)) { $type = $r['catagory']; $admin = false; if ($type == 'system') { $admin = true; } - $type_array[$type][] = array('name'=>$r['name'],'description'=>$r['description'],'value'=>$r['value']); + $type_array[$type][$r['name']] = array('name'=>$r['name'],'description'=>$r['description'],'value'=>$r['value']); + ksort($type_array[$type]); $results[$type] = array ('title'=>ucwords($type),'admin'=>$admin,'prefs'=>$type_array[$type]); } // end while - return $results; } // get_preferences diff --git a/lib/general.lib.php b/lib/general.lib.php index bff578a1..ff641e6f 100644 --- a/lib/general.lib.php +++ b/lib/general.lib.php @@ -279,27 +279,6 @@ function scrub_in($str) { } // scrub_in /*! - @function batch_ok() - @discussion return boolean if user can batch download - //FIXME: This needs to be fixed, it shouldn't be an independent function - //FIXME: It should reference a central one maybe the access object? -*/ -function batch_ok( ) { - - /* Also make sure that they have ZLIB */ - if (!function_exists('gzcompress')) { return false; } - - // i check this before showing any link - // should make it easy to tie to a new pref if you choose to add it - if (conf('allow_zip_download') AND $GLOBALS['user']->has_access(25)) { - return( $GLOBALS['user']->prefs['download'] ); - } // if allowed zip downloads - - return false; - -} // batch_ok - -/*! @function set_memory_limit @discussion this function attempts to change the php memory limit using init_set but it will @@ -664,7 +643,7 @@ function make_bool($string) { function get_languages() { /* Open the locale directory */ - $handle = @opendir(conf('prefix') . '/locale'); + $handle = @opendir(Config::get('prefix') . '/locale'); if (!is_resource($handle)) { debug_event('language','Error unable to open locale directory','1'); @@ -677,7 +656,7 @@ function get_languages() { while ($file = readdir($handle)) { - $full_file = conf('prefix') . '/locale/' . $file; + $full_file = Config::get('prefix') . '/locale/' . $file; /* Check to see if it's a directory */ if (is_dir($full_file) AND substr($file,0,1) != '.' AND $file != 'base') { diff --git a/lib/preferences.php b/lib/preferences.php index 7e8cc62c..5fb1a696 100644 --- a/lib/preferences.php +++ b/lib/preferences.php @@ -268,16 +268,16 @@ function create_preference_input($name,$value) { else { $is_stream = "selected=\"selected\""; } echo "<select name=\"$name\">\n"; echo "\t<option value=\"\">" . _('None') . "</option>\n"; - if (conf('allow_stream_playback')) { + if (Config::get('allow_stream_playback')) { echo "\t<option value=\"stream\" $is_stream>" . _('Stream') . "</option>\n"; } - if (conf('allow_downsample_playback')) { + if (Config::get('allow_downsample_playback')) { echo "\t<option value=\"downsample\" $is_down>" . _('Downsample') . "</option>\n"; } - if (conf('allow_democratic_playback')) { + if (Config::get('allow_democratic_playback')) { echo "\t<option value=\"democratic\" $is_vote>" . _('Democratic') . "</option>\n"; } - if (conf('allow_localplay_playback')) { + if (Config::get('allow_localplay_playback')) { echo "\t<option value=\"localplay\" $is_local>" . _('Localplay') . "</option>\n"; } echo "\t<option value=\"xspf_player\" $is_xspf_player>" . _('XSPF Player') . "</option>\n"; diff --git a/lib/rating.lib.php b/lib/rating.lib.php index ee589618..8dee7c8e 100644 --- a/lib/rating.lib.php +++ b/lib/rating.lib.php @@ -27,7 +27,7 @@ function show_rating($object_id,$type) { $rating = new Rating($object_id,$type); - include(conf('prefix') . '/templates/show_object_rating.inc.php'); + require Config::get('prefix') . '/templates/show_object_rating.inc.php'; } // show_rating diff --git a/lib/themes.php b/lib/themes.php index f2f27740..d7b23ace 100644 --- a/lib/themes.php +++ b/lib/themes.php @@ -20,31 +20,32 @@ */ -/*! - @function get_themes() - @discussion this looks in /themes and pulls all of the - theme.cfg.php files it can find and returns an - array of the results -*/ +/** + * get_themes + * this looks in /themes and pulls all of the + * theme.cfg.php files it can find and returns an + * array of the results + */ function get_themes() { /* Open the themes dir and start reading it */ - $handle = @opendir(conf('prefix') . "/themes"); + $handle = @opendir(Config::get('prefix') . '/themes'); if (!is_resource($handle)) { - debug_event('theme',"Error unable to open Themes Directory",'2'); + debug_event('theme',"Error unable to open Themes Directory",'2'); + return array(); } $results = array(); while ($file = readdir($handle)) { - $full_file = conf('prefix') . "/themes/" . $file; + $full_file = Config::get('prefix') . '/themes/' . $file; /* See if it's a directory */ if (is_dir($full_file) AND substr($file,0,1) != ".") { - $config_file = $full_file . "/theme.cfg.php"; + $config_file = $full_file . '/theme.cfg.php'; /* Open the theme.cfg.php file */ - $r = read_config($config_file); + $r = @parse_ini_file($config_file); $r['path'] = $file; $name = $r['name']; $results[$name] = $r; diff --git a/lib/ui.lib.php b/lib/ui.lib.php index 9c7fd148..af88b29e 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -837,7 +837,7 @@ function get_location() { */ function show_preference_box($preferences) { - include (conf('prefix') . '/templates/show_preference_box.inc.php'); + require Config::get('prefix') . '/templates/show_preference_box.inc.php'; } // show_preference_box @@ -35,7 +35,7 @@ init_preferences(); * page if they aren't in the ACL */ if (Config::get('access_control')) { - if (!Access::check('interface',$_SERVER['REMOTE_ADDR'],'','5')) { + if (!Access::check_network('interface',$_SERVER['REMOTE_ADDR'],'','5')) { debug_event('access_denied','Access Denied:' . $_SERVER['REMOTE_ADDR'] . ' is not in the Interface Access list','3'); access_denied(); } diff --git a/play/index.php b/play/index.php index be0848c1..694eea71 100644 --- a/play/index.php +++ b/play/index.php @@ -82,8 +82,8 @@ if (Config::get('demo_mode') || (!$GLOBALS['user']->has_access('25') && !$xml_rp that they have enough access to play this mojo */ if (Config::get('access_control')) { - if (!Access::check('stream',$_SERVER['REMOTE_ADDR'],$GLOBALS['user']->username,'25') AND - !Access::check('network',$_SERVER['REMOTE_ADDR'],$GLOBALS['user']->username,'25')) { + if (!Access::check_network('stream',$_SERVER['REMOTE_ADDR'],$GLOBALS['user']->username,'25') AND + !Access::check_network('network',$_SERVER['REMOTE_ADDR'],$GLOBALS['user']->username,'25')) { debug_event('access_denied', "Streaming Access Denied: " . $_SERVER['REMOTE_ADDR'] . " does not have stream level access",'3'); access_denied(); exit; @@ -196,7 +196,7 @@ if (Config::get('track_user_ip')) { /* If access control is on and they aren't local, downsample! */ if (Config::get('access_control') AND Config::get('downsample_remote')) { - if (!$access->check('network',$_SERVER['REMOTE_ADDR'],$GLOBALS['user']->username,'25')) { + if (Access::check_network('network',$_SERVER['REMOTE_ADDR'],$GLOBALS['user']->username,'25')) { $not_local = true; } } // if access_control diff --git a/preferences.php b/preferences.php index b5b92c0e..8f8423c2 100644 --- a/preferences.php +++ b/preferences.php @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2006 Ampache.org + Copyright (c) 2001 - 2007 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -20,24 +20,18 @@ */ -/*! - @header Preferences page - Preferences page for whole site, and where - the admins do editing of other users preferences - -*/ - -require('lib/init.php'); +require 'lib/init.php'; /* Scrub in the needed mojo */ if (!$_REQUEST['tab']) { $_REQUEST['tab'] = 'interface'; } $user_id = scrub_in($_REQUEST['user_id']); - -switch(scrub_in($_REQUEST['action'])) { +// Switch on the action +switch($_REQUEST['action']) { case 'update_user': /* Verify permissions */ - if (!$GLOBALS['user']->has_access(25) || conf('demo_mode') || ($GLOBALS['user']->id != $user_id && !$GLOBALS['user']->has_access(100))) { + if (!$GLOBALS['user']->has_access(25) || Config::get('demo_mode') || + ($GLOBALS['user']->id != $user_id && !$GLOBALS['user']->has_access(100))) { show_access_denied(); exit(); } @@ -95,14 +89,14 @@ else { // HEADER -show_template('header'); +require_once Config::get('prefix') . '/templates/header.inc.php'; // HEADER // Set Target $target = "/preferences.php"; // Show the default preferences page -require (conf('prefix') . "/templates/show_preferences.inc"); +require Config::get('prefix') . '/templates/show_preferences.inc.php'; // FOOTER @@ -89,7 +89,7 @@ switch ($action) { break; case 'artist': $artist = new Artist($_REQUEST['artist_id']); - $song_ids = $artist->get_song_ids(); + $song_ids = $artist->get_songs(); break; case 'artist_random': $artist = new Artist($_REQUEST['artist_id']); @@ -102,7 +102,7 @@ switch ($action) { break; case 'album': $album = new Album($_REQUEST['album_id']); - $song_ids = $album->get_song_ids(); + $song_ids = $album->get_songs(); break; case 'random_genre': $genre = new Genre($_REQUEST['genre']); diff --git a/templates/show_album.inc b/templates/show_album.inc index 903eedf1..72c39ca5 100644 --- a/templates/show_album.inc +++ b/templates/show_album.inc @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2006 Ampache.org + Copyright (c) 2001 - 2007 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -18,21 +18,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*! - @header Show Album - @discussion shows a single album -*/ -$web_path = conf('web_path'); -// Build array of the table classes we are using -$row_classes = array('even','odd'); -//FIXME: -$album_id = $album->id; -$artist_id = $album->artist_id; -$username = $GLOBALS['user']->username; +$web_path = Config::get('web_path'); + +// Title for this album $title = scrub_out($album->name) . ' -- ' . $album->f_artist; ?> -<?php require (conf('prefix') . '/templates/show_box_top.inc.php'); ?> +<?php show_box_top($title); ?> <div style="float:left;display:table-cell;width:140px;"> <?php if ($album_name != "Unknown (Orphaned)") { @@ -45,24 +37,24 @@ $title = scrub_out($album->name) . ' -- ' . $album->f_artist; </div> <div style="display:table-cell;vertical-align:top;"> <?php - if (conf('ratings')) { + if (Config::get('ratings')) { echo "<div style=\"float:left; display:inline;\" id=\"rating_" . $album->id . "_album\">"; show_rating($album->id, 'album');} // end if ratings echo "</div>"; echo "<br />\n"; ?> <strong><?php echo _('Actions'); ?>:</strong><br /> - <a href="<?php echo $web_path; ?>/song.php?action=album&album_id=<?php echo $album->id; ?>"><?php echo _("Play Album"); ; ?></a><br /> - <a href="<?php echo $web_path; ?>/song.php?action=album_random&album_id=<?php echo $album->id; ?>"><?php echo _("Play Random from Album"); ; ?></a><br /> - <?php if ( ($GLOBALS['user']->has_access('75')) || (!conf('use_auth'))) { ?> + <a href="<?php echo $web_path; ?>/stream.php?action=album&album_id=<?php echo $album->id; ?>"><?php echo _("Play Album"); ; ?></a><br /> + <a href="<?php echo $web_path; ?>/stream.php?action=album_random&album_id=<?php echo $album->id; ?>"><?php echo _("Play Random from Album"); ; ?></a><br /> + <?php if ( ($GLOBALS['user']->has_access('75')) || (!Config::get('use_auth'))) { ?> <a href="<?php echo $web_path; ?>/albums.php?action=clear_art&album_id=<?php echo $album->id; ?>"><?php echo _("Reset Album Art"); ; ?></a><br /> <?php } ?> <a href="<?php echo $web_path; ?>/albums.php?action=find_art&album_id=<?php echo $album->id; ?>"><?php echo _("Find Album Art"); ; ?></a><br /> - <?php if (($GLOBALS['user']->has_access('100')) || (!conf('use_auth'))) { ?> + <?php if (($GLOBALS['user']->has_access('100')) || (!Config::get('use_auth'))) { ?> <a href="<?php echo $web_path; ?>/albums.php?action=update_from_tags&album_id=<?php echo $album->id; ?>"><?php echo _("Update from tags"); ?></a><br /> <?php } ?> - <?php if (batch_ok()) { ?> + <?php if (Access::check_function('batch_download')) { ?> <a href="<?php echo $web_path; ?>/batch.php?action=alb&id=<?php echo $album->id; ?>"><?php echo _('Download'); ?></a><br /> <?php } ?> </div> -<?php require (conf('prefix') . '/templates/show_box_bottom.inc.php'); ?> +<?php show_box_bottom(); ?> diff --git a/templates/show_object_rating.inc.php b/templates/show_object_rating.inc.php index 5f4de7c7..9de4c0b8 100644 --- a/templates/show_object_rating.inc.php +++ b/templates/show_object_rating.inc.php @@ -1,6 +1,6 @@ <?php /* - Copyright 2001 - 2006 Ampache.org + Copyright 2001 - 2007 Ampache.org All Rights Reserved This program is free software; you can redistribute it and/or @@ -19,8 +19,8 @@ */ /* Create some variables we are going to need */ -$web_path = conf('web_path'); -$base_url = conf('ajax_url') . '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id . conf('ajax_info'); +$web_path = Config::get('web_path'); +$base_url = Config::get('ajax_url') . '?action=set_rating&rating_type=' . $rating->type . '&object_id=' . $rating->id . Config::get('ajax_info'); //set the background to no stars diff --git a/templates/show_preference_box.inc.php b/templates/show_preference_box.inc.php index 60dfee51..eedaa2b7 100644 --- a/templates/show_preference_box.inc.php +++ b/templates/show_preference_box.inc.php @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2006 Ampache.org + Copyright (c) 2001 - 2007 Ampache.org All rights reserved This program is free software; you can redistribute it and/or @@ -19,16 +19,10 @@ */ -/*! - @header Show Preferences - @discussion shows a single preference box - -*/ - /* I'm cheating a little here, check to see if we want to show the * Apply to All button on this page */ -if ($GLOBALS['user']->has_access(100) AND conf('use_auth')) { +if ($GLOBALS['user']->has_access(100) AND Config::get('use_auth')) { $show_apply_to_all = true; } ?> diff --git a/templates/show_preferences.inc b/templates/show_preferences.inc.php index 6514d88f..22843bfb 100644 --- a/templates/show_preferences.inc +++ b/templates/show_preferences.inc.php @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2006 Ampache.org + Copyright (c) 2001 - 2007 Ampache.org All rights reserved This program is free software; you can redistribute it and/or @@ -19,12 +19,6 @@ */ -/*! - @header Show Preferences - @discussion shows edit page for preferences - -*/ - /** * This page has a few tabs, as such we need to figure out which tab we are on * and display the information accordingly @@ -33,26 +27,19 @@ $current_tab = scrub_in($_REQUEST['tab']); if (!$current_tab) { $current_tab = 'interface'; } // HORRIBLE HACK! if ($_REQUEST['action'] == 'user') { $action_txt = '&action=user'; } -$link = conf('web_path') . $target; +$link = Config::get('web_path') . $target; /* CSS construction bs */ $link_active = "a_" . $current_tab; ${$link_active} = "id=\"current\""; $tab_active = "tab_" .$current_tab; ${$tab_active} = "id=\"tabactive\""; - -/* I'm cheating a little here, check to see if we want to show the - * Apply to All button on this page - */ -if (($GLOBALS['user']->has_access(100)) AND ($user_id == '-1' AND conf('use_auth'))) { - $show_apply_to_all = true; -} ?> <?php show_box_top(); ?> <span class="header1"> <?php echo _('Editing'); ?> <?php echo $fullname; ?> <?php echo _('preferences'); ?> <?php if ($GLOBALS['user']->has_access(100)) { ?> -[<a href="<?php echo conf('web_path'); ?>/admin/preferences.php?action=fix_preferences&user_id=<?php echo $user_id; ?>"><?php echo _("Rebuild Preferences"); ?></a>] +[<a href="<?php echo Config::get('web_path'); ?>/admin/preferences.php?action=fix_preferences&user_id=<?php echo $user_id; ?>"><?php echo _('Rebuild Preferences'); ?></a>] <?php } ?> </span> @@ -83,7 +70,7 @@ if (($GLOBALS['user']->has_access(100)) AND ($user_id == '-1' AND conf('use_auth </ul> </div> <div class="text-box" style="width:45em;"> -<form method="post" name="preferences" action="<?php echo conf('web_path'); ?><?php echo $target; ?>" enctype="multipart/form-data"> +<form method="post" name="preferences" action="<?php echo Config::get('web_path'); ?><?php echo $target; ?>" enctype="multipart/form-data"> <?php if ($current_tab != 'account' && $current_tab != 'modules') { show_preference_box($preferences[$current_tab]); |