mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 09:49:30 +02:00
Rename Config class to AmpConfig class to avoid conflict with PEAR (fix #68)
This commit is contained in:
parent
d0726e70b7
commit
5eceaf2aea
254 changed files with 1149 additions and 1149 deletions
|
@ -36,11 +36,11 @@ switch ($_REQUEST['action']) {
|
|||
exit;
|
||||
}
|
||||
Access::delete($_REQUEST['access_id']);
|
||||
$url = Config::get('web_path') . '/admin/access.php';
|
||||
$url = AmpConfig::get('web_path') . '/admin/access.php';
|
||||
show_confirmation(T_('Deleted'), T_('Your Access List Entry has been removed'),$url);
|
||||
break;
|
||||
case 'show_delete_record':
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
$access = new Access($_GET['access_id']);
|
||||
show_confirmation(T_('Deletion Request'), T_('Are you sure you want to permanently delete') . ' ' . $access->name,
|
||||
'admin/access.php?action=delete_record&access_id=' . $access->id,1,'delete_access');
|
||||
|
@ -68,11 +68,11 @@ switch ($_REQUEST['action']) {
|
|||
}
|
||||
|
||||
if (!Error::occurred()) {
|
||||
$url = Config::get('web_path') . '/admin/access.php';
|
||||
$url = AmpConfig::get('web_path') . '/admin/access.php';
|
||||
show_confirmation(T_('Added'), T_('Your new Access Control List(s) have been created'),$url);
|
||||
} else {
|
||||
$action = 'show_add_' . $_POST['type'];
|
||||
require_once Config::get('prefix') . '/templates/show_add_access.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_add_access.inc.php';
|
||||
}
|
||||
break;
|
||||
case 'update_record':
|
||||
|
@ -83,10 +83,10 @@ switch ($_REQUEST['action']) {
|
|||
$access = new Access($_REQUEST['access_id']);
|
||||
$access->update($_POST);
|
||||
if (!Error::occurred()) {
|
||||
show_confirmation(T_('Updated'), T_('Access List Entry updated'), Config::get('web_path').'/admin/access.php');
|
||||
show_confirmation(T_('Updated'), T_('Access List Entry updated'), AmpConfig::get('web_path').'/admin/access.php');
|
||||
} else {
|
||||
$access->format();
|
||||
require_once Config::get('prefix') . '/templates/show_edit_access.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_edit_access.inc.php';
|
||||
}
|
||||
break;
|
||||
case 'show_add_current':
|
||||
|
@ -94,17 +94,17 @@ switch ($_REQUEST['action']) {
|
|||
case 'show_add_local':
|
||||
case 'show_add_advanced':
|
||||
$action = $_REQUEST['action'];
|
||||
require_once Config::get('prefix') . '/templates/show_add_access.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_add_access.inc.php';
|
||||
break;
|
||||
case 'show_edit_record':
|
||||
$access = new Access($_REQUEST['access_id']);
|
||||
$access->format();
|
||||
require_once Config::get('prefix') . '/templates/show_edit_access.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_edit_access.inc.php';
|
||||
break;
|
||||
default:
|
||||
$list = array();
|
||||
$list = Access::get_access_lists();
|
||||
require_once Config::get('prefix') .'/templates/show_access_list.inc.php';
|
||||
require_once AmpConfig::get('prefix') .'/templates/show_access_list.inc.php';
|
||||
break;
|
||||
} // end switch on action
|
||||
UI::show_footer();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
require_once '../lib/init.php';
|
||||
require_once Config::get('prefix') . '/modules/catalog/local.catalog.php';
|
||||
require_once AmpConfig::get('prefix') . '/modules/catalog/local.catalog.php';
|
||||
|
||||
if (!Access::check('interface','100')) {
|
||||
UI::access_denied();
|
||||
|
@ -37,14 +37,14 @@ switch ($_REQUEST['action']) {
|
|||
case 'add_to_catalog':
|
||||
toggle_visible('ajax-loading');
|
||||
ob_end_flush();
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
if ($_REQUEST['catalogs']) {
|
||||
foreach ($_REQUEST['catalogs'] as $catalog_id) {
|
||||
$catalog = Catalog::create_from_id($catalog_id);
|
||||
$catalog->add_to_catalog($_POST);
|
||||
}
|
||||
}
|
||||
$url = Config::get('web_path') . '/admin/catalog.php';
|
||||
$url = AmpConfig::get('web_path') . '/admin/catalog.php';
|
||||
$title = T_('Catalog Updated');
|
||||
$body = '';
|
||||
show_confirmation($title, $body, $url);
|
||||
|
@ -56,7 +56,7 @@ switch ($_REQUEST['action']) {
|
|||
toggle_visible('ajax-loading');
|
||||
ob_end_flush();
|
||||
/* If they are in demo mode stop here */
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
|
||||
if (isset($_REQUEST['catalogs'])) {
|
||||
foreach ($_REQUEST['catalogs'] as $catalog_id) {
|
||||
|
@ -64,7 +64,7 @@ switch ($_REQUEST['action']) {
|
|||
$catalog->verify_catalog();
|
||||
}
|
||||
}
|
||||
$url = Config::get('web_path') . '/admin/catalog.php';
|
||||
$url = AmpConfig::get('web_path') . '/admin/catalog.php';
|
||||
$title = T_('Catalog Updated');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url);
|
||||
|
@ -74,7 +74,7 @@ switch ($_REQUEST['action']) {
|
|||
toggle_visible('ajax-loading');
|
||||
ob_end_flush();
|
||||
/* Make sure they aren't in demo mode */
|
||||
if (Config::get('demo_mode')) { UI::access_denied(); break; }
|
||||
if (AmpConfig::get('demo_mode')) { UI::access_denied(); break; }
|
||||
|
||||
if (!$_REQUEST['catalogs']) {
|
||||
$_REQUEST['catalogs'] = Catalog::get_catalogs();
|
||||
|
@ -90,7 +90,7 @@ switch ($_REQUEST['action']) {
|
|||
$catalog->add_to_catalog();
|
||||
}
|
||||
Dba::optimize_tables();
|
||||
$url = Config::get('web_path') . '/admin/catalog.php';
|
||||
$url = AmpConfig::get('web_path') . '/admin/catalog.php';
|
||||
$title = T_('Catalog Updated');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url);
|
||||
|
@ -98,7 +98,7 @@ switch ($_REQUEST['action']) {
|
|||
break;
|
||||
case 'delete_catalog':
|
||||
/* Make sure they aren't in demo mode */
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
|
||||
if (!Core::form_verify('delete_catalog')) {
|
||||
UI::access_denied();
|
||||
|
@ -107,17 +107,17 @@ switch ($_REQUEST['action']) {
|
|||
|
||||
/* Delete the sucker, we don't need to check perms as thats done above */
|
||||
Catalog::delete($_GET['catalog_id']);
|
||||
$next_url = Config::get('web_path') . '/admin/catalog.php';
|
||||
$next_url = AmpConfig::get('web_path') . '/admin/catalog.php';
|
||||
show_confirmation(T_('Catalog Deleted'), T_('The Catalog and all associated records have been deleted'),$next_url);
|
||||
break;
|
||||
case 'show_delete_catalog':
|
||||
$catalog_id = scrub_in($_GET['catalog_id']);
|
||||
|
||||
$next_url = Config::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalog_id=' . scrub_out($catalog_id);
|
||||
$next_url = AmpConfig::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalog_id=' . scrub_out($catalog_id);
|
||||
show_confirmation(T_('Catalog Delete'), T_('Confirm Deletion Request'),$next_url,1,'delete_catalog');
|
||||
break;
|
||||
case 'remove_disabled':
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
|
||||
$song = $_REQUEST['song'];
|
||||
|
||||
|
@ -127,7 +127,7 @@ switch ($_REQUEST['action']) {
|
|||
} else {
|
||||
$body = T_('No Songs Removed');
|
||||
}
|
||||
$url = Config::get('web_path') . '/admin/catalog.php';
|
||||
$url = AmpConfig::get('web_path') . '/admin/catalog.php';
|
||||
$title = T_ngettext('Disabled Song Processed','Disabled Songs Processed',count($song));
|
||||
show_confirmation($title,$body,$url);
|
||||
break;
|
||||
|
@ -137,7 +137,7 @@ switch ($_REQUEST['action']) {
|
|||
toggle_visible('ajax-loading');
|
||||
ob_end_flush();
|
||||
/* If they are in demo mode stop them here */
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
|
||||
// Make sure they checked something
|
||||
if (isset($_REQUEST['catalogs'])) {
|
||||
|
@ -148,7 +148,7 @@ switch ($_REQUEST['action']) {
|
|||
Dba::optimize_tables();
|
||||
}
|
||||
|
||||
$url = Config::get('web_path') . '/admin/catalog.php';
|
||||
$url = AmpConfig::get('web_path') . '/admin/catalog.php';
|
||||
$title = T_('Catalog Cleaned');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url);
|
||||
|
@ -156,18 +156,18 @@ switch ($_REQUEST['action']) {
|
|||
break;
|
||||
case 'update_catalog_settings':
|
||||
/* No Demo Here! */
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
|
||||
/* Update the catalog */
|
||||
Catalog::update_settings($_POST);
|
||||
|
||||
$url = Config::get('web_path') . '/admin/catalog.php';
|
||||
$url = AmpConfig::get('web_path') . '/admin/catalog.php';
|
||||
$title = T_('Catalog Updated');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url);
|
||||
break;
|
||||
case 'update_from':
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
|
||||
// First see if we need to do an add
|
||||
if ($_POST['add_path'] != '/' AND strlen($_POST['add_path'])) {
|
||||
|
@ -189,7 +189,7 @@ switch ($_REQUEST['action']) {
|
|||
break;
|
||||
case 'add_catalog':
|
||||
/* Wah Demo! */
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
|
||||
ob_end_flush();
|
||||
|
||||
|
@ -212,7 +212,7 @@ switch ($_REQUEST['action']) {
|
|||
$catalog_id = Catalog::create($_POST);
|
||||
|
||||
if (!$catalog_id) {
|
||||
require Config::get('prefix') . '/templates/show_add_catalog.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_add_catalog.inc.php';
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -227,55 +227,55 @@ switch ($_REQUEST['action']) {
|
|||
Error::display('catalog_add');
|
||||
UI::show_box_bottom();
|
||||
|
||||
show_confirmation('','', Config::get('web_path').'/admin/catalog.php');
|
||||
show_confirmation('','', AmpConfig::get('web_path').'/admin/catalog.php');
|
||||
|
||||
} else {
|
||||
require Config::get('prefix') . '/templates/show_add_catalog.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_add_catalog.inc.php';
|
||||
}
|
||||
break;
|
||||
case 'clear_stats':
|
||||
if (Config::get('demo_mode')) { UI::access_denied(); break; }
|
||||
if (AmpConfig::get('demo_mode')) { UI::access_denied(); break; }
|
||||
Stats::clear();
|
||||
$url = Config::get('web_path') . '/admin/catalog.php';
|
||||
$url = AmpConfig::get('web_path') . '/admin/catalog.php';
|
||||
$title = T_('Catalog statistics cleared');
|
||||
$body = '';
|
||||
show_confirmation($title, $body, $url);
|
||||
break;
|
||||
default:
|
||||
case 'show_catalogs':
|
||||
require_once Config::get('prefix') . '/templates/show_manage_catalogs.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_manage_catalogs.inc.php';
|
||||
break;
|
||||
case 'show_add_catalog':
|
||||
require Config::get('prefix') . '/templates/show_add_catalog.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_add_catalog.inc.php';
|
||||
break;
|
||||
case 'clear_now_playing':
|
||||
if (Config::get('demo_mode')) { UI::access_denied(); break; }
|
||||
if (AmpConfig::get('demo_mode')) { UI::access_denied(); break; }
|
||||
Stream::clear_now_playing();
|
||||
show_confirmation(T_('Now Playing Cleared'), T_('All now playing data has been cleared'),Config::get('web_path') . '/admin/catalog.php');
|
||||
show_confirmation(T_('Now Playing Cleared'), T_('All now playing data has been cleared'),AmpConfig::get('web_path') . '/admin/catalog.php');
|
||||
break;
|
||||
case 'show_disabled':
|
||||
/* Stop the demo hippies */
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
|
||||
$songs = Song::get_disabled();
|
||||
if (count($songs)) {
|
||||
require Config::get('prefix') . '/templates/show_disabled_songs.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_disabled_songs.inc.php';
|
||||
} else {
|
||||
echo "<div class=\"error\" align=\"center\">" . T_('No Disabled songs found') . "</div>";
|
||||
}
|
||||
break;
|
||||
case 'show_delete_catalog':
|
||||
/* Stop the demo hippies */
|
||||
if (Config::get('demo_mode')) { UI::access_denied(); break; }
|
||||
if (AmpConfig::get('demo_mode')) { UI::access_denied(); break; }
|
||||
|
||||
$catalog = Catalog::create_from_id($_REQUEST['catalog_id']);
|
||||
$nexturl = Config::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalog_id=' . scrub_out($_REQUEST['catalog_id']);
|
||||
$nexturl = AmpConfig::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalog_id=' . scrub_out($_REQUEST['catalog_id']);
|
||||
show_confirmation(T_('Delete Catalog'), T_('Do you really want to delete this catalog?') . " -- $catalog->name ($catalog->path)",$nexturl,1);
|
||||
break;
|
||||
case 'show_customize_catalog':
|
||||
$catalog = Catalog::create_from_id($_REQUEST['catalog_id']);
|
||||
$catalog->format();
|
||||
require_once Config::get('prefix') . '/templates/show_edit_catalog.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_edit_catalog.inc.php';
|
||||
break;
|
||||
case 'gather_album_art':
|
||||
toggle_visible('ajax-loading');
|
||||
|
@ -286,11 +286,11 @@ switch ($_REQUEST['action']) {
|
|||
// Iterate throught the catalogs and gather as needed
|
||||
foreach ($catalogs as $catalog_id) {
|
||||
$catalog = Catalog::create_from_id($catalog_id);
|
||||
require Config::get('prefix') . '/templates/show_gather_art.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_gather_art.inc.php';
|
||||
flush();
|
||||
$catalog->gather_art();
|
||||
}
|
||||
$url = Config::get('web_path') . '/admin/catalog.php';
|
||||
$url = AmpConfig::get('web_path') . '/admin/catalog.php';
|
||||
$title = T_('Album Art Search Finished');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url);
|
||||
|
|
|
@ -34,11 +34,11 @@ switch ($_REQUEST['action']) {
|
|||
case 'find_duplicates':
|
||||
$search_type = $_REQUEST['search_type'];
|
||||
$duplicates = Song::find_duplicates($search_type);
|
||||
require_once Config::get('prefix') . '/templates/show_duplicate.inc.php';
|
||||
require_once Config::get('prefix') . '/templates/show_duplicates.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_duplicate.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_duplicates.inc.php';
|
||||
break;
|
||||
default:
|
||||
require_once Config::get('prefix') . '/templates/show_duplicate.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_duplicate.inc.php';
|
||||
break;
|
||||
} // end switch on action
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ switch ($_REQUEST['action']) {
|
|||
|
||||
break;
|
||||
default:
|
||||
require_once Config::get('prefix') . '/templates/show_export.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_export.inc.php';
|
||||
break;
|
||||
} // end switch on action
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ UI::show_header();
|
|||
// Action switch
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'send_mail':
|
||||
if (Config::get('demo_mode')) {
|
||||
if (AmpConfig::get('demo_mode')) {
|
||||
UI::access_denied();
|
||||
exit;
|
||||
}
|
||||
|
@ -63,12 +63,12 @@ switch ($_REQUEST['action']) {
|
|||
$title = T_('E-mail Not Sent');
|
||||
$body = T_('Your E-mail was not sent.');
|
||||
}
|
||||
$url = Config::get('web_path') . '/admin/mail.php';
|
||||
$url = AmpConfig::get('web_path') . '/admin/mail.php';
|
||||
show_confirmation($title,$body,$url);
|
||||
|
||||
break;
|
||||
default:
|
||||
require_once Config::get('prefix') . '/templates/show_mail_users.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_mail_users.inc.php';
|
||||
break;
|
||||
} // end switch
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ switch ($_REQUEST['action']) {
|
|||
Preference::update('localplay_level',$GLOBALS['user']->id,'100');
|
||||
Preference::update('localplay_controller',$GLOBALS['user']->id,$localplay->type);
|
||||
|
||||
header("Location:" . Config::get('web_path') . '/admin/modules.php?action=show_localplay');
|
||||
header("Location:" . AmpConfig::get('web_path') . '/admin/modules.php?action=show_localplay');
|
||||
break;
|
||||
case 'install_catalog_type':
|
||||
$type = scrub_in($_REQUEST['type']);
|
||||
|
@ -62,21 +62,21 @@ switch ($_REQUEST['action']) {
|
|||
$catalog->install();
|
||||
|
||||
/* Show Confirmation */
|
||||
$url = Config::get('web_path') . '/admin/modules.php?action=show_catalog_types';
|
||||
$url = AmpConfig::get('web_path') . '/admin/modules.php?action=show_catalog_types';
|
||||
$title = T_('Plugin Installed');
|
||||
$body = '';
|
||||
show_confirmation($title ,$body, $url);
|
||||
break;
|
||||
case 'confirm_uninstall_localplay':
|
||||
$type = scrub_in($_REQUEST['type']);
|
||||
$url = Config::get('web_path') . '/admin/modules.php?action=uninstall_localplay&type=' . $type;
|
||||
$url = AmpConfig::get('web_path') . '/admin/modules.php?action=uninstall_localplay&type=' . $type;
|
||||
$title = T_('Are you sure you want to remove this plugin?');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url,1);
|
||||
break;
|
||||
case 'confirm_uninstall_catalog_type':
|
||||
$type = scrub_in($_REQUEST['type']);
|
||||
$url = Config::get('web_path') . '/admin/modules.php?action=uninstall_catalog_type&type=' . $type;
|
||||
$url = AmpConfig::get('web_path') . '/admin/modules.php?action=uninstall_catalog_type&type=' . $type;
|
||||
$title = T_('Are you sure you want to remove this plugin?');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url,1);
|
||||
|
@ -88,7 +88,7 @@ switch ($_REQUEST['action']) {
|
|||
$localplay->uninstall();
|
||||
|
||||
/* Show Confirmation */
|
||||
$url = Config::get('web_path') . '/admin/modules.php?action=show_localplay';
|
||||
$url = AmpConfig::get('web_path') . '/admin/modules.php?action=show_localplay';
|
||||
$title = T_('Plugin Deactivated');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url);
|
||||
|
@ -105,7 +105,7 @@ switch ($_REQUEST['action']) {
|
|||
$catalog->uninstall();
|
||||
|
||||
/* Show Confirmation */
|
||||
$url = Config::get('web_path') . '/admin/modules.php?action=show_catalog_types';
|
||||
$url = AmpConfig::get('web_path') . '/admin/modules.php?action=show_catalog_types';
|
||||
$title = T_('Plugin Deactivated');
|
||||
$body = '';
|
||||
show_confirmation($title, $body, $url);
|
||||
|
@ -120,7 +120,7 @@ switch ($_REQUEST['action']) {
|
|||
$plugin = new Plugin($_REQUEST['plugin']);
|
||||
if (!$plugin->install()) {
|
||||
debug_event('plugins','Error: Plugin Install Failed, ' . $_REQUEST['plugin'],'1');
|
||||
$url = Config::get('web_path') . '/admin/modules.php?action=show_plugins';
|
||||
$url = AmpConfig::get('web_path') . '/admin/modules.php?action=show_plugins';
|
||||
$title = T_('Unable to Install Plugin');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url);
|
||||
|
@ -131,14 +131,14 @@ switch ($_REQUEST['action']) {
|
|||
User::rebuild_all_preferences();
|
||||
|
||||
/* Show Confirmation */
|
||||
$url = Config::get('web_path') . '/admin/modules.php?action=show_plugins';
|
||||
$url = AmpConfig::get('web_path') . '/admin/modules.php?action=show_plugins';
|
||||
$title = T_('Plugin Activated');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url);
|
||||
break;
|
||||
case 'confirm_uninstall_plugin':
|
||||
$plugin = scrub_in($_REQUEST['plugin']);
|
||||
$url = Config::get('web_path') . '/admin/modules.php?action=uninstall_plugin&plugin=' . $plugin;
|
||||
$url = AmpConfig::get('web_path') . '/admin/modules.php?action=uninstall_plugin&plugin=' . $plugin;
|
||||
$title = T_('Are you sure you want to remove this plugin?');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url,1);
|
||||
|
@ -157,7 +157,7 @@ switch ($_REQUEST['action']) {
|
|||
User::rebuild_all_preferences();
|
||||
|
||||
/* Show Confirmation */
|
||||
$url = Config::get('web_path') . '/admin/modules.php?action=show_plugins';
|
||||
$url = AmpConfig::get('web_path') . '/admin/modules.php?action=show_plugins';
|
||||
$title = T_('Plugin Deactivated');
|
||||
$body = '';
|
||||
show_confirmation($title,$body,$url);
|
||||
|
@ -172,7 +172,7 @@ switch ($_REQUEST['action']) {
|
|||
$plugin = new Plugin($_REQUEST['plugin']);
|
||||
$plugin->upgrade();
|
||||
User::rebuild_all_preferences();
|
||||
$url = Config::get('web_path') . '/admin/modules.php?action=show_plugins';
|
||||
$url = AmpConfig::get('web_path') . '/admin/modules.php?action=show_plugins';
|
||||
$title = T_('Plugin Upgraded');
|
||||
$body = '';
|
||||
show_confirmation($title, $body, $url);
|
||||
|
@ -180,19 +180,19 @@ switch ($_REQUEST['action']) {
|
|||
case 'show_plugins':
|
||||
$plugins = Plugin::get_plugins();
|
||||
UI::show_box_top(T_('Plugins'), 'box box_localplay_plugins');
|
||||
require_once Config::get('prefix') . '/templates/show_plugins.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_plugins.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'show_localplay':
|
||||
$controllers = Localplay::get_controllers();
|
||||
UI::show_box_top(T_('Localplay Controllers'), 'box box_localplay_controllers');
|
||||
require_once Config::get('prefix') . '/templates/show_localplay_controllers.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_localplay_controllers.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'show_catalog_types':
|
||||
$catalogs = Catalog::get_catalog_types();
|
||||
UI::show_box_top(T_('Catalog Types'), 'box box_catalog_types');
|
||||
require_once Config::get('prefix') . '/templates/show_catalog_types.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_catalog_types.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -34,7 +34,7 @@ switch ($_REQUEST['action']) {
|
|||
case 'edit_shout':
|
||||
$shout_id = $_POST['shout_id'];
|
||||
$update = Shoutbox::update($_POST);
|
||||
show_confirmation(T_('Shoutbox Post Updated'),'',Config::get('web_path').'/admin/shout.php');
|
||||
show_confirmation(T_('Shoutbox Post Updated'),'',AmpConfig::get('web_path').'/admin/shout.php');
|
||||
break;
|
||||
case 'show_edit':
|
||||
$shout = new Shoutbox($_REQUEST['shout_id']);
|
||||
|
@ -42,11 +42,11 @@ switch ($_REQUEST['action']) {
|
|||
$object->format();
|
||||
$client = new User($shout->user);
|
||||
$client->format();
|
||||
require_once Config::get('prefix') . '/templates/show_edit_shout.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_edit_shout.inc.php';
|
||||
break;
|
||||
case 'delete':
|
||||
$shout_id = Shoutbox::delete($_REQUEST['shout_id']);
|
||||
show_confirmation(T_('Shoutbox Post Deleted'),'',Config::get('web_path').'/admin/shout.php');
|
||||
show_confirmation(T_('Shoutbox Post Deleted'),'',AmpConfig::get('web_path').'/admin/shout.php');
|
||||
break;
|
||||
default:
|
||||
$browse = new Browse();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
require_once '../lib/init.php';
|
||||
|
||||
if (!Access::check('interface',100) OR Config::get('demo_mode')) {
|
||||
if (!Access::check('interface',100) OR AmpConfig::get('demo_mode')) {
|
||||
UI::access_denied();
|
||||
exit();
|
||||
}
|
||||
|
@ -36,20 +36,20 @@ switch ($_REQUEST['action']) {
|
|||
*/
|
||||
case 'generate_config':
|
||||
ob_end_clean();
|
||||
$current = parse_ini_file(Config::get('prefix') . '/config/ampache.cfg.php');
|
||||
$current = parse_ini_file(AmpConfig::get('prefix') . '/config/ampache.cfg.php');
|
||||
$final = generate_config($current);
|
||||
$browser = new Horde_Browser();
|
||||
$browser->downloadHeaders('ampache.cfg.php','text/plain',false,filesize(Config::get('prefix') . '/config/ampache.cfg.php.dist'));
|
||||
$browser->downloadHeaders('ampache.cfg.php','text/plain',false,filesize(AmpConfig::get('prefix') . '/config/ampache.cfg.php.dist'));
|
||||
echo $final;
|
||||
exit;
|
||||
break;
|
||||
case 'reset_db_charset':
|
||||
Dba::reset_db_charset();
|
||||
show_confirmation(T_('Database Charset Updated'), T_('Your Database and associated tables have been updated to match your currently configured charset'), Config::get('web_path').'/admin/system.php?action=show_debug');
|
||||
show_confirmation(T_('Database Charset Updated'), T_('Your Database and associated tables have been updated to match your currently configured charset'), AmpConfig::get('web_path').'/admin/system.php?action=show_debug');
|
||||
break;
|
||||
case 'show_debug':
|
||||
$configuration = Config::get_all();
|
||||
require_once Config::get('prefix') . '/templates/show_debug.inc.php';
|
||||
$configuration = AmpConfig::get_all();
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_debug.inc.php';
|
||||
break;
|
||||
default:
|
||||
// Rien a faire
|
||||
|
|
|
@ -32,7 +32,7 @@ UI::show_header();
|
|||
// Switch on the actions
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'update_user':
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
|
||||
if (!Core::form_verify('edit_user','post')) {
|
||||
UI::access_denied();
|
||||
|
@ -81,10 +81,10 @@ switch ($_REQUEST['action']) {
|
|||
$client->update_password($pass1);
|
||||
}
|
||||
|
||||
show_confirmation(T_('User Updated'), $client->fullname . "(" . $client->username . ")" . T_('updated'), Config::get('web_path'). '/admin/users.php');
|
||||
show_confirmation(T_('User Updated'), $client->fullname . "(" . $client->username . ")" . T_('updated'), AmpConfig::get('web_path'). '/admin/users.php');
|
||||
break;
|
||||
case 'add_user':
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
|
||||
if (!Core::form_verify('add_user','post')) {
|
||||
UI::access_denied();
|
||||
|
@ -126,45 +126,45 @@ switch ($_REQUEST['action']) {
|
|||
if ($access == 5) { $access = T_('Guest');} elseif ($access == 25) { $access = T_('User');} elseif ($access == 100) { $access = T_('Admin');}
|
||||
|
||||
/* HINT: %1 Username, %2 Access num */
|
||||
show_confirmation(T_('New User Added'),sprintf(T_('%1$s has been created with an access level of %2$s'), $username, $access), Config::get('web_path').'/admin/users.php');
|
||||
show_confirmation(T_('New User Added'),sprintf(T_('%1$s has been created with an access level of %2$s'), $username, $access), AmpConfig::get('web_path').'/admin/users.php');
|
||||
break;
|
||||
case 'enable':
|
||||
$client = new User($_REQUEST['user_id']);
|
||||
$client->enable();
|
||||
show_confirmation(T_('User Enabled'),$client->fullname . ' (' . $client->username . ')', Config::get('web_path'). '/admin/users.php');
|
||||
show_confirmation(T_('User Enabled'),$client->fullname . ' (' . $client->username . ')', AmpConfig::get('web_path'). '/admin/users.php');
|
||||
break;
|
||||
case 'disable':
|
||||
$client = new User($_REQUEST['user_id']);
|
||||
if ($client->disable()) {
|
||||
show_confirmation(T_('User Disabled'),$client->fullname . ' (' . $client->username . ')', Config::get('web_path'). '/admin/users.php');
|
||||
show_confirmation(T_('User Disabled'),$client->fullname . ' (' . $client->username . ')', AmpConfig::get('web_path'). '/admin/users.php');
|
||||
} else {
|
||||
show_confirmation(T_('Error'), T_('Unable to Disabled last Administrator'), Config::get('web_path').'/admin/users.php');
|
||||
show_confirmation(T_('Error'), T_('Unable to Disabled last Administrator'), AmpConfig::get('web_path').'/admin/users.php');
|
||||
}
|
||||
break;
|
||||
case 'show_edit':
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
$client = new User($_REQUEST['user_id']);
|
||||
require_once Config::get('prefix') . '/templates/show_edit_user.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_edit_user.inc.php';
|
||||
break;
|
||||
case 'confirm_delete':
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
if (!Core::form_verify('delete_user')) {
|
||||
UI::access_denied();
|
||||
exit;
|
||||
}
|
||||
$client = new User($_REQUEST['user_id']);
|
||||
if ($client->delete()) {
|
||||
show_confirmation(T_('User Deleted'), sprintf(T_('%s has been Deleted'), $client->username), Config::get('web_path'). "/admin/users.php");
|
||||
show_confirmation(T_('User Deleted'), sprintf(T_('%s has been Deleted'), $client->username), AmpConfig::get('web_path'). "/admin/users.php");
|
||||
} else {
|
||||
show_confirmation(T_('Delete Error'), T_("Unable to delete last Admin User"), Config::get('web_path')."/admin/users.php");
|
||||
show_confirmation(T_('Delete Error'), T_("Unable to delete last Admin User"), AmpConfig::get('web_path')."/admin/users.php");
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
$client = new User($_REQUEST['user_id']);
|
||||
show_confirmation(T_('Deletion Request'),
|
||||
sprintf(T_('Are you sure you want to permanently delete %s?'), $client->fullname),
|
||||
Config::get('web_path')."/admin/users.php?action=confirm_delete&user_id=" . $_REQUEST['user_id'],1,'delete_user');
|
||||
AmpConfig::get('web_path')."/admin/users.php?action=confirm_delete&user_id=" . $_REQUEST['user_id'],1,'delete_user');
|
||||
break;
|
||||
/* Show IP History for the Specified User */
|
||||
case 'show_ip_history':
|
||||
|
@ -176,16 +176,16 @@ switch ($_REQUEST['action']) {
|
|||
} else {
|
||||
$history = $working_user->get_ip_history();
|
||||
}
|
||||
require Config::get('prefix') . '/templates/show_ip_history.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_ip_history.inc.php';
|
||||
break;
|
||||
case 'show_add_user':
|
||||
if (Config::get('demo_mode')) { break; }
|
||||
require_once Config::get('prefix') . '/templates/show_add_user.inc.php';
|
||||
if (AmpConfig::get('demo_mode')) { break; }
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_add_user.inc.php';
|
||||
break;
|
||||
case 'show_preferences':
|
||||
$client = new User($_REQUEST['user_id']);
|
||||
$preferences = Preference::get_all($client->id);
|
||||
require_once Config::get('prefix') . '/templates/show_user_preferences.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_user_preferences.inc.php';
|
||||
break;
|
||||
default:
|
||||
$browse = new Browse();
|
||||
|
|
14
albums.php
14
albums.php
|
@ -22,7 +22,7 @@
|
|||
|
||||
require_once 'lib/init.php';
|
||||
|
||||
require_once Config::get('prefix') . '/templates/header.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/header.inc.php';
|
||||
|
||||
/* Switch on Action */
|
||||
switch ($_REQUEST['action']) {
|
||||
|
@ -121,7 +121,7 @@ switch ($_REQUEST['action']) {
|
|||
} // end foreach
|
||||
// Store the results for further use
|
||||
$_SESSION['form']['images'] = $images;
|
||||
require_once Config::get('prefix') . '/templates/show_album_art.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_album_art.inc.php';
|
||||
}
|
||||
// Else nothing
|
||||
else {
|
||||
|
@ -135,7 +135,7 @@ switch ($_REQUEST['action']) {
|
|||
if (!empty($_REQUEST['album_name'])) { $albumname = scrub_in($_REQUEST['album_name']); }
|
||||
if (!empty($_REQUEST['artist_name'])) { $artistname = scrub_in($_REQUEST['artist_name']); }
|
||||
|
||||
require_once Config::get('prefix') . '/templates/show_get_albumart.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_get_albumart.inc.php';
|
||||
|
||||
break;
|
||||
case 'select_art':
|
||||
|
@ -150,7 +150,7 @@ switch ($_REQUEST['action']) {
|
|||
|
||||
$art->insert($image,$mime);
|
||||
|
||||
header("Location:" . Config::get('web_path') . "/albums.php?action=show&album=" . $art->uid);
|
||||
header("Location:" . AmpConfig::get('web_path') . "/albums.php?action=show&album=" . $art->uid);
|
||||
break;
|
||||
case 'update_from_tags':
|
||||
// Make sure they are a 'power' user at least
|
||||
|
@ -161,8 +161,8 @@ switch ($_REQUEST['action']) {
|
|||
|
||||
$type = 'album';
|
||||
$object_id = intval($_REQUEST['album_id']);
|
||||
$target_url = Config::get('web_path') . '/albums.php?action=show&album=' . $object_id;
|
||||
require_once Config::get('prefix') . '/templates/show_update_items.inc.php';
|
||||
$target_url = AmpConfig::get('web_path') . '/albums.php?action=show&album=' . $object_id;
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_update_items.inc.php';
|
||||
break;
|
||||
case 'set_track_numbers':
|
||||
debug_event('albums', 'Set track numbers called.', '5');
|
||||
|
@ -194,7 +194,7 @@ switch ($_REQUEST['action']) {
|
|||
case 'show':
|
||||
$album = new Album($_REQUEST['album']);
|
||||
$album->format();
|
||||
require Config::get('prefix') . '/templates/show_album.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_album.inc.php';
|
||||
|
||||
break;
|
||||
} // switch on view
|
||||
|
|
22
artists.php
22
artists.php
|
@ -33,20 +33,20 @@ switch ($_REQUEST['action']) {
|
|||
$artist->format();
|
||||
$object_ids = $artist->get_albums($_REQUEST['catalog']);
|
||||
$object_type = 'album';
|
||||
require_once Config::get('prefix') . '/templates/show_artist.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_artist.inc.php';
|
||||
break;
|
||||
case 'show_all_songs':
|
||||
$artist = new Artist($_REQUEST['artist']);
|
||||
$artist->format();
|
||||
$object_type = 'song';
|
||||
$object_ids = $artist->get_songs();
|
||||
require_once Config::get('prefix') . '/templates/show_artist.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_artist.inc.php';
|
||||
break;
|
||||
case 'update_from_tags':
|
||||
$type = 'artist';
|
||||
$object_id = intval($_REQUEST['artist']);
|
||||
$target_url = Config::get('web_path') . "/artists.php?action=show&artist=" . $object_id;
|
||||
require_once Config::get('prefix') . '/templates/show_update_items.inc.php';
|
||||
$target_url = AmpConfig::get('web_path') . "/artists.php?action=show&artist=" . $object_id;
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_update_items.inc.php';
|
||||
break;
|
||||
case 'rename_similar':
|
||||
if (!$user->has_access('100')) { UI::access_denied(); }
|
||||
|
@ -74,7 +74,7 @@ switch ($_REQUEST['action']) {
|
|||
show_confirmation (
|
||||
T_('Renamed artist(s)'),
|
||||
sprintf(T_('%1$s artists have been merged with %2$s'), $count, $artist->name),
|
||||
Config::get('web_path') . '/artists.php?action=show&artist=' . $artist->id
|
||||
AmpConfig::get('web_path') . '/artists.php?action=show&artist=' . $artist->id
|
||||
);
|
||||
} else {
|
||||
$GLOBALS['error']->print_error('general');
|
||||
|
@ -100,7 +100,7 @@ switch ($_REQUEST['action']) {
|
|||
make_bool($_POST['c_ignins_l']));
|
||||
$artist_id = $artist->id;
|
||||
$artist_name = $artist->name;
|
||||
require Config::get('prefix') . '/templates/show_similar_artists.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_similar_artists.inc.php';
|
||||
|
||||
break;
|
||||
case 'rename':
|
||||
|
@ -139,7 +139,7 @@ switch ($_REQUEST['action']) {
|
|||
show_confirmation (
|
||||
T_('Renamed artist'),
|
||||
sprintf(T_('%1$s is now known as %2$s'), $artist->name, $newname),
|
||||
Config::get('web_path') . "/artists.php?action=show&artist=" . $newid
|
||||
AmpConfig::get('web_path') . "/artists.php?action=show&artist=" . $newid
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -147,22 +147,22 @@ switch ($_REQUEST['action']) {
|
|||
|
||||
/* Else we've got an error! But be lenient, and just show the form again */
|
||||
else {
|
||||
require Config::get('prefix') . '/templates/show_rename_artist.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_rename_artist.inc.php';
|
||||
}
|
||||
break;
|
||||
case 'show_rename':
|
||||
$artist = new Artist($_REQUEST['artist']);
|
||||
require Config::get('prefix') . '/templates/show_rename_artist.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_rename_artist.inc.php';
|
||||
break;
|
||||
case 'match':
|
||||
case 'Match':
|
||||
$match = scrub_in($_REQUEST['match']);
|
||||
if ($match == "Browse" || $match == "Show_all") { $chr = ""; } else { $chr = $match; }
|
||||
/* Enclose this in the purty box! */
|
||||
require Config::get('prefix') . '/templates/show_box_top.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_box_top.inc.php';
|
||||
show_alphabet_list('artists','artists.php',$match);
|
||||
show_alphabet_form($chr, T_('Show Artists starting with'),"artists.php?action=match");
|
||||
require Config::get('prefix') . '/templates/show_box_bottom.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_box_bottom.inc.php';
|
||||
|
||||
if ($match === "Browse") {
|
||||
show_artists();
|
||||
|
|
|
@ -48,7 +48,7 @@ if (!function_exists('iconv')) {
|
|||
$source_encoding = iconv_get_encoding('output_encoding');
|
||||
|
||||
// Attempt a simple translation
|
||||
$string = sprintf(T_('%s For the Love of Music'), iconv(Config::get('site_charset'),Config::get('site_charset')));
|
||||
$string = sprintf(T_('%s For the Love of Music'), iconv(AmpConfig::get('site_charset'),AmpConfig::get('site_charset')));
|
||||
echo T_('Testing Basic Translation, the two strings below should look the same');
|
||||
echo "\n";
|
||||
echo T_('Original: For the Love of Music');
|
||||
|
@ -123,19 +123,19 @@ function charset_directory_correct($path) {
|
|||
continue;
|
||||
}
|
||||
|
||||
$verify_filename = iconv(Config::get('site_charset'),Config::get('site_charset') . '//IGNORE',$full_file);
|
||||
$verify_filename = iconv(AmpConfig::get('site_charset'),AmpConfig::get('site_charset') . '//IGNORE',$full_file);
|
||||
|
||||
if (strcmp($full_file,$verify_filename) != '0') {
|
||||
$translated_filename = iconv($source_encoding,Config::get('site_charset') . '//TRANSLIT',$full_file);
|
||||
$translated_filename = iconv($source_encoding,AmpConfig::get('site_charset') . '//TRANSLIT',$full_file);
|
||||
|
||||
// Make sure the extension stayed the same
|
||||
if (substr($translated_filename,strlen($translated_filename)-3,3) != substr($full_file,strlen($full_file)-3,3)) {
|
||||
echo T_("Translation failure, stripping non-valid characters");
|
||||
echo "\n";
|
||||
$translated_filename = iconv($source_encoding,Config::get('site_charset') . '//IGNORE',$full_file);
|
||||
$translated_filename = iconv($source_encoding,AmpConfig::get('site_charset') . '//IGNORE',$full_file);
|
||||
}
|
||||
|
||||
printf (T_('Attempting to Transcode to %s'), Config::get('site_charset'));
|
||||
printf (T_('Attempting to Transcode to %s'), AmpConfig::get('site_charset'));
|
||||
echo "\n";
|
||||
echo "--------------------------------------------------------------------------------------------\n";
|
||||
printf (T_('OLD: %s has invalid chars'), $full_file);
|
||||
|
|
|
@ -39,7 +39,7 @@ if (!$options || !isset($options['u'])) {
|
|||
|
||||
$username = $options['u'];
|
||||
$password = isset($options['p']) ? $options['p'] : mt_rand();
|
||||
$access = isset($options['l']) ? $options['l'] : Config::get('auto_user');
|
||||
$access = isset($options['l']) ? $options['l'] : AmpConfig::get('auto_user');
|
||||
$access = isset($access) ? $access : 'guest';
|
||||
$access = is_numeric($access) ? $access : User::access_name_to_level($access);
|
||||
$email = isset($options['e']) ? $options['e'] : '';
|
||||
|
|
|
@ -75,7 +75,7 @@ if (!install_check_status($configfile)) {
|
|||
}
|
||||
}
|
||||
|
||||
Config::set_by_array(array(
|
||||
AmpConfig::set_by_array(array(
|
||||
'web_path' => $web_path,
|
||||
'database_name' => $db_name,
|
||||
'database_username' => $db_user,
|
||||
|
@ -91,7 +91,7 @@ if (!install_insert_db($new_db_user, $new_db_pass, $force)) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
Config::set_by_array(array(
|
||||
AmpConfig::set_by_array(array(
|
||||
'database_username' => $new_db_user ?: $db_user,
|
||||
'database_password' => $new_db_pass ?: $db_pass
|
||||
), true);
|
||||
|
|
|
@ -267,13 +267,13 @@ function sort_move_file($song,$fullname) {
|
|||
debug_event('copy','Copied ' . $song->file . ' to ' . $fullname,'5');
|
||||
|
||||
/* Look for the folder art and copy that as well */
|
||||
if (!Config::get('album_art_preferred_filename') OR strstr(Config::get('album_art_preferred_filename'),"%")) {
|
||||
if (!AmpConfig::get('album_art_preferred_filename') OR strstr(AmpConfig::get('album_art_preferred_filename'),"%")) {
|
||||
$folder_art = $directory . '/folder.jpg';
|
||||
$old_art = $old_dir . '/folder.jpg';
|
||||
}
|
||||
else {
|
||||
$folder_art = $directory . "/" . sort_clean_name(Config::get('album_art_preferred_filename'));
|
||||
$old_art = $old_dir . "/" . sort_clean_name(Config::get('album_art_preferred_filename'));
|
||||
$folder_art = $directory . "/" . sort_clean_name(AmpConfig::get('album_art_preferred_filename'));
|
||||
$old_art = $old_dir . "/" . sort_clean_name(AmpConfig::get('album_art_preferred_filename'));
|
||||
}
|
||||
|
||||
debug_event('copy_art','Copied ' . $old_art . ' to ' . $folder_art,'5');
|
||||
|
|
|
@ -68,7 +68,7 @@ switch ($_REQUEST['action']) {
|
|||
$browse->set_sort('count','ASC');
|
||||
// This one's a doozy
|
||||
$browse->set_simple_browse(false);
|
||||
$browse->save_objects(Tag::get_tags(Config::get('offset_limit')));
|
||||
$browse->save_objects(Tag::get_tags(AmpConfig::get('offset_limit')));
|
||||
$object_ids = $browse->get_saved();
|
||||
$keys = array_keys($object_ids);
|
||||
Tag::build_cache($keys);
|
||||
|
@ -76,10 +76,10 @@ switch ($_REQUEST['action']) {
|
|||
$browse2 = new Browse();
|
||||
$browse2->set_type('song');
|
||||
$browse2->store();
|
||||
require_once Config::get('prefix') . '/templates/show_tagcloud.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_tagcloud.inc.php';
|
||||
UI::show_box_bottom();
|
||||
$type = $browse2->get_type();
|
||||
require_once Config::get('prefix') . '/templates/browse_content.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/browse_content.inc.php';
|
||||
break;
|
||||
case 'artist':
|
||||
$browse->set_filter('catalog',$_SESSION['catalog']);
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
require_once 'lib/init.php';
|
||||
|
||||
/* Make sure they have access to this */
|
||||
if (!Config::get('allow_democratic_playback')) {
|
||||
if (!AmpConfig::get('allow_democratic_playback')) {
|
||||
UI::access_denied();
|
||||
exit;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ switch ($_REQUEST['action']) {
|
|||
}
|
||||
|
||||
// Show the create page
|
||||
require_once Config::get('prefix') . '/templates/show_create_democratic.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_create_democratic.inc.php';
|
||||
break;
|
||||
case 'delete':
|
||||
if (!Access::check('interface','75')) {
|
||||
|
@ -55,7 +55,7 @@ switch ($_REQUEST['action']) {
|
|||
|
||||
$title = '';
|
||||
$text = T_('The Requested Playlist has been deleted.');
|
||||
$url = Config::get('web_path') . '/democratic.php?action=manage_playlists';
|
||||
$url = AmpConfig::get('web_path') . '/democratic.php?action=manage_playlists';
|
||||
show_confirmation($title,$text,$url);
|
||||
break;
|
||||
case 'create':
|
||||
|
@ -86,7 +86,7 @@ switch ($_REQUEST['action']) {
|
|||
Democratic::set_user_preferences();
|
||||
}
|
||||
|
||||
header("Location: " . Config::get('web_path') . "/democratic.php?action=show");
|
||||
header("Location: " . AmpConfig::get('web_path') . "/democratic.php?action=show");
|
||||
break;
|
||||
case 'manage_playlists':
|
||||
if (!Access::check('interface','75')) {
|
||||
|
@ -96,20 +96,20 @@ switch ($_REQUEST['action']) {
|
|||
// Get all of the non-user playlists
|
||||
$playlists = Democratic::get_playlists();
|
||||
|
||||
require_once Config::get('prefix') . '/templates/show_manage_democratic.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_manage_democratic.inc.php';
|
||||
|
||||
break;
|
||||
case 'show_playlist':
|
||||
default:
|
||||
$democratic = Democratic::get_current_playlist();
|
||||
if (!$democratic->id) {
|
||||
require_once Config::get('prefix') . '/templates/show_democratic.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_democratic.inc.php';
|
||||
break;
|
||||
}
|
||||
|
||||
$democratic->set_parent();
|
||||
$democratic->format();
|
||||
require_once Config::get('prefix') . '/templates/show_democratic.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_democratic.inc.php';
|
||||
$objects = $democratic->get_items();
|
||||
Song::build_cache($democratic->object_ids);
|
||||
Democratic::build_vote_cache($democratic->vote_ids);
|
||||
|
|
12
image.php
12
image.php
|
@ -33,13 +33,13 @@ define('NO_SESSION','1');
|
|||
require_once 'lib/init.php';
|
||||
|
||||
// Check to see if they've got an interface session or a valid API session, if not GTFO
|
||||
if (!Session::exists('interface', $_COOKIE[Config::get('session_name')]) && !Session::exists('api', $_REQUEST['auth'])) {
|
||||
debug_event('image','Access denied, checked cookie session:' . $_COOKIE[Config::get('session_name')] . ' and auth:' . $_REQUEST['auth'], 1);
|
||||
if (!Session::exists('interface', $_COOKIE[AmpConfig::get('session_name')]) && !Session::exists('api', $_REQUEST['auth'])) {
|
||||
debug_event('image','Access denied, checked cookie session:' . $_COOKIE[AmpConfig::get('session_name')] . ' and auth:' . $_REQUEST['auth'], 1);
|
||||
exit;
|
||||
}
|
||||
|
||||
// If we aren't resizing just trash thumb
|
||||
if (!Config::get('resize_images')) { $_GET['thumb'] = null; }
|
||||
if (!AmpConfig::get('resize_images')) { $_GET['thumb'] = null; }
|
||||
|
||||
// FIXME: Legacy stuff - should be removed after a version or so
|
||||
if (!isset($_GET['object_type'])) {
|
||||
|
@ -78,7 +78,7 @@ switch ($_GET['thumb']) {
|
|||
|
||||
switch ($_GET['type']) {
|
||||
case 'popup':
|
||||
require_once Config::get('prefix') . '/templates/show_big_art.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_big_art.inc.php';
|
||||
break;
|
||||
// If we need to pull the data out of the session
|
||||
case 'session':
|
||||
|
@ -96,8 +96,8 @@ switch ($_GET['type']) {
|
|||
|
||||
if (!$art->raw_mime) {
|
||||
$mime = 'image/jpeg';
|
||||
$image = file_get_contents(Config::get('prefix') .
|
||||
Config::get('theme_path') .
|
||||
$image = file_get_contents(AmpConfig::get('prefix') .
|
||||
AmpConfig::get('theme_path') .
|
||||
'/images/blankalbum.jpg');
|
||||
} else {
|
||||
if ($_GET['thumb']) {
|
||||
|
|
10
index.php
10
index.php
|
@ -22,7 +22,7 @@
|
|||
|
||||
require_once 'lib/init.php';
|
||||
|
||||
if (Config::get('iframes')) {
|
||||
if (AmpConfig::get('iframes')) {
|
||||
if (!isset($_GET['framed'])) {
|
||||
UI::show_mainframes();
|
||||
exit;
|
||||
|
@ -40,12 +40,12 @@ $_SESSION['catalog'] = 0;
|
|||
* refresh_javascript include. Must be greater then 5, I'm not
|
||||
* going to let them break their servers
|
||||
*/
|
||||
if (Config::get('refresh_limit') > 5) {
|
||||
$refresh_limit = Config::get('refresh_limit');
|
||||
if (AmpConfig::get('refresh_limit') > 5) {
|
||||
$refresh_limit = AmpConfig::get('refresh_limit');
|
||||
$ajax_url = '?page=index&action=reloadnp';
|
||||
require_once Config::get('prefix') . '/templates/javascript_refresh.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/javascript_refresh.inc.php';
|
||||
}
|
||||
|
||||
require_once Config::get('prefix') . '/templates/show_index.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_index.inc.php';
|
||||
|
||||
UI::show_footer();
|
||||
|
|
22
install.php
22
install.php
|
@ -29,7 +29,7 @@ set_error_handler('ampache_error_handler');
|
|||
// Redirect if installation is already complete.
|
||||
if (!install_check_status($configfile)) {
|
||||
$redirect_url = 'login.php';
|
||||
require_once Config::get('prefix') . '/templates/error_page.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/error_page.inc.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -44,14 +44,14 @@ $database = scrub_in($_REQUEST['local_db']);
|
|||
$port = scrub_in($_REQUEST['local_port']);
|
||||
$skip_admin = $_REQUEST['skip_admin'];
|
||||
|
||||
Config::set_by_array(array(
|
||||
AmpConfig::set_by_array(array(
|
||||
'web_path' => $web_path,
|
||||
'database_name' => $database,
|
||||
'database_hostname' => $hostname,
|
||||
'database_port' => $port
|
||||
), true);
|
||||
if (!$skip_admin) {
|
||||
Config::set_by_array(array(
|
||||
AmpConfig::set_by_array(array(
|
||||
'database_username' => $username,
|
||||
'database_password' => $password
|
||||
), true);
|
||||
|
@ -75,10 +75,10 @@ if (!$htmllang) {
|
|||
$htmllang = $lang;
|
||||
}
|
||||
}
|
||||
Config::set('lang', $htmllang, true);
|
||||
Config::set('site_charset', $charset ?: 'UTF-8', true);
|
||||
AmpConfig::set('lang', $htmllang, true);
|
||||
AmpConfig::set('site_charset', $charset ?: 'UTF-8', true);
|
||||
load_gettext();
|
||||
header ('Content-Type: text/html; charset=' . Config::get('site_charset'));
|
||||
header ('Content-Type: text/html; charset=' . AmpConfig::get('site_charset'));
|
||||
|
||||
// Correct potential \ or / in the dirname
|
||||
$safe_dirname = rtrim(dirname($_SERVER['PHP_SELF']),"/\\");
|
||||
|
@ -108,7 +108,7 @@ switch ($_REQUEST['action']) {
|
|||
}
|
||||
|
||||
// Now that it's inserted save the lang preference
|
||||
Preference::update('lang', '-1', Config::get('lang'));
|
||||
Preference::update('lang', '-1', AmpConfig::get('lang'));
|
||||
|
||||
header ('Location: ' . $web_path . "/install.php?action=show_create_config&local_db=$database&local_host=$hostname&local_port=$port&htmllang=$htmllang&charset=$charset");
|
||||
break;
|
||||
|
@ -122,12 +122,12 @@ switch ($_REQUEST['action']) {
|
|||
break;
|
||||
case 'create_account':
|
||||
$results = parse_ini_file($configfile);
|
||||
Config::set_by_array($results, true);
|
||||
AmpConfig::set_by_array($results, true);
|
||||
|
||||
$password2 = scrub_in($_REQUEST['local_pass2']);
|
||||
|
||||
if (!install_create_account($username, $password, $password2)) {
|
||||
require_once Config::get('prefix') . '/templates/show_install_account.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_install_account.inc.php';
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -139,11 +139,11 @@ switch ($_REQUEST['action']) {
|
|||
/* Make sure we've got a valid config file */
|
||||
if (!check_config_values($results)) {
|
||||
Error::add('general', T_('Error: Config file not found or unreadable'));
|
||||
require_once Config::get('prefix') . '/templates/show_install_config.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_install_config.inc.php';
|
||||
break;
|
||||
}
|
||||
|
||||
require_once Config::get('prefix') . '/templates/show_install_account.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_install_account.inc.php';
|
||||
break;
|
||||
case 'init':
|
||||
require_once 'templates/show_install.inc.php';
|
||||
|
|
|
@ -65,14 +65,14 @@ function send_zip( $name, $song_files )
|
|||
{
|
||||
// Check if they want to save it to a file, if so then make sure they've
|
||||
// got a defined path as well and that it's writable.
|
||||
if (Config::get('file_zip_download') && Config::get('file_zip_path')) {
|
||||
if (AmpConfig::get('file_zip_download') && AmpConfig::get('file_zip_path')) {
|
||||
// Check writeable
|
||||
if (!is_writable(Config::get('file_zip_path'))) {
|
||||
if (!is_writable(AmpConfig::get('file_zip_path'))) {
|
||||
$in_memory = '1';
|
||||
debug_event('Error','File Zip Path:' . Config::get('file_zip_path') . ' is not writable','1');
|
||||
debug_event('Error','File Zip Path:' . AmpConfig::get('file_zip_path') . ' is not writable','1');
|
||||
} else {
|
||||
$in_memory = '0';
|
||||
$basedir = Config::get('file_zip_path');
|
||||
$basedir = AmpConfig::get('file_zip_path');
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -80,14 +80,14 @@ function send_zip( $name, $song_files )
|
|||
} // if file downloads
|
||||
|
||||
/* Require needed library */
|
||||
require_once Config::get('prefix') . '/modules/archive/archive.lib.php';
|
||||
require_once AmpConfig::get('prefix') . '/modules/archive/archive.lib.php';
|
||||
$arc = new zip_file( $name . ".zip" );
|
||||
$options = array(
|
||||
'inmemory' => $in_memory, // create archive in memory
|
||||
'basedir' => $basedir,
|
||||
'storepaths' => 0, // only store file name, not full path
|
||||
'level' => 0, // no compression
|
||||
'comment' => Config::get('file_zip_comment')
|
||||
'comment' => AmpConfig::get('file_zip_comment')
|
||||
);
|
||||
|
||||
$arc->set_options( $options );
|
||||
|
|
|
@ -223,15 +223,15 @@ class Access
|
|||
{
|
||||
switch ($type) {
|
||||
case 'download':
|
||||
return Config::get('download');
|
||||
return AmpConfig::get('download');
|
||||
break ;
|
||||
case 'batch_download':
|
||||
if (!function_exists('gzcompress')) {
|
||||
debug_event('access', 'ZLIB extension not loaded, batch download disabled', 3);
|
||||
return false;
|
||||
}
|
||||
if (Config::get('allow_zip_download') AND $GLOBALS['user']->has_access('25')) {
|
||||
return Config::get('download');
|
||||
if (AmpConfig::get('allow_zip_download') AND $GLOBALS['user']->has_access('25')) {
|
||||
return AmpConfig::get('download');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -248,7 +248,7 @@ class Access
|
|||
*/
|
||||
public static function check_network($type, $user, $level, $ip=null)
|
||||
{
|
||||
if (!Config::get('access_control')) {
|
||||
if (!AmpConfig::get('access_control')) {
|
||||
switch ($type) {
|
||||
case 'interface':
|
||||
case 'stream':
|
||||
|
@ -314,7 +314,7 @@ class Access
|
|||
*/
|
||||
public static function check($type, $level)
|
||||
{
|
||||
if (Config::get('demo_mode')) {
|
||||
if (AmpConfig::get('demo_mode')) {
|
||||
return true;
|
||||
}
|
||||
if (defined('INSTALL')) {
|
||||
|
@ -327,7 +327,7 @@ class Access
|
|||
switch ($type) {
|
||||
case 'localplay':
|
||||
// Check their localplay_level
|
||||
if (Config::get('localplay_level') >= $level
|
||||
if (AmpConfig::get('localplay_level') >= $level
|
||||
|| $GLOBALS['user']->access >= 100) {
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
@ -75,7 +75,7 @@ class Ajax
|
|||
*/
|
||||
public static function url($action)
|
||||
{
|
||||
return Config::get('ajax_url') . $action;
|
||||
return AmpConfig::get('ajax_url') . $action;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -141,7 +141,7 @@ class Album extends database_object
|
|||
$art->get_db();
|
||||
$row['has_art'] = make_bool($art->raw);
|
||||
$row['has_thumb'] = make_bool($art->thumb);
|
||||
if (Config::get('show_played_times')) {
|
||||
if (AmpConfig::get('show_played_times')) {
|
||||
$row['object_cnt'] = Stats::get_object_count('album', $row['album']);
|
||||
}
|
||||
parent::add_to_cache('album_extra',$row['album'],$row);
|
||||
|
@ -186,7 +186,7 @@ class Album extends database_object
|
|||
$results['has_art'] = make_bool($art->raw);
|
||||
$results['has_thumb'] = make_bool($art->thumb);
|
||||
|
||||
if (Config::get('show_played_times')) {
|
||||
if (AmpConfig::get('show_played_times')) {
|
||||
$results['object_cnt'] = Stats::get_object_count('album', $this->id);
|
||||
}
|
||||
|
||||
|
@ -324,14 +324,14 @@ class Album extends database_object
|
|||
*/
|
||||
public function format()
|
||||
{
|
||||
$web_path = Config::get('web_path');
|
||||
$web_path = AmpConfig::get('web_path');
|
||||
|
||||
/* Pull the advanced information */
|
||||
$data = $this->_get_extra_info();
|
||||
foreach ($data as $key=>$value) { $this->$key = $value; }
|
||||
|
||||
/* Truncate the string if it's to long */
|
||||
$this->f_name = UI::truncate($this->full_name,Config::get('ellipse_threshold_album'));
|
||||
$this->f_name = UI::truncate($this->full_name,AmpConfig::get('ellipse_threshold_album'));
|
||||
|
||||
$this->f_name_link = "<a href=\"$web_path/albums.php?action=show&album=" . scrub_out($this->id) . "\" title=\"" . scrub_out($this->full_name) . "\">" . scrub_out($this->f_name);
|
||||
// If we've got a disk append it
|
||||
|
@ -345,7 +345,7 @@ class Album extends database_object
|
|||
if ($this->artist_count == '1') {
|
||||
$artist = trim(trim($this->artist_prefix) . ' ' . trim($this->artist_name));
|
||||
$this->f_artist_name = $artist;
|
||||
$artist = scrub_out(UI::truncate($artist), Config::get('ellipse_threshold_artist'));
|
||||
$artist = scrub_out(UI::truncate($artist), AmpConfig::get('ellipse_threshold_artist'));
|
||||
$this->f_artist_link = "<a href=\"$web_path/artists.php?action=show&artist=" . $this->artist_id . "\" title=\"" . scrub_out($this->artist_name) . "\">" . $artist . "</a>";
|
||||
$this->f_artist = $artist;
|
||||
} else {
|
||||
|
|
|
@ -72,7 +72,7 @@ class Ampache_RSS
|
|||
'latest_album' => T_('Newest Albums'),
|
||||
'latest_artist' => T_('Newest Artists'));
|
||||
|
||||
return scrub_out(Config::get('site_title')) . ' - ' . $titles[$this->type];
|
||||
return scrub_out(AmpConfig::get('site_title')) . ' - ' . $titles[$this->type];
|
||||
|
||||
} // get_title
|
||||
|
||||
|
@ -113,7 +113,7 @@ class Ampache_RSS
|
|||
// Default to now playing
|
||||
$type = self::validate_type($type);
|
||||
|
||||
$string = '<a href="' . Config::get('web_path') . '/rss.php?type=' . $type . '">' . UI::get_icon('feed', T_('RSS Feed')) . '</a>';
|
||||
$string = '<a href="' . AmpConfig::get('web_path') . '/rss.php?type=' . $type . '">' . UI::get_icon('feed', T_('RSS Feed')) . '</a>';
|
||||
|
||||
return $string;
|
||||
|
||||
|
@ -131,7 +131,7 @@ class Ampache_RSS
|
|||
$data = Stream::get_now_playing();
|
||||
|
||||
$results = array();
|
||||
$format = Config::get('rss_format') ?: '%t - %a - %A';
|
||||
$format = AmpConfig::get('rss_format') ?: '%t - %a - %A';
|
||||
$string_map = array(
|
||||
'%t' => 'title',
|
||||
'%a' => 'artist',
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* The class should be a static var in the other classes
|
||||
*
|
||||
*/
|
||||
class Config
|
||||
class AmpConfig
|
||||
{
|
||||
private $_local = array();
|
||||
private static $_global = array();
|
|
@ -200,7 +200,7 @@ class Api
|
|||
|
||||
echo XML_Data::keyed_array(array('auth'=>$token,
|
||||
'api'=>self::$version,
|
||||
'session_expire'=>date("c",time()+Config::get('session_length')-60),
|
||||
'session_expire'=>date("c",time()+AmpConfig::get('session_length')-60),
|
||||
'update'=>date("c",$row['update']),
|
||||
'add'=>date("c",$row['add']),
|
||||
'clean'=>date("c",$row['clean']),
|
||||
|
@ -227,12 +227,12 @@ class Api
|
|||
*/
|
||||
public static function ping($input)
|
||||
{
|
||||
$xmldata = array('server'=>Config::get('version'),'version'=>Api::$version,'compatible'=>'350001');
|
||||
$xmldata = array('server'=>AmpConfig::get('version'),'version'=>Api::$version,'compatible'=>'350001');
|
||||
|
||||
// Check and see if we should extend the api sessions (done if valid sess is passed)
|
||||
if (Session::exists('api', $input['auth'])) {
|
||||
Session::extend($input['auth']);
|
||||
$xmldata = array_merge(array('session_expire'=>date("c",time()+Config::get('session_length')-60)),$xmldata);
|
||||
$xmldata = array_merge(array('session_expire'=>date("c",time()+AmpConfig::get('session_length')-60)),$xmldata);
|
||||
}
|
||||
|
||||
debug_event('API','Ping Received from ' . $_SERVER['REMOTE_ADDR'] . ' :: ' . $input['auth'],'5');
|
||||
|
@ -627,7 +627,7 @@ class Api
|
|||
public static function localplay($input)
|
||||
{
|
||||
// Load their localplay instance
|
||||
$localplay = new Localplay(Config::get('localplay_controller'));
|
||||
$localplay = new Localplay(AmpConfig::get('localplay_controller'));
|
||||
$localplay->connect();
|
||||
|
||||
switch ($input['command']) {
|
||||
|
|
|
@ -80,7 +80,7 @@ class Art extends database_object
|
|||
public static function _auto_init()
|
||||
{
|
||||
if (!isset($_SESSION['art_enabled'])) {
|
||||
$_SESSION['art_enabled'] = (Config::get('bandwidth') > 25);
|
||||
$_SESSION['art_enabled'] = (AmpConfig::get('bandwidth') > 25);
|
||||
}
|
||||
self::$enabled = make_bool($_SESSION['art_enabled']);
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ class Art extends database_object
|
|||
if ($results['size'] == 'original') {
|
||||
$this->raw = $results['image'];
|
||||
$this->raw_mime = $results['mime'];
|
||||
} else if (Config::get('resize_images') &&
|
||||
} else if (AmpConfig::get('resize_images') &&
|
||||
$results['size'] == '275x275') {
|
||||
$this->thumb = $results['image'];
|
||||
$this->raw_mime = $results['mime'];
|
||||
|
@ -222,7 +222,7 @@ class Art extends database_object
|
|||
if (!$this->raw) { return false; }
|
||||
|
||||
// If there is no thumb and we want thumbs
|
||||
if (!$this->thumb && Config::get('resize_images')) {
|
||||
if (!$this->thumb && AmpConfig::get('resize_images')) {
|
||||
$data = $this->generate_thumb($this->raw, array('width' => 275, 'height' => 275), $this->raw_mime);
|
||||
// If it works save it!
|
||||
if ($data) {
|
||||
|
@ -246,7 +246,7 @@ class Art extends database_object
|
|||
public function insert($source, $mime)
|
||||
{
|
||||
// Disabled in demo mode cause people suck and upload porn
|
||||
if (Config::get('demo_mode')) { return false; }
|
||||
if (AmpConfig::get('demo_mode')) { return false; }
|
||||
|
||||
// Check to make sure we like this image
|
||||
if (!self::test_image($source)) {
|
||||
|
@ -465,11 +465,11 @@ class Art extends database_object
|
|||
// Check to see if it's a URL
|
||||
if (isset($data['url'])) {
|
||||
$snoopy = new Snoopy();
|
||||
if (Config::get('proxy_host') AND Config::get('proxy_port')) {
|
||||
$snoopy->proxy_user = Config::get('proxy_host');
|
||||
$snoopy->proxy_port = Config::get('proxy_port');
|
||||
$snoopy->proxy_user = Config::get('proxy_user');
|
||||
$snoopy->proxy_pass = Config::get('proxy_pass');
|
||||
if (AmpConfig::get('proxy_host') AND AmpConfig::get('proxy_port')) {
|
||||
$snoopy->proxy_user = AmpConfig::get('proxy_host');
|
||||
$snoopy->proxy_port = AmpConfig::get('proxy_port');
|
||||
$snoopy->proxy_user = AmpConfig::get('proxy_user');
|
||||
$snoopy->proxy_pass = AmpConfig::get('proxy_pass');
|
||||
}
|
||||
$snoopy->fetch($data['url']);
|
||||
return $snoopy->results;
|
||||
|
@ -513,7 +513,7 @@ class Art extends database_object
|
|||
$type = self::validate_type($type);
|
||||
|
||||
$key = $type . $uid;
|
||||
if (parent::is_cached('art', $key . '275x275') && Config::get('resize_images')) {
|
||||
if (parent::is_cached('art', $key . '275x275') && AmpConfig::get('resize_images')) {
|
||||
$row = parent::get_from_cache('art', $key . '275x275');
|
||||
$mime = $row['mime'];
|
||||
}
|
||||
|
@ -533,7 +533,7 @@ class Art extends database_object
|
|||
parent::add_to_cache('art', $key . $row['size'], $row);
|
||||
if ($row['size'] == 'original') {
|
||||
$mime = $row['mime'];
|
||||
} else if ($row['size'] == '275x275' && Config::get('resize_images')) {
|
||||
} else if ($row['size'] == '275x275' && AmpConfig::get('resize_images')) {
|
||||
$thumb_mime = $row['mime'];
|
||||
}
|
||||
}
|
||||
|
@ -543,7 +543,7 @@ class Art extends database_object
|
|||
$extension = self::extension($mime);
|
||||
|
||||
$name = 'art.' . $extension;
|
||||
$url = Config::get('web_path') . '/image.php?id=' . scrub_out($uid) . '&object_type=' . scrub_out($type) . '&auth=' . $sid . '&name=' . $name;
|
||||
$url = AmpConfig::get('web_path') . '/image.php?id=' . scrub_out($uid) . '&object_type=' . scrub_out($type) . '&auth=' . $sid . '&name=' . $name;
|
||||
|
||||
return $url;
|
||||
|
||||
|
@ -587,7 +587,7 @@ class Art extends database_object
|
|||
break;
|
||||
}
|
||||
|
||||
$config = Config::get('art_order');
|
||||
$config = AmpConfig::get('art_order');
|
||||
$methods = get_class_methods('Art');
|
||||
|
||||
/* If it's not set */
|
||||
|
@ -708,11 +708,11 @@ class Art extends database_object
|
|||
$url = 'http://' . $base_url . '/images/P/' . $asin . '.' . $server_num . '.LZZZZZZZ.jpg';
|
||||
debug_event('mbz-gatherart', "Evaluating Amazon URL: " . $url, '5');
|
||||
$snoopy = new Snoopy();
|
||||
if (Config::get('proxy_host') AND Config::get('proxy_port')) {
|
||||
$snoopy->proxy_user = Config::get('proxy_host');
|
||||
$snoopy->proxy_port = Config::get('proxy_port');
|
||||
$snoopy->proxy_user = Config::get('proxy_user');
|
||||
$snoopy->proxy_pass = Config::get('proxy_pass');
|
||||
if (AmpConfig::get('proxy_host') AND AmpConfig::get('proxy_port')) {
|
||||
$snoopy->proxy_user = AmpConfig::get('proxy_host');
|
||||
$snoopy->proxy_port = AmpConfig::get('proxy_port');
|
||||
$snoopy->proxy_user = AmpConfig::get('proxy_user');
|
||||
$snoopy->proxy_pass = AmpConfig::get('proxy_pass');
|
||||
}
|
||||
if ($snoopy->fetch($url)) {
|
||||
$num_found++;
|
||||
|
@ -838,7 +838,7 @@ class Art extends database_object
|
|||
}
|
||||
|
||||
/* Attempt to retrieve the album art order */
|
||||
$amazon_base_urls = Config::get('amazon_base_urls');
|
||||
$amazon_base_urls = AmpConfig::get('amazon_base_urls');
|
||||
|
||||
/* If it's not set */
|
||||
if (!count($amazon_base_urls)) {
|
||||
|
@ -849,12 +849,12 @@ class Art extends database_object
|
|||
foreach ($amazon_base_urls as $amazon_base) {
|
||||
|
||||
// Create the Search Object
|
||||
$amazon = new AmazonSearch(Config::get('amazon_developer_public_key'), Config::get('amazon_developer_private_key'), $amazon_base);
|
||||
if (Config::get('proxy_host') AND Config::get('proxy_port')) {
|
||||
$proxyhost = Config::get('proxy_host');
|
||||
$proxyport = Config::get('proxy_port');
|
||||
$proxyuser = Config::get('proxy_user');
|
||||
$proxypass = Config::get('proxy_pass');
|
||||
$amazon = new AmazonSearch(AmpConfig::get('amazon_developer_public_key'), AmpConfig::get('amazon_developer_private_key'), $amazon_base);
|
||||
if (AmpConfig::get('proxy_host') AND AmpConfig::get('proxy_port')) {
|
||||
$proxyhost = AmpConfig::get('proxy_host');
|
||||
$proxyport = AmpConfig::get('proxy_port');
|
||||
$proxyuser = AmpConfig::get('proxy_user');
|
||||
$proxypass = AmpConfig::get('proxy_pass');
|
||||
debug_event('amazon', 'setProxy', 5);
|
||||
$amazon->setProxy($proxyhost, $proxyport, $proxyuser, $proxypass);
|
||||
}
|
||||
|
@ -862,7 +862,7 @@ class Art extends database_object
|
|||
$search_results = array();
|
||||
|
||||
/* Set up the needed variables */
|
||||
$max_pages_to_search = max(Config::get('max_amazon_results_pages'),$amazon->_default_results_pages);
|
||||
$max_pages_to_search = max(AmpConfig::get('max_amazon_results_pages'),$amazon->_default_results_pages);
|
||||
$pages_to_search = $max_pages_to_search; //init to max until we know better.
|
||||
// while we have pages to search
|
||||
do {
|
||||
|
@ -894,7 +894,7 @@ class Art extends database_object
|
|||
}
|
||||
|
||||
/* Log this if we're doin debug */
|
||||
debug_event('amazon-xml',"Searched using $keywords with " . Config::get('amazon_developer_key') . " as key, results: " . count($final_results), 5);
|
||||
debug_event('amazon-xml',"Searched using $keywords with " . AmpConfig::get('amazon_developer_key') . " as key, results: " . count($final_results), 5);
|
||||
|
||||
// If we've hit our limit
|
||||
if (!empty($limit) && count($final_results) >= $limit) {
|
||||
|
@ -958,7 +958,7 @@ class Art extends database_object
|
|||
$processed = array();
|
||||
|
||||
/* See if we are looking for a specific filename */
|
||||
$preferred_filename = Config::get('album_art_preferred_filename');
|
||||
$preferred_filename = AmpConfig::get('album_art_preferred_filename');
|
||||
|
||||
// Array of valid extensions
|
||||
$image_extensions = array(
|
||||
|
@ -1166,11 +1166,11 @@ class Art extends database_object
|
|||
break;
|
||||
}
|
||||
|
||||
if (Config::get('proxy_host') AND Config::get('proxy_port')) {
|
||||
$proxyhost = Config::get('proxy_host');
|
||||
$proxyport = Config::get('proxy_port');
|
||||
$proxyuser = Config::get('proxy_user');
|
||||
$proxypass = Config::get('proxy_pass');
|
||||
if (AmpConfig::get('proxy_host') AND AmpConfig::get('proxy_port')) {
|
||||
$proxyhost = AmpConfig::get('proxy_host');
|
||||
$proxyport = AmpConfig::get('proxy_port');
|
||||
$proxyuser = AmpConfig::get('proxy_user');
|
||||
$proxypass = AmpConfig::get('proxy_pass');
|
||||
debug_event('LastFM', 'proxy set', 5);
|
||||
$lastfm->setProxy($proxyhost, $proxyport, $proxyuser, $proxypass);
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ class Artist extends database_object
|
|||
$db_results = Dba::read($sql);
|
||||
|
||||
while ($row = Dba::fetch_assoc($db_results)) {
|
||||
if (Config::get('show_played_times')) {
|
||||
if (AmpConfig::get('show_played_times')) {
|
||||
$row['object_cnt'] = Stats::get_object_count('artist', $row['artist']);
|
||||
}
|
||||
parent::add_to_cache('artist_extra',$row['artist'],$row);
|
||||
|
@ -157,7 +157,7 @@ class Artist extends database_object
|
|||
|
||||
$sql_sort = 'ORDER BY `album`.`name`,`album`.`disk`,`album`.`year`';
|
||||
|
||||
$sort_type = Config::get('album_sort');
|
||||
$sort_type = AmpConfig::get('album_sort');
|
||||
if ($sort_type == 'year_asc') { $sql_sort = 'ORDER BY `album`.`year` ASC'; } elseif ($sort_type == 'year_desc') { $sql_sort = 'ORDER BY `album`.`year` DESC'; } elseif ($sort_type == 'name_asc') { $sql_sort = 'ORDER BY `album`.`name` ASC'; } elseif ($sort_type == 'name_desc') { $sql_sort = 'ORDER BY `album`.`name` DESC'; }
|
||||
|
||||
$sql = "SELECT `album`.`id` FROM album LEFT JOIN `song` ON `song`.`album`=`album`.`id` $catalog_join " .
|
||||
|
@ -234,7 +234,7 @@ class Artist extends database_object
|
|||
|
||||
$db_results = Dba::read($sql);
|
||||
$row = Dba::fetch_assoc($db_results);
|
||||
if (Config::get('show_played_times')) {
|
||||
if (AmpConfig::get('show_played_times')) {
|
||||
$row['object_cnt'] = Stats::get_object_count('artist', $row['artist']);
|
||||
}
|
||||
parent::add_to_cache('artist_extra',$row['artist'],$row);
|
||||
|
@ -259,7 +259,7 @@ class Artist extends database_object
|
|||
public function format()
|
||||
{
|
||||
/* Combine prefix and name, trim then add ... if needed */
|
||||
$name = UI::truncate(trim($this->prefix . " " . $this->name),Config::get('ellipse_threshold_artist'));
|
||||
$name = UI::truncate(trim($this->prefix . " " . $this->name),AmpConfig::get('ellipse_threshold_artist'));
|
||||
$this->f_name = $name;
|
||||
$this->f_full_name = trim(trim($this->prefix) . ' ' . trim($this->name));
|
||||
|
||||
|
@ -267,11 +267,11 @@ class Artist extends database_object
|
|||
if ($this->_fake) { return true; }
|
||||
|
||||
if ($this->catalog_id) {
|
||||
$this->f_name_link = "<a href=\"" . Config::get('web_path') . "/artists.php?action=show&catalog=" . $this->catalog_id . "&artist=" . $this->id . "\" title=\"" . $this->f_full_name . "\">" . $name . "</a>";
|
||||
$this->f_link = Config::get('web_path') . '/artists.php?action=show&catalog=' . $this->catalog_id . '&artist=' . $this->id;
|
||||
$this->f_name_link = "<a href=\"" . AmpConfig::get('web_path') . "/artists.php?action=show&catalog=" . $this->catalog_id . "&artist=" . $this->id . "\" title=\"" . $this->f_full_name . "\">" . $name . "</a>";
|
||||
$this->f_link = AmpConfig::get('web_path') . '/artists.php?action=show&catalog=' . $this->catalog_id . '&artist=' . $this->id;
|
||||
} else {
|
||||
$this->f_name_link = "<a href=\"" . Config::get('web_path') . "/artists.php?action=show&artist=" . $this->id . "\" title=\"" . $this->f_full_name . "\">" . $name . "</a>";
|
||||
$this->f_link = Config::get('web_path') . '/artists.php?action=show&artist=' . $this->id;
|
||||
$this->f_name_link = "<a href=\"" . AmpConfig::get('web_path') . "/artists.php?action=show&artist=" . $this->id . "\" title=\"" . $this->f_full_name . "\">" . $name . "</a>";
|
||||
$this->f_link = AmpConfig::get('web_path') . '/artists.php?action=show&artist=' . $this->id;
|
||||
}
|
||||
// Get the counts
|
||||
$extra_info = $this->_get_extra_info($this->catalog_id);
|
||||
|
|
|
@ -52,10 +52,10 @@ class Auth
|
|||
|
||||
// Nuke the cookie before all else
|
||||
Session::destroy($key);
|
||||
if ((!$relogin) && Config::get('logout_redirect')) {
|
||||
$target = Config::get('logout_redirect');
|
||||
if ((!$relogin) && AmpConfig::get('logout_redirect')) {
|
||||
$target = AmpConfig::get('logout_redirect');
|
||||
} else {
|
||||
$target = Config::get('web_path') . '/login.php';
|
||||
$target = AmpConfig::get('web_path') . '/login.php';
|
||||
}
|
||||
|
||||
// Do a quick check to see if this is an AJAXed logout request
|
||||
|
@ -65,7 +65,7 @@ class Auth
|
|||
ob_start();
|
||||
|
||||
/* Set the correct headers */
|
||||
header("Content-type: text/xml; charset=" . Config::get('site_charset'));
|
||||
header("Content-type: text/xml; charset=" . AmpConfig::get('site_charset'));
|
||||
header("Content-Disposition: attachment; filename=ajax.xml");
|
||||
header("Expires: Tuesday, 27 Mar 1984 05:00:00 GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
|
@ -90,7 +90,7 @@ class Auth
|
|||
*/
|
||||
public static function login($username, $password)
|
||||
{
|
||||
foreach (Config::get('auth_methods') as $method) {
|
||||
foreach (AmpConfig::get('auth_methods') as $method) {
|
||||
$function_name = $method . '_auth';
|
||||
|
||||
if (!method_exists('Auth', $function_name)) {
|
||||
|
@ -184,7 +184,7 @@ class Auth
|
|||
*/
|
||||
private static function external_auth($username, $password)
|
||||
{
|
||||
$authenticator = Config::get('external_authenticator');
|
||||
$authenticator = AmpConfig::get('external_authenticator');
|
||||
if (!$authenticator) {
|
||||
return array(
|
||||
'success' => false,
|
||||
|
@ -244,22 +244,22 @@ class Auth
|
|||
*/
|
||||
private static function ldap_auth($username, $password)
|
||||
{
|
||||
$ldap_username = Config::get('ldap_username');
|
||||
$ldap_password = Config::get('ldap_password');
|
||||
$ldap_username = AmpConfig::get('ldap_username');
|
||||
$ldap_password = AmpConfig::get('ldap_password');
|
||||
|
||||
$require_group = Config::get('ldap_require_group');
|
||||
$require_group = AmpConfig::get('ldap_require_group');
|
||||
|
||||
// This is the DN for the users (required)
|
||||
$ldap_dn = Config::get('ldap_search_dn');
|
||||
$ldap_dn = AmpConfig::get('ldap_search_dn');
|
||||
|
||||
// This is the server url (required)
|
||||
$ldap_url = Config::get('ldap_url');
|
||||
$ldap_url = AmpConfig::get('ldap_url');
|
||||
|
||||
// This is the ldap filter string (required)
|
||||
$ldap_filter = Config::get('ldap_filter');
|
||||
$ldap_filter = AmpConfig::get('ldap_filter');
|
||||
|
||||
//This is the ldap objectclass (required)
|
||||
$ldap_class = Config::get('ldap_objectclass');
|
||||
$ldap_class = AmpConfig::get('ldap_objectclass');
|
||||
|
||||
if (!($ldap_dn && $ldap_url && $ldap_filter && $ldap_class)) {
|
||||
debug_event('ldap_auth', 'Required config value missing', 1);
|
||||
|
@ -268,8 +268,8 @@ class Auth
|
|||
return $results;
|
||||
}
|
||||
|
||||
$ldap_name_field = Config::get('ldap_name_field');
|
||||
$ldap_email_field = Config::get('ldap_email_field');
|
||||
$ldap_name_field = AmpConfig::get('ldap_name_field');
|
||||
$ldap_email_field = AmpConfig::get('ldap_email_field');
|
||||
|
||||
if ($ldap_link = ldap_connect($ldap_url) ) {
|
||||
|
||||
|
|
|
@ -127,78 +127,78 @@ class Browse extends Query
|
|||
case 'song':
|
||||
UI::show_box_top(T_('Songs') . $match, $class);
|
||||
Song::build_cache($object_ids);
|
||||
require_once Config::get('prefix') . '/templates/show_songs.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_songs.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'album':
|
||||
UI::show_box_top(T_('Albums') . $match, $class);
|
||||
Album::build_cache($object_ids,'extra');
|
||||
require_once Config::get('prefix') . '/templates/show_albums.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_albums.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'user':
|
||||
UI::show_box_top(T_('Manage Users') . $match, $class);
|
||||
require_once Config::get('prefix') . '/templates/show_users.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_users.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'artist':
|
||||
UI::show_box_top(T_('Artists') . $match, $class);
|
||||
Artist::build_cache($object_ids,'extra');
|
||||
require_once Config::get('prefix') . '/templates/show_artists.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_artists.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'live_stream':
|
||||
require_once Config::get('prefix') . '/templates/show_live_stream.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_live_stream.inc.php';
|
||||
UI::show_box_top(T_('Radio Stations') . $match, $class);
|
||||
require_once Config::get('prefix') . '/templates/show_live_streams.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_live_streams.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'playlist':
|
||||
Playlist::build_cache($object_ids);
|
||||
UI::show_box_top(T_('Playlists') . $match, $class);
|
||||
require_once Config::get('prefix') . '/templates/show_playlists.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_playlists.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'playlist_song':
|
||||
UI::show_box_top(T_('Playlist Songs') . $match, $class);
|
||||
require_once Config::get('prefix') . '/templates/show_playlist_songs.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_playlist_songs.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'playlist_localplay':
|
||||
UI::show_box_top(T_('Current Playlist'));
|
||||
require_once Config::get('prefix') . '/templates/show_localplay_playlist.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_localplay_playlist.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'smartplaylist':
|
||||
UI::show_box_top(T_('Smart Playlists') . $match, $class);
|
||||
require_once Config::get('prefix') . '/templates/show_smartplaylists.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_smartplaylists.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'catalog':
|
||||
UI::show_box_top(T_('Catalogs'), $class);
|
||||
require_once Config::get('prefix') . '/templates/show_catalogs.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_catalogs.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'shoutbox':
|
||||
UI::show_box_top(T_('Shoutbox Records'),$class);
|
||||
require_once Config::get('prefix') . '/templates/show_manage_shoutbox.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_manage_shoutbox.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'tag':
|
||||
Tag::build_cache($tags);
|
||||
UI::show_box_top(T_('Tag Cloud'),$class);
|
||||
require_once Config::get('prefix') . '/templates/show_tagcloud.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_tagcloud.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'video':
|
||||
Video::build_cache($object_ids);
|
||||
UI::show_box_top(T_('Videos'),$class);
|
||||
require_once Config::get('prefix') . '/templates/show_videos.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_videos.inc.php';
|
||||
UI::show_box_bottom();
|
||||
break;
|
||||
case 'democratic':
|
||||
UI::show_box_top(T_('Democratic Playlist'),$class);
|
||||
require_once Config::get('prefix') . '/templates/show_democratic_playlist.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_democratic_playlist.inc.php';
|
||||
UI::show_box_bottom();
|
||||
default:
|
||||
// Rien a faire
|
||||
|
|
|
@ -98,7 +98,7 @@ abstract class Catalog extends database_object
|
|||
{
|
||||
if (!$type) { return false; }
|
||||
|
||||
$filename = Config::get('prefix') . '/modules/catalog/' . $type . '.catalog.php';
|
||||
$filename = AmpConfig::get('prefix') . '/modules/catalog/' . $type . '.catalog.php';
|
||||
$include = require_once $filename;
|
||||
|
||||
if (!$include) {
|
||||
|
@ -175,7 +175,7 @@ abstract class Catalog extends database_object
|
|||
public static function get_catalog_types()
|
||||
{
|
||||
/* First open the dir */
|
||||
$handle = opendir(Config::get('prefix') . '/modules/catalog');
|
||||
$handle = opendir(AmpConfig::get('prefix') . '/modules/catalog');
|
||||
|
||||
if (!is_resource($handle)) {
|
||||
debug_event('catalog', 'Error: Unable to read catalog types directory', '1');
|
||||
|
@ -202,7 +202,7 @@ abstract class Catalog extends database_object
|
|||
|
||||
public static function is_audio_file($file)
|
||||
{
|
||||
$pattern = "/\.(" . Config::get('catalog_file_pattern');
|
||||
$pattern = "/\.(" . AmpConfig::get('catalog_file_pattern');
|
||||
if ($options['parse_m3u']) {
|
||||
$pattern .= "|m3u)$/i";
|
||||
} else {
|
||||
|
@ -213,7 +213,7 @@ abstract class Catalog extends database_object
|
|||
|
||||
public static function is_video_file($file)
|
||||
{
|
||||
$video_pattern = "/\.(" . Config::get('catalog_video_pattern') . ")$/i";
|
||||
$video_pattern = "/\.(" . AmpConfig::get('catalog_video_pattern') . ")$/i";
|
||||
return preg_match($video_pattern, $file);
|
||||
}
|
||||
|
||||
|
@ -308,8 +308,8 @@ abstract class Catalog extends database_object
|
|||
public function format()
|
||||
{
|
||||
$this->f_name = UI::truncate($this->name,
|
||||
Config::get('ellipse_threshold_title'));
|
||||
$this->f_name_link = '<a href="' . Config::get('web_path') .
|
||||
AmpConfig::get('ellipse_threshold_title'));
|
||||
$this->f_name_link = '<a href="' . AmpConfig::get('web_path') .
|
||||
'/admin/catalog.php?action=show_customize_catalog&catalog_id=' .
|
||||
$this->id . '" title="' . scrub_out($this->name) . '">' .
|
||||
scrub_out($this->f_name) . '</a>';
|
||||
|
@ -387,7 +387,7 @@ abstract class Catalog extends database_object
|
|||
$rename_pattern = $data['rename_pattern'];
|
||||
$sort_pattern = $data['sort_pattern'];
|
||||
|
||||
$filename = Config::get('prefix') . '/modules/catalog/' . $type . '.catalog.php';
|
||||
$filename = AmpConfig::get('prefix') . '/modules/catalog/' . $type . '.catalog.php';
|
||||
$include = require_once $filename;
|
||||
|
||||
if ($include) {
|
||||
|
@ -544,7 +544,7 @@ abstract class Catalog extends database_object
|
|||
public function gather_art()
|
||||
{
|
||||
// Make sure they've actually got methods
|
||||
$art_order = Config::get('art_order');
|
||||
$art_order = AmpConfig::get('art_order');
|
||||
if (!count($art_order)) {
|
||||
debug_event('gather_art', 'art_order not set, Catalog::gather_art aborting', 3);
|
||||
return true;
|
||||
|
@ -578,7 +578,7 @@ abstract class Catalog extends database_object
|
|||
if (strlen($image) > '5') {
|
||||
$art->insert($image, $results[0]['mime']);
|
||||
// If they've enabled resizing of images generate a thumbnail
|
||||
if (Config::get('resize_images')) {
|
||||
if (AmpConfig::get('resize_images')) {
|
||||
$thumb = $art->generate_thumb($image, array(
|
||||
'width' => 275,
|
||||
'height' => 275),
|
||||
|
@ -659,7 +659,7 @@ abstract class Catalog extends database_object
|
|||
$extension = Art::extension($art->raw_mime);
|
||||
|
||||
// Try the preferred filename, if that fails use folder.???
|
||||
$preferred_filename = Config::get('album_art_preferred_filename');
|
||||
$preferred_filename = AmpConfig::get('album_art_preferred_filename');
|
||||
if (!$preferred_filename ||
|
||||
strpos($preferred_filename, '%') !== false) {
|
||||
$preferred_filename = "folder.$extension";
|
||||
|
@ -935,7 +935,7 @@ abstract class Catalog extends database_object
|
|||
|
||||
debug_event('clean', 'Starting on ' . $this->name, 5);
|
||||
|
||||
require_once Config::get('prefix') . '/templates/show_clean_catalog.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_clean_catalog.inc.php';
|
||||
ob_flush();
|
||||
flush();
|
||||
|
||||
|
@ -1006,7 +1006,7 @@ abstract class Catalog extends database_object
|
|||
*/
|
||||
public static function trim_prefix($string)
|
||||
{
|
||||
$prefix_pattern = '/^(' . implode('\\s|',explode('|',Config::get('catalog_prefix_pattern'))) . '\\s)(.*)/i';
|
||||
$prefix_pattern = '/^(' . implode('\\s|',explode('|',AmpConfig::get('catalog_prefix_pattern'))) . '\\s)(.*)/i';
|
||||
preg_match($prefix_pattern, $string, $matches);
|
||||
|
||||
if (count($matches)) {
|
||||
|
@ -1048,7 +1048,7 @@ abstract class Catalog extends database_object
|
|||
|
||||
$results = explode("\n",$data);
|
||||
|
||||
$pattern = '/\.(' . Config::get('catalog_file_pattern') . ')$/i';
|
||||
$pattern = '/\.(' . AmpConfig::get('catalog_file_pattern') . ')$/i';
|
||||
|
||||
// Foreach what we're able to pull out from the file
|
||||
foreach ($results as $value) {
|
||||
|
@ -1070,7 +1070,7 @@ abstract class Catalog extends database_object
|
|||
|
||||
} // if it's a file
|
||||
// Check to see if it's a url from this ampache instance
|
||||
elseif (substr($value, 0, strlen(Config::get('web_path'))) == Config::get('web_path')) {
|
||||
elseif (substr($value, 0, strlen(AmpConfig::get('web_path'))) == AmpConfig::get('web_path')) {
|
||||
$data = Stream_URL::parse($value);
|
||||
$sql = 'SELECT COUNT(*) FROM `song` WHERE `id` = ?';
|
||||
$db_results = Dba::read($sql, array($data['id']));
|
||||
|
|
|
@ -50,7 +50,7 @@ class Core
|
|||
{
|
||||
// Ignore class with namespace, not used by Ampache
|
||||
if (strpos($class, '\\') === false) {
|
||||
$file = Config::get('prefix') . '/lib/class/' .
|
||||
$file = AmpConfig::get('prefix') . '/lib/class/' .
|
||||
strtolower($class) . '.class.php';
|
||||
|
||||
if (Core::is_readable($file)) {
|
||||
|
@ -76,7 +76,7 @@ class Core
|
|||
{
|
||||
// Make ourselves a nice little sid
|
||||
$sid = md5(uniqid(rand(), true));
|
||||
$window = Config::get('session_length');
|
||||
$window = AmpConfig::get('session_length');
|
||||
$expire = time() + $window;
|
||||
|
||||
// Register it
|
||||
|
|
|
@ -136,7 +136,7 @@ abstract class database_object
|
|||
*/
|
||||
public static function _auto_init()
|
||||
{
|
||||
self::$_enabled = Config::get('memory_cache');
|
||||
self::$_enabled = AmpConfig::get('memory_cache');
|
||||
|
||||
} // _auto_init
|
||||
|
||||
|
|
|
@ -240,10 +240,10 @@ class Dba
|
|||
*/
|
||||
private static function _connect()
|
||||
{
|
||||
$username = Config::get('database_username');
|
||||
$hostname = Config::get('database_hostname');
|
||||
$password = Config::get('database_password');
|
||||
$port = Config::get('database_port');
|
||||
$username = AmpConfig::get('database_username');
|
||||
$hostname = AmpConfig::get('database_hostname');
|
||||
$password = AmpConfig::get('database_password');
|
||||
$port = AmpConfig::get('database_port');
|
||||
|
||||
// Build the data source name
|
||||
if (strpos($hostname, '/') === 0) {
|
||||
|
@ -272,7 +272,7 @@ class Dba
|
|||
return false;
|
||||
}
|
||||
|
||||
$charset = self::translate_to_mysqlcharset(Config::get('site_charset'));
|
||||
$charset = self::translate_to_mysqlcharset(AmpConfig::get('site_charset'));
|
||||
$charset = $charset['charset'];
|
||||
if ($dbh->exec('SET NAMES ' . $charset) === false) {
|
||||
debug_event('Dba', 'Unable to set connection charset to ' . $charset, 1);
|
||||
|
@ -283,7 +283,7 @@ class Dba
|
|||
debug_event('Dba', 'Unable to select database ' . $database . ': ' . json_encode($dbh->errorInfo()), 1);
|
||||
}
|
||||
|
||||
if (Config::get('sql_profiling')) {
|
||||
if (AmpConfig::get('sql_profiling')) {
|
||||
$dbh->exec('SET profiling=1');
|
||||
$dbh->exec('SET profiling_history_size=50');
|
||||
$dbh->exec('SET query_cache_type=0');
|
||||
|
@ -339,7 +339,7 @@ class Dba
|
|||
*/
|
||||
public static function show_profile()
|
||||
{
|
||||
if (Config::get('sql_profiling')) {
|
||||
if (AmpConfig::get('sql_profiling')) {
|
||||
print '<br/>Profiling data: <br/>';
|
||||
$res = Dba::read('SHOW PROFILES');
|
||||
print '<table>';
|
||||
|
@ -359,19 +359,19 @@ class Dba
|
|||
public static function dbh($database='')
|
||||
{
|
||||
if (!$database) {
|
||||
$database = Config::get('database_name');
|
||||
$database = AmpConfig::get('database_name');
|
||||
}
|
||||
|
||||
// Assign the Handle name that we are going to store
|
||||
$handle = 'dbh_' . $database;
|
||||
|
||||
if (!is_object(Config::get($handle))) {
|
||||
if (!is_object(AmpConfig::get($handle))) {
|
||||
$dbh = self::_connect();
|
||||
self::_setup_dbh($dbh, $database);
|
||||
Config::set($handle, $dbh, true);
|
||||
AmpConfig::set($handle, $dbh, true);
|
||||
return $dbh;
|
||||
} else {
|
||||
return Config::get($handle);
|
||||
return AmpConfig::get($handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -383,13 +383,13 @@ class Dba
|
|||
public static function disconnect($database = '')
|
||||
{
|
||||
if (!$database) {
|
||||
$database = Config::get('database_name');
|
||||
$database = AmpConfig::get('database_name');
|
||||
}
|
||||
|
||||
$handle = 'dbh_' . $database;
|
||||
|
||||
// Nuke it
|
||||
Config::set($handle, false, true);
|
||||
AmpConfig::set($handle, false, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -479,12 +479,12 @@ class Dba
|
|||
*/
|
||||
public static function reset_db_charset()
|
||||
{
|
||||
$translated_charset = self::translate_to_mysqlcharset(Config::get('site_charset'));
|
||||
$translated_charset = self::translate_to_mysqlcharset(AmpConfig::get('site_charset'));
|
||||
$target_charset = $translated_charset['charset'];
|
||||
$target_collation = $translated_charset['collation'];
|
||||
|
||||
// Alter the charset for the entire database
|
||||
$sql = "ALTER DATABASE `" . Config::get('database_name') . "` DEFAULT CHARACTER SET $target_charset COLLATE $target_collation";
|
||||
$sql = "ALTER DATABASE `" . AmpConfig::get('database_name') . "` DEFAULT CHARACTER SET $target_charset COLLATE $target_collation";
|
||||
$db_results = Dba::write($sql);
|
||||
|
||||
$sql = "SHOW TABLES";
|
||||
|
|
|
@ -194,7 +194,7 @@ class Democratic extends Tmp_Playlist
|
|||
*/
|
||||
public static function get_current_playlist()
|
||||
{
|
||||
$democratic_id = Config::get('democratic_id');
|
||||
$democratic_id = AmpConfig::get('democratic_id');
|
||||
|
||||
if (!$democratic_id) {
|
||||
$level = Dba::escape($GLOBALS['user']->access);
|
||||
|
|
|
@ -98,7 +98,7 @@ class Localplay
|
|||
{
|
||||
if (!$this->type) { return false; }
|
||||
|
||||
$filename = Config::get('prefix') . '/modules/localplay/' . $this->type . '.controller.php';
|
||||
$filename = AmpConfig::get('prefix') . '/modules/localplay/' . $this->type . '.controller.php';
|
||||
$include = require_once $filename;
|
||||
|
||||
if (!$include) {
|
||||
|
@ -139,7 +139,7 @@ class Localplay
|
|||
public static function get_controllers()
|
||||
{
|
||||
/* First open the dir */
|
||||
$handle = opendir(Config::get('prefix') . '/modules/localplay');
|
||||
$handle = opendir(AmpConfig::get('prefix') . '/modules/localplay');
|
||||
|
||||
if (!is_resource($handle)) {
|
||||
debug_event('Localplay','Error: Unable to read localplay controller directory','1');
|
||||
|
@ -205,7 +205,7 @@ class Localplay
|
|||
$this->_player->uninstall();
|
||||
|
||||
// If its our current player, reset player to nothing
|
||||
if (Config::get('localplay_controller') == $this->type) {
|
||||
if (AmpConfig::get('localplay_controller') == $this->type) {
|
||||
Preference::update('localplay_controller',$GLOBALS['user']->id,'');
|
||||
}
|
||||
|
||||
|
|
|
@ -65,17 +65,17 @@ class Mailer
|
|||
*/
|
||||
public function set_default_sender()
|
||||
{
|
||||
$user = Config::get('mail_user');
|
||||
$user = AmpConfig::get('mail_user');
|
||||
if (!$user) {
|
||||
$user = 'info';
|
||||
}
|
||||
|
||||
$domain = Config::get('mail_domain');
|
||||
$domain = AmpConfig::get('mail_domain');
|
||||
if (!$domain) {
|
||||
$domain = 'example.com';
|
||||
}
|
||||
|
||||
$fromname = Config::get('mail_name');
|
||||
$fromname = AmpConfig::get('mail_name');
|
||||
if (!$fromname) {
|
||||
$fromname = 'Ampache';
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ class Mailer
|
|||
*/
|
||||
public function send($phpmailer = null)
|
||||
{
|
||||
$mailtype = Config::get('mail_type');
|
||||
$mailtype = AmpConfig::get('mail_type');
|
||||
|
||||
if ($phpmailer == null) {
|
||||
$mail = new PHPMailer();
|
||||
|
@ -149,7 +149,7 @@ class Mailer
|
|||
$mail = $phpmailer;
|
||||
}
|
||||
|
||||
$mail->CharSet = Config::get('site_charset');
|
||||
$mail->CharSet = AmpConfig::get('site_charset');
|
||||
$mail->Encoding = 'base64';
|
||||
$mail->From = $this->sender;
|
||||
$mail->Sender = $this->sender;
|
||||
|
@ -161,16 +161,16 @@ class Mailer
|
|||
}
|
||||
$mail->Body = $this->message;
|
||||
|
||||
$sendmail = Config::get('sendmail_path');
|
||||
$sendmail = AmpConfig::get('sendmail_path');
|
||||
$sendmail = $sendmail ? $sendmail : '/usr/sbin/sendmail';
|
||||
$mailhost = Config::get('mail_host');
|
||||
$mailhost = AmpConfig::get('mail_host');
|
||||
$mailhost = $mailhost ? $mailhost : 'localhost';
|
||||
$mailport = Config::get('mail_port');
|
||||
$mailport = AmpConfig::get('mail_port');
|
||||
$mailport = $mailport ? $mailport : 25;
|
||||
$mailauth = Config::get('mail_auth');
|
||||
$mailuser = Config::get('mail_auth_user');
|
||||
$mailauth = AmpConfig::get('mail_auth');
|
||||
$mailuser = AmpConfig::get('mail_auth_user');
|
||||
$mailuser = $mailuser ? $mailuser : '';
|
||||
$mailpass = Config::get('mail_auth_pass');
|
||||
$mailpass = AmpConfig::get('mail_auth_pass');
|
||||
$mailpass = $mailpass ? $mailpass : '';
|
||||
|
||||
switch ($mailtype) {
|
||||
|
@ -183,7 +183,7 @@ class Mailer
|
|||
$mail->Username = $mailuser;
|
||||
$mail->Password = $mailpass;
|
||||
}
|
||||
if ($mailsecure = Config::get('mail_secure_smtp')) {
|
||||
if ($mailsecure = AmpConfig::get('mail_secure_smtp')) {
|
||||
$mail->SMTPSecure = ($mailsecure == 'ssl') ? 'ssl' : 'tls';
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -107,7 +107,7 @@ class Playlist extends playlist_object
|
|||
public function format()
|
||||
{
|
||||
parent::format();
|
||||
$this->f_link = '<a href="' . Config::get('web_path') . '/playlist.php?action=show_playlist&playlist_id=' . $this->id . '">' . $this->f_name . '</a>';
|
||||
$this->f_link = '<a href="' . AmpConfig::get('web_path') . '/playlist.php?action=show_playlist&playlist_id=' . $this->id . '">' . $this->f_name . '</a>';
|
||||
|
||||
} // format
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ abstract class playlist_object extends database_object
|
|||
*/
|
||||
public function format()
|
||||
{
|
||||
$this->f_name = UI::truncate($this->name,Config::get('ellipse_threshold_title'));
|
||||
$this->f_name = UI::truncate($this->name,AmpConfig::get('ellipse_threshold_title'));
|
||||
$this->f_type = ($this->type == 'private') ? UI::get_icon('lock', T_('Private')) : '';
|
||||
|
||||
$client = new User($this->user);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
require_once Config::get('prefix') . '/modules/plugins/helper.php';
|
||||
require_once AmpConfig::get('prefix') . '/modules/plugins/helper.php';
|
||||
|
||||
/**
|
||||
* Plex Class
|
||||
|
@ -50,7 +50,7 @@ class Plex_Api
|
|||
|
||||
if (strtolower($f) == "xml") {
|
||||
header("Cache-Control: no-cache", true);
|
||||
header("Content-type: text/xml; charset=" . Config::get('site_charset'), true);
|
||||
header("Content-type: text/xml; charset=" . AmpConfig::get('site_charset'), true);
|
||||
} elseif (substr(strtolower($f), 0, 6) == "image/") {
|
||||
header("Cache-Control: public, max-age=604800", true);
|
||||
header("Content-type: " . $f, true);
|
||||
|
|
|
@ -53,7 +53,7 @@ class Plugin
|
|||
public function _get_info($name)
|
||||
{
|
||||
/* Require the file we want */
|
||||
require_once Config::get('prefix') . '/modules/plugins/' . $name . '.plugin.php';
|
||||
require_once AmpConfig::get('prefix') . '/modules/plugins/' . $name . '.plugin.php';
|
||||
|
||||
$plugin_name = "Ampache$name";
|
||||
|
||||
|
@ -76,7 +76,7 @@ class Plugin
|
|||
$results = array();
|
||||
|
||||
// Open up the plugin dir
|
||||
$handle = opendir(Config::get('prefix') . '/modules/plugins');
|
||||
$handle = opendir(AmpConfig::get('prefix') . '/modules/plugins');
|
||||
|
||||
if (!is_resource($handle)) {
|
||||
debug_event('Plugins','Unable to read plugins directory','1');
|
||||
|
|
|
@ -137,7 +137,7 @@ class Preference
|
|||
public static function has_access($preference)
|
||||
{
|
||||
// Nothing for those demo thugs
|
||||
if (Config::get('demo_mode')) { return false; }
|
||||
if (AmpConfig::get('demo_mode')) { return false; }
|
||||
|
||||
$preference = Dba::escape($preference);
|
||||
|
||||
|
@ -348,7 +348,7 @@ class Preference
|
|||
public static function load_from_session($uid=-1)
|
||||
{
|
||||
if (is_array($_SESSION['userdata']['preferences']) AND $_SESSION['userdata']['uid'] == $uid) {
|
||||
Config::set_by_array($_SESSION['userdata']['preferences'], true);
|
||||
AmpConfig::set_by_array($_SESSION['userdata']['preferences'], true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -434,7 +434,7 @@ class Preference
|
|||
$results['theme_path'] = '/themes/reborn';
|
||||
}
|
||||
|
||||
Config::set_by_array($results, true);
|
||||
AmpConfig::set_by_array($results, true);
|
||||
$_SESSION['userdata']['preferences'] = $results;
|
||||
$_SESSION['userdata']['uid'] = $user_id;
|
||||
|
||||
|
|
|
@ -364,7 +364,7 @@ class Query
|
|||
$this->set_static_content(false);
|
||||
$this->set_is_simple(false);
|
||||
$this->set_start(0);
|
||||
$this->set_offset(Config::get('offset_limit') ? Config::get('offset_limit') : '25');
|
||||
$this->set_offset(AmpConfig::get('offset_limit') ? AmpConfig::get('offset_limit') : '25');
|
||||
|
||||
} // reset
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ class Rating extends database_object
|
|||
public static function get_highest($type, $count='', $offset='')
|
||||
{
|
||||
if (!$count) {
|
||||
$count = Config::get('popular_threshold');
|
||||
$count = AmpConfig::get('popular_threshold');
|
||||
}
|
||||
$count = intval($count);
|
||||
if (!$offset) {
|
||||
|
@ -258,14 +258,14 @@ class Rating extends database_object
|
|||
public static function show($object_id, $type, $static=false)
|
||||
{
|
||||
// If ratings aren't enabled don't do anything
|
||||
if (!Config::get('ratings')) { return false; }
|
||||
if (!AmpConfig::get('ratings')) { return false; }
|
||||
|
||||
$rating = new Rating($object_id, $type);
|
||||
|
||||
if ($static) {
|
||||
require Config::get('prefix') . '/templates/show_static_object_rating.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_static_object_rating.inc.php';
|
||||
} else {
|
||||
require Config::get('prefix') . '/templates/show_object_rating.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_object_rating.inc.php';
|
||||
}
|
||||
|
||||
} // show
|
||||
|
|
|
@ -37,17 +37,17 @@ class Recommendation
|
|||
*/
|
||||
private static function get_lastfm_results($method, $query)
|
||||
{
|
||||
$api_key = Config::get('lastfm_api_key');
|
||||
$api_key = AmpConfig::get('lastfm_api_key');
|
||||
$api_base = "http://ws.audioscrobbler.com/2.0/?method=";
|
||||
$url = $api_base . $method . '&api_key=' . $api_key . '&' . $query;
|
||||
debug_event('Recommendation', 'search url : ' . $url, 5);
|
||||
|
||||
$snoopy = new Snoopy();
|
||||
if (Config::get('proxy_host') AND Config::get('proxy_port')) {
|
||||
$snoopy->proxy_user = Config::get('proxy_host');
|
||||
$snoopy->proxy_port = Config::get('proxy_port');
|
||||
$snoopy->proxy_user = Config::get('proxy_user');
|
||||
$snoopy->proxy_pass = Config::get('proxy_pass');
|
||||
if (AmpConfig::get('proxy_host') AND AmpConfig::get('proxy_port')) {
|
||||
$snoopy->proxy_user = AmpConfig::get('proxy_host');
|
||||
$snoopy->proxy_port = AmpConfig::get('proxy_port');
|
||||
$snoopy->proxy_user = AmpConfig::get('proxy_user');
|
||||
$snoopy->proxy_pass = AmpConfig::get('proxy_pass');
|
||||
}
|
||||
$snoopy->fetch($url);
|
||||
$content = $snoopy->results;
|
||||
|
|
|
@ -49,7 +49,7 @@ class Registration
|
|||
// We are the system
|
||||
$mailer->set_default_sender();
|
||||
|
||||
$mailer->subject = sprintf(T_("New User Registration at %s"), Config::get('site_title'));
|
||||
$mailer->subject = sprintf(T_("New User Registration at %s"), AmpConfig::get('site_title'));
|
||||
|
||||
$mailer->message = sprintf(T_("Thank you for registering\n\n
|
||||
Please keep this e-mail for your records. Your account information is as follows:
|
||||
|
@ -63,7 +63,7 @@ Your account is currently inactive. You cannot use it until you've visited the f
|
|||
%s
|
||||
|
||||
Thank you for registering
|
||||
"), $username, $password, Config::get('web_path') . "/register.php?action=validate&username=$username&auth=$validation");
|
||||
"), $username, $password, AmpConfig::get('web_path') . "/register.php?action=validate&username=$username&auth=$validation");
|
||||
|
||||
$mailer->recipient = $email;
|
||||
$mailer->recipient_name = $fullname;
|
||||
|
@ -71,7 +71,7 @@ Thank you for registering
|
|||
$mailer->send();
|
||||
|
||||
// Check to see if the admin should be notified
|
||||
if (Config::get('admin_notify_reg')) {
|
||||
if (AmpConfig::get('admin_notify_reg')) {
|
||||
$mailer->message = sprintf(T_("A new user has registered
|
||||
The following values were entered.
|
||||
|
||||
|
@ -94,7 +94,7 @@ E-mail: %s
|
|||
*/
|
||||
public static function show_agreement()
|
||||
{
|
||||
$filename = Config::get('prefix') . '/config/registration_agreement.php';
|
||||
$filename = AmpConfig::get('prefix') . '/config/registration_agreement.php';
|
||||
|
||||
if (!file_exists($filename)) { return false; }
|
||||
|
||||
|
|
|
@ -255,7 +255,7 @@ class Search extends playlist_object
|
|||
'widget' => array('input', 'text')
|
||||
);
|
||||
|
||||
if (Config::get('ratings')) {
|
||||
if (AmpConfig::get('ratings')) {
|
||||
$this->types[] = array(
|
||||
'name' => 'rating',
|
||||
'label' => T_('Rating'),
|
||||
|
@ -273,7 +273,7 @@ class Search extends playlist_object
|
|||
);
|
||||
}
|
||||
|
||||
if (Config::get('show_played_times')) {
|
||||
if (AmpConfig::get('show_played_times')) {
|
||||
$this->types[] = array(
|
||||
'name' => 'played_times',
|
||||
'label' => T_('# Played'),
|
||||
|
@ -382,7 +382,7 @@ class Search extends playlist_object
|
|||
'widget' => array('input', 'text')
|
||||
);
|
||||
|
||||
if (Config::get('ratings')) {
|
||||
if (AmpConfig::get('ratings')) {
|
||||
$this->types[] = array(
|
||||
'name' => 'rating',
|
||||
'label' => T_('Rating'),
|
||||
|
@ -582,7 +582,7 @@ class Search extends playlist_object
|
|||
public function format()
|
||||
{
|
||||
parent::format();
|
||||
$this->f_link = '<a href="' . Config::get('web_path') .
|
||||
$this->f_link = '<a href="' . AmpConfig::get('web_path') .
|
||||
'/smartplaylist.php?action=show_playlist&playlist_id=' .
|
||||
$this->id . '">' . $this->f_name . '</a>';
|
||||
}
|
||||
|
|
|
@ -73,13 +73,13 @@ class Session
|
|||
return true;
|
||||
}
|
||||
|
||||
$length = Config::get('session_length');
|
||||
$length = AmpConfig::get('session_length');
|
||||
|
||||
// Check to see if remember me cookie is set, if so use remember
|
||||
// length, otherwise use the session length
|
||||
$expire = isset($_COOKIE[Config::get('session_name') . '_remember'])
|
||||
? time() + Config::get('remember_length')
|
||||
: time() + Config::get('session_length');
|
||||
$expire = isset($_COOKIE[AmpConfig::get('session_name') . '_remember'])
|
||||
? time() + AmpConfig::get('remember_length')
|
||||
: time() + AmpConfig::get('session_length');
|
||||
|
||||
$sql = 'UPDATE `session` SET `value` = ?, `expire` = ? WHERE `id` = ?';
|
||||
$db_results = Dba::read($sql, array($value, $expire, $key));
|
||||
|
@ -105,7 +105,7 @@ class Session
|
|||
debug_event('SESSION', 'Deleting Session with key:' . $key, 6);
|
||||
|
||||
// Destroy our cookie!
|
||||
setcookie(Config::get('session_name'), '', time() - 86400);
|
||||
setcookie(AmpConfig::get('session_name'), '', time() - 86400);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -210,9 +210,9 @@ class Session
|
|||
$agent = (!empty($data['agent'])) ? $data['agent'] : substr($_SERVER['HTTP_USER_AGENT'], 0, 254);
|
||||
|
||||
if ($type == 'stream') {
|
||||
$expire = time() + Config::get('stream_length');
|
||||
$expire = time() + AmpConfig::get('stream_length');
|
||||
} else {
|
||||
$expire = time() + Config::get('session_length');
|
||||
$expire = time() + AmpConfig::get('session_length');
|
||||
}
|
||||
|
||||
if (!strlen($value)) { $value = ' '; }
|
||||
|
@ -240,7 +240,7 @@ class Session
|
|||
*/
|
||||
public static function check()
|
||||
{
|
||||
$session_name = Config::get('session_name');
|
||||
$session_name = AmpConfig::get('session_name');
|
||||
|
||||
// No cookie no go!
|
||||
if (!isset($_COOKIE[$session_name])) { return false; }
|
||||
|
@ -253,10 +253,10 @@ class Session
|
|||
// Set up the cookie params before we start the session.
|
||||
// This is vital
|
||||
session_set_cookie_params(
|
||||
Config::get('cookie_life'),
|
||||
Config::get('cookie_path'),
|
||||
Config::get('cookie_domain'),
|
||||
Config::get('cookie_secure'));
|
||||
AmpConfig::get('cookie_life'),
|
||||
AmpConfig::get('cookie_path'),
|
||||
AmpConfig::get('cookie_domain'),
|
||||
AmpConfig::get('cookie_secure'));
|
||||
|
||||
// Set name
|
||||
session_name($session_name);
|
||||
|
@ -291,9 +291,9 @@ class Session
|
|||
break;
|
||||
case 'interface':
|
||||
$sql = 'SELECT * FROM `session` WHERE `id` = ? AND `expire` > ?';
|
||||
if (Config::get('use_auth')) {
|
||||
if (AmpConfig::get('use_auth')) {
|
||||
// Build a list of enabled authentication types
|
||||
$types = Config::get('auth_methods');
|
||||
$types = AmpConfig::get('auth_methods');
|
||||
$enabled_types = implode("','", $types);
|
||||
$sql .= " AND `type` IN('$enabled_types')";
|
||||
}
|
||||
|
@ -320,12 +320,12 @@ class Session
|
|||
public static function extend($sid, $type = null)
|
||||
{
|
||||
$time = time();
|
||||
$expire = isset($_COOKIE[Config::get('session_name') . '_remember'])
|
||||
? $time + Config::get('remember_length')
|
||||
: $time + Config::get('session_length');
|
||||
$expire = isset($_COOKIE[AmpConfig::get('session_name') . '_remember'])
|
||||
? $time + AmpConfig::get('remember_length')
|
||||
: $time + AmpConfig::get('session_length');
|
||||
|
||||
if ($type == 'stream') {
|
||||
$expire = $time + Config::get('stream_length');
|
||||
$expire = $time + AmpConfig::get('stream_length');
|
||||
}
|
||||
|
||||
$sql = 'UPDATE `session` SET `expire` = ? WHERE `id`= ?';
|
||||
|
@ -345,7 +345,7 @@ class Session
|
|||
public static function _auto_init()
|
||||
{
|
||||
if (!function_exists('session_start')) {
|
||||
header("Location:" . Config::get('web_path') . "/test.php");
|
||||
header("Location:" . AmpConfig::get('web_path') . "/test.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -373,14 +373,14 @@ class Session
|
|||
public static function create_cookie()
|
||||
{
|
||||
// Set up the cookie prefs before we throw down, this is very important
|
||||
$cookie_life = Config::get('cookie_life');
|
||||
$cookie_path = Config::get('cookie_path');
|
||||
$cookie_life = AmpConfig::get('cookie_life');
|
||||
$cookie_path = AmpConfig::get('cookie_path');
|
||||
$cookie_domain = false;
|
||||
$cookie_secure = Config::get('cookie_secure');
|
||||
$cookie_secure = AmpConfig::get('cookie_secure');
|
||||
|
||||
session_set_cookie_params($cookie_life, $cookie_path, $cookie_domain, $cookie_secure);
|
||||
|
||||
session_name(Config::get('session_name'));
|
||||
session_name(AmpConfig::get('session_name'));
|
||||
|
||||
/* Start the session */
|
||||
self::ungimp_ie();
|
||||
|
@ -394,10 +394,10 @@ class Session
|
|||
*/
|
||||
public static function create_remember_cookie()
|
||||
{
|
||||
$remember_length = Config::get('remember_length');
|
||||
$session_name = Config::get('session_name');
|
||||
$remember_length = AmpConfig::get('remember_length');
|
||||
$session_name = AmpConfig::get('session_name');
|
||||
|
||||
Config::set('cookie_life', $remember_length, true);
|
||||
AmpConfig::set('cookie_life', $remember_length, true);
|
||||
setcookie($session_name . '_remember', "Rappelez-vous, rappelez-vous le 27 mars", time() + $remember_length, '/');
|
||||
}
|
||||
|
||||
|
|
|
@ -145,14 +145,14 @@ class Shoutbox
|
|||
{
|
||||
switch ($this->object_type) {
|
||||
case 'album':
|
||||
$image_string = "<img class=\"shoutboximage\" height=\"75\" width=\"75\" src=\"" . Config::get('web_path') . "/image.php?id=" . $this->object_id . "&thumb=1\" />";
|
||||
$image_string = "<img class=\"shoutboximage\" height=\"75\" width=\"75\" src=\"" . AmpConfig::get('web_path') . "/image.php?id=" . $this->object_id . "&thumb=1\" />";
|
||||
break;
|
||||
case 'artist':
|
||||
|
||||
break;
|
||||
case 'song':
|
||||
$song = new Song($this->object_id);
|
||||
$image_string = "<img class=\"shoutboximage\" height=\"75\" width=\"75\" src=\"" . Config::get('web_path') . "/image.php?id=" . $song->album . "&thumb=1\" />";
|
||||
$image_string = "<img class=\"shoutboximage\" height=\"75\" width=\"75\" src=\"" . AmpConfig::get('web_path') . "/image.php?id=" . $song->album . "&thumb=1\" />";
|
||||
break;
|
||||
default:
|
||||
// Rien a faire
|
||||
|
|
|
@ -182,7 +182,7 @@ class Song extends database_object implements media
|
|||
$db_results = Dba::read($sql);
|
||||
|
||||
while ($row = Dba::fetch_assoc($db_results)) {
|
||||
if (Config::get('show_played_times')) {
|
||||
if (AmpConfig::get('show_played_times')) {
|
||||
$row['object_cnt'] = Stats::get_object_count('song', $row['id']);
|
||||
}
|
||||
parent::add_to_cache('song', $row['id'], $row);
|
||||
|
@ -200,10 +200,10 @@ class Song extends database_object implements media
|
|||
Art::build_cache($albums);
|
||||
|
||||
// If we're rating this then cache them as well
|
||||
if (Config::get('ratings')) {
|
||||
if (AmpConfig::get('ratings')) {
|
||||
Rating::build_cache('song', $song_ids);
|
||||
}
|
||||
if (Config::get('userflags')) {
|
||||
if (AmpConfig::get('userflags')) {
|
||||
Userflag::build_cache('song', $song_ids);
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ class Song extends database_object implements media
|
|||
|
||||
$results = Dba::fetch_assoc($db_results);
|
||||
if (isset($results['id'])) {
|
||||
if (Config::get('show_played_times')) {
|
||||
if (AmpConfig::get('show_played_times')) {
|
||||
$results['object_cnt'] = Stats::get_object_count('song', $results['id']);
|
||||
}
|
||||
|
||||
|
@ -835,21 +835,21 @@ class Song extends database_object implements media
|
|||
|
||||
// Format the album name
|
||||
$this->f_album_full = $this->get_album_name();
|
||||
$this->f_album = UI::truncate($this->f_album_full,Config::get('ellipse_threshold_album'));
|
||||
$this->f_album = UI::truncate($this->f_album_full,AmpConfig::get('ellipse_threshold_album'));
|
||||
|
||||
// Format the artist name
|
||||
$this->f_artist_full = $this->get_artist_name();
|
||||
$this->f_artist = UI::truncate($this->f_artist_full,Config::get('ellipse_threshold_artist'));
|
||||
$this->f_artist = UI::truncate($this->f_artist_full,AmpConfig::get('ellipse_threshold_artist'));
|
||||
|
||||
// Format the title
|
||||
$this->f_title_full = $this->title;
|
||||
$this->f_title = UI::truncate($this->title,Config::get('ellipse_threshold_title'));
|
||||
$this->f_title = UI::truncate($this->title,AmpConfig::get('ellipse_threshold_title'));
|
||||
|
||||
// Create Links for the different objects
|
||||
$this->link = Config::get('web_path') . "/song.php?action=show_song&song_id=" . $this->id;
|
||||
$this->link = AmpConfig::get('web_path') . "/song.php?action=show_song&song_id=" . $this->id;
|
||||
$this->f_link = "<a href=\"" . scrub_out($this->link) . "\" title=\"" . scrub_out($this->f_artist) . " - " . scrub_out($this->title) . "\"> " . scrub_out($this->f_title) . "</a>";
|
||||
$this->f_album_link = "<a href=\"" . Config::get('web_path') . "/albums.php?action=show&album=" . $this->album . "\" title=\"" . scrub_out($this->f_album_full) . "\"> " . scrub_out($this->f_album) . "</a>";
|
||||
$this->f_artist_link = "<a href=\"" . Config::get('web_path') . "/artists.php?action=show&artist=" . $this->artist . "\" title=\"" . scrub_out($this->f_artist_full) . "\"> " . scrub_out($this->f_artist) . "</a>";
|
||||
$this->f_album_link = "<a href=\"" . AmpConfig::get('web_path') . "/albums.php?action=show&album=" . $this->album . "\" title=\"" . scrub_out($this->f_album_full) . "\"> " . scrub_out($this->f_album) . "</a>";
|
||||
$this->f_artist_link = "<a href=\"" . AmpConfig::get('web_path') . "/artists.php?action=show&artist=" . $this->artist . "\" title=\"" . scrub_out($this->f_artist_full) . "\"> " . scrub_out($this->f_artist) . "</a>";
|
||||
|
||||
// Format the Bitrate
|
||||
$this->f_bitrate = intval($this->bitrate/1000) . "-" . strtoupper($this->mode);
|
||||
|
@ -871,7 +871,7 @@ class Song extends database_object implements media
|
|||
// Format the size
|
||||
$this->f_size = UI::format_bytes($this->size);
|
||||
|
||||
$this->f_lyrics = "<a title=\"" . scrub_out($this->title) . "\" href=\"" . Config::get('web_path') . "/song.php?action=show_lyrics&song_id=" . $this->id . "\">" . T_('Show Lyrics') . "</a>";
|
||||
$this->f_lyrics = "<a title=\"" . scrub_out($this->title) . "\" href=\"" . AmpConfig::get('web_path') . "/song.php?action=show_lyrics&song_id=" . $this->id . "\">" . T_('Show Lyrics') . "</a>";
|
||||
|
||||
return true;
|
||||
|
||||
|
@ -1025,7 +1025,7 @@ class Song extends database_object implements media
|
|||
while ($row = Dba::fetch_assoc($db_results)) {
|
||||
if (isset($results[$row['object_id']])) { continue; }
|
||||
$results[$row['object_id']] = $row;
|
||||
if (count($results) >= Config::get('popular_threshold')) { break; }
|
||||
if (count($results) >= AmpConfig::get('popular_threshold')) { break; }
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
@ -1040,7 +1040,7 @@ class Song extends database_object implements media
|
|||
public static function get_stream_types_for_type($type)
|
||||
{
|
||||
$types = array();
|
||||
$transcode = Config::get('transcode_' . $type);
|
||||
$transcode = AmpConfig::get('transcode_' . $type);
|
||||
|
||||
if ($transcode != 'required') {
|
||||
$types[] = 'native';
|
||||
|
@ -1058,9 +1058,9 @@ class Song extends database_object implements media
|
|||
|
||||
if ($target) {
|
||||
debug_event('transcode', 'Explicit format request', 5);
|
||||
} else if ($target = Config::get('encode_target_' . $source)) {
|
||||
} else if ($target = AmpConfig::get('encode_target_' . $source)) {
|
||||
debug_event('transcode', 'Defaulting to configured target format for ' . $source, 5);
|
||||
} else if ($target = Config::get('encode_target')) {
|
||||
} else if ($target = AmpConfig::get('encode_target')) {
|
||||
debug_event('transcode', 'Using default target format', 5);
|
||||
} else {
|
||||
$target = $source;
|
||||
|
@ -1069,8 +1069,8 @@ class Song extends database_object implements media
|
|||
|
||||
debug_event('transcode', 'Transcoding from ' . $source . ' to ' . $target, 5);
|
||||
|
||||
$cmd = Config::get('transcode_cmd_' . $source) ?: Config::get('transcode_cmd');
|
||||
$args = Config::get('encode_args_' . $target);
|
||||
$cmd = AmpConfig::get('transcode_cmd_' . $source) ?: AmpConfig::get('transcode_cmd');
|
||||
$args = AmpConfig::get('encode_args_' . $target);
|
||||
|
||||
if (!$args) {
|
||||
debug_event('transcode', 'Target format ' . $target . ' is not properly configured', 2);
|
||||
|
|
|
@ -166,7 +166,7 @@ class Stats
|
|||
$type = self::validate_type($type);
|
||||
/* If they don't pass one, then use the preference */
|
||||
if (!$threshold) {
|
||||
$threshold = Config::get('stats_threshold');
|
||||
$threshold = AmpConfig::get('stats_threshold');
|
||||
}
|
||||
$date = time() - (86400*$threshold);
|
||||
|
||||
|
@ -185,7 +185,7 @@ class Stats
|
|||
public static function get_top($type,$count='',$threshold = '',$offset='')
|
||||
{
|
||||
if (!$count) {
|
||||
$count = Config::get('popular_threshold');
|
||||
$count = AmpConfig::get('popular_threshold');
|
||||
}
|
||||
|
||||
$count = intval($count);
|
||||
|
@ -231,11 +231,11 @@ class Stats
|
|||
{
|
||||
/* If they don't pass one, then use the preference */
|
||||
if (!$threshold) {
|
||||
$threshold = Config::get('stats_threshold');
|
||||
$threshold = AmpConfig::get('stats_threshold');
|
||||
}
|
||||
|
||||
if (!$count) {
|
||||
$count = Config::get('popular_threshold');
|
||||
$count = AmpConfig::get('popular_threshold');
|
||||
}
|
||||
|
||||
$count = intval($count);
|
||||
|
@ -273,7 +273,7 @@ class Stats
|
|||
if ($full) {
|
||||
$date = '0';
|
||||
} else {
|
||||
$date = time() - (86400*Config::get('stats_threshold'));
|
||||
$date = time() - (86400*AmpConfig::get('stats_threshold'));
|
||||
}
|
||||
|
||||
/* Select Objects based on user */
|
||||
|
@ -337,7 +337,7 @@ class Stats
|
|||
*/
|
||||
public static function get_newest($type, $limit='', $offset='', $catalog=0)
|
||||
{
|
||||
if (!$count) { $count = Config::get('popular_threshold'); }
|
||||
if (!$count) { $count = AmpConfig::get('popular_threshold'); }
|
||||
if (!$offset) {
|
||||
$limit = $count;
|
||||
} else {
|
||||
|
|
|
@ -43,10 +43,10 @@ class Stream
|
|||
|
||||
public static function get_allowed_bitrate($song)
|
||||
{
|
||||
$max_bitrate = Config::get('max_bit_rate');
|
||||
$min_bitrate = Config::get('min_bit_rate');
|
||||
$max_bitrate = AmpConfig::get('max_bit_rate');
|
||||
$min_bitrate = AmpConfig::get('min_bit_rate');
|
||||
// FIXME: This should be configurable for each output type
|
||||
$user_sample_rate = Config::get('sample_rate');
|
||||
$user_sample_rate = AmpConfig::get('sample_rate');
|
||||
|
||||
// If the user's crazy, that's no skin off our back
|
||||
if ($user_sample_rate < $min_bitrate) {
|
||||
|
@ -225,7 +225,7 @@ class Stream
|
|||
{
|
||||
$sql = 'SELECT `session`.`agent`, `now_playing`.* FROM `now_playing` ' .
|
||||
'LEFT JOIN `session` ON `session`.`id` = `now_playing`.`id` ';
|
||||
if (Config::get('now_playing_per_user')) {
|
||||
if (AmpConfig::get('now_playing_per_user')) {
|
||||
$sql .= 'GROUP BY `now_playing`.`user` ';
|
||||
$sql .= 'ORDER BY `now_playing`.`insertion` DESC';
|
||||
} else {
|
||||
|
@ -299,17 +299,17 @@ class Stream
|
|||
// If this wasn't ajax included run away
|
||||
if (!defined('AJAX_INCLUDE')) { return false; }
|
||||
|
||||
switch (Config::get('playlist_method')) {
|
||||
switch (AmpConfig::get('playlist_method')) {
|
||||
default:
|
||||
case 'clear':
|
||||
case 'default':
|
||||
return true;
|
||||
break;
|
||||
case 'send':
|
||||
$_SESSION['iframe']['target'] = Config::get('web_path') . '/stream.php?action=basket';
|
||||
$_SESSION['iframe']['target'] = AmpConfig::get('web_path') . '/stream.php?action=basket';
|
||||
break;
|
||||
case 'send_clear':
|
||||
$_SESSION['iframe']['target'] = Config::get('web_path') . '/stream.php?action=basket&playlist_method=clear';
|
||||
$_SESSION['iframe']['target'] = AmpConfig::get('web_path') . '/stream.php?action=basket&playlist_method=clear';
|
||||
break;
|
||||
} // end switch on method
|
||||
|
||||
|
@ -326,20 +326,20 @@ class Stream
|
|||
*/
|
||||
public static function get_base_url()
|
||||
{
|
||||
if (Config::get('require_session')) {
|
||||
if (AmpConfig::get('require_session')) {
|
||||
$session_string = 'ssid=' . self::$session . '&';
|
||||
}
|
||||
|
||||
$web_path = Config::get('web_path');
|
||||
$web_path = AmpConfig::get('web_path');
|
||||
|
||||
if (Config::get('force_http_play') OR !empty(self::$force_http)) {
|
||||
if (AmpConfig::get('force_http_play') OR !empty(self::$force_http)) {
|
||||
$web_path = str_replace("https://", "http://",$web_path);
|
||||
}
|
||||
if (Config::get('http_port') != '80') {
|
||||
if (AmpConfig::get('http_port') != '80') {
|
||||
if (preg_match("/:(\d+)/",$web_path,$matches)) {
|
||||
$web_path = str_replace(':' . $matches['1'],':' . Config::get('http_port'),$web_path);
|
||||
$web_path = str_replace(':' . $matches['1'],':' . AmpConfig::get('http_port'),$web_path);
|
||||
} else {
|
||||
$web_path = str_replace($_SERVER['HTTP_HOST'],$_SERVER['HTTP_HOST'] . ':' . Config::get('http_port'),$web_path);
|
||||
$web_path = str_replace($_SERVER['HTTP_HOST'],$_SERVER['HTTP_HOST'] . ':' . AmpConfig::get('http_port'),$web_path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ class Stream_Playlist
|
|||
public static function check_autoplay_append()
|
||||
{
|
||||
// For now, only iframed web player support media append in the currently played playlist
|
||||
return (Config::get('iframes') && Config::get('play_type') == 'web_player');
|
||||
return (AmpConfig::get('iframes') && AmpConfig::get('play_type') == 'web_player');
|
||||
}
|
||||
|
||||
public function generate_playlist($type, $redirect = false)
|
||||
|
@ -201,7 +201,7 @@ class Stream_Playlist
|
|||
|
||||
if ($redirect) {
|
||||
// Our ID is the SID, so we always want to include it
|
||||
Config::set('require_session', true, true);
|
||||
AmpConfig::set('require_session', true, true);
|
||||
header('Location: ' . Stream::get_base_url() . 'uid=' . scrub_out($this->user) . '&type=playlist&playlist_type=' . scrub_out($type));
|
||||
exit;
|
||||
}
|
||||
|
@ -370,10 +370,10 @@ class Stream_Playlist
|
|||
*/
|
||||
public function create_web_player()
|
||||
{
|
||||
if (Config::get("iframes")) {
|
||||
require Config::get('prefix') . '/templates/create_web_player_embedded.inc.php';
|
||||
if (AmpConfig::get("iframes")) {
|
||||
require AmpConfig::get('prefix') . '/templates/create_web_player_embedded.inc.php';
|
||||
} else {
|
||||
require Config::get('prefix') . '/templates/create_web_player.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/create_web_player.inc.php';
|
||||
}
|
||||
|
||||
} // create_web_player
|
||||
|
@ -384,7 +384,7 @@ class Stream_Playlist
|
|||
*/
|
||||
public function create_localplay()
|
||||
{
|
||||
$localplay = new Localplay(Config::get('localplay_controller'));
|
||||
$localplay = new Localplay(AmpConfig::get('localplay_controller'));
|
||||
$localplay->connect();
|
||||
foreach ($this->urls as $url) {
|
||||
$localplay->add_url($url);
|
||||
|
|
|
@ -85,11 +85,11 @@ class Subsonic_Api
|
|||
public static function setHeader($f)
|
||||
{
|
||||
if (strtolower($f) == "json") {
|
||||
header("Content-type: application/json; charset=" . Config::get('site_charset'));
|
||||
header("Content-type: application/json; charset=" . AmpConfig::get('site_charset'));
|
||||
} else if (strtolower($f) == "jsonp") {
|
||||
header("Content-type: text/javascript; charset=" . Config::get('site_charset'));
|
||||
header("Content-type: text/javascript; charset=" . AmpConfig::get('site_charset'));
|
||||
} else {
|
||||
header("Content-type: text/xml; charset=" . Config::get('site_charset'));
|
||||
header("Content-type: text/xml; charset=" . AmpConfig::get('site_charset'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -410,7 +410,7 @@ class Subsonic_XML_Data
|
|||
foreach ($data as $d) {
|
||||
$track = self::createSong($xplaynow, $d['media'], "entry");
|
||||
$track->addAttribute('username', $d['client']->username);
|
||||
$track->addAttribute('minutesAgo', intval(time() - ($d['expire'] - Config::get('stream_length')) / 1000));
|
||||
$track->addAttribute('minutesAgo', intval(time() - ($d['expire'] - AmpConfig::get('stream_length')) / 1000));
|
||||
$track->addAttribute('playerId', $d['agent']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -569,7 +569,7 @@ class Tag extends database_object
|
|||
$colors = array('#0000FF',
|
||||
'#00FF00', '#FFFF00', '#00FFFF','#FF00FF','#FF0000');
|
||||
$prefs = 'tag company';
|
||||
// $prefs = Config::get('tags_userlist');
|
||||
// $prefs = AmpConfig::get('tags_userlist');
|
||||
|
||||
$ulist = explode(' ', $prefs);
|
||||
$req = '';
|
||||
|
|
|
@ -44,7 +44,7 @@ class UI
|
|||
// Clear any buffered crap
|
||||
ob_end_clean();
|
||||
header("HTTP/1.1 403 $error");
|
||||
require_once Config::get('prefix') . '/templates/show_denied.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_denied.inc.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ class UI
|
|||
public static function ajax_include($template)
|
||||
{
|
||||
ob_start();
|
||||
require Config::get('prefix') . '/templates/' . $template;
|
||||
require AmpConfig::get('prefix') . '/templates/' . $template;
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
|
@ -233,11 +233,11 @@ class UI
|
|||
}
|
||||
|
||||
$filename = 'icon_' . $name . '.png';
|
||||
$path = Config::get('theme_path') . '/images/icons/';
|
||||
if (!file_exists(Config::get('prefix') . $path . $filename)) {
|
||||
$path = AmpConfig::get('theme_path') . '/images/icons/';
|
||||
if (!file_exists(AmpConfig::get('prefix') . $path . $filename)) {
|
||||
$path = '/images/';
|
||||
}
|
||||
$url = Config::get('web_path') . $path . $filename;
|
||||
$url = AmpConfig::get('web_path') . $path . $filename;
|
||||
self::$_icon_cache[$name] = $url;
|
||||
|
||||
return $url;
|
||||
|
@ -251,7 +251,7 @@ class UI
|
|||
*/
|
||||
public static function show_header()
|
||||
{
|
||||
require_once Config::get('prefix') . '/templates/header.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/header.inc.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -261,7 +261,7 @@ class UI
|
|||
*/
|
||||
public static function show_mainframes()
|
||||
{
|
||||
require_once Config::get('prefix') . '/templates/mainframes.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/mainframes.inc.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -271,7 +271,7 @@ class UI
|
|||
*/
|
||||
public static function show_footer()
|
||||
{
|
||||
require_once Config::get('prefix') . '/templates/footer.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/footer.inc.php';
|
||||
if (isset($_REQUEST['profiling'])) {
|
||||
Dba::show_profile();
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ class UI
|
|||
*/
|
||||
public static function show_box_top($title = '', $class = '')
|
||||
{
|
||||
require Config::get('prefix') . '/templates/show_box_top.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_box_top.inc.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -294,7 +294,7 @@ class UI
|
|||
*/
|
||||
public static function show_box_bottom()
|
||||
{
|
||||
require Config::get('prefix') . '/templates/show_box_bottom.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_box_bottom.inc.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -312,7 +312,7 @@ class UI
|
|||
}
|
||||
|
||||
if (self::check_iconv()) {
|
||||
$charset = Config::get('site_charset');
|
||||
$charset = AmpConfig::get('site_charset');
|
||||
if (iconv_strlen($text, $charset) > $max) {
|
||||
$text = iconv_substr($text, 0, $max - 3, $charset);
|
||||
$text .= iconv('ISO-8859-1', $charset, '...');
|
||||
|
|
|
@ -366,7 +366,7 @@ class Update
|
|||
if (!defined('CLI')) { echo '<p align="center">'; }
|
||||
echo T_('No updates needed.');
|
||||
if (!defined('CLI')) {
|
||||
echo '[<a href="', Config::get('web_path'), '">Return</a>]</p>';
|
||||
echo '[<a href="', AmpConfig::get('web_path'), '">Return</a>]</p>';
|
||||
} else {
|
||||
echo "\n";
|
||||
}
|
||||
|
|
|
@ -264,9 +264,9 @@ class User extends database_object
|
|||
*/
|
||||
public function get_favorites($type)
|
||||
{
|
||||
$web_path = Config::get('web_path');
|
||||
$web_path = AmpConfig::get('web_path');
|
||||
|
||||
$results = Stats::get_user(Config::get('popular_threshold'),$type,$this->id,1);
|
||||
$results = Stats::get_user(AmpConfig::get('popular_threshold'),$type,$this->id,1);
|
||||
|
||||
$items = array();
|
||||
|
||||
|
@ -404,7 +404,7 @@ class User extends database_object
|
|||
*/
|
||||
public function has_access($needed_level)
|
||||
{
|
||||
if (!Config::get('use_auth') || Config::get('demo_mode')) { return true; }
|
||||
if (!AmpConfig::get('use_auth') || AmpConfig::get('demo_mode')) { return true; }
|
||||
|
||||
if ($this->access >= $needed_level) { return true; }
|
||||
|
||||
|
@ -635,7 +635,7 @@ class User extends database_object
|
|||
|
||||
/* Clean up old records... sometimes */
|
||||
if (rand(1,100) > 60) {
|
||||
$date = time() - (86400*Config::get('user_ip_cardinality'));
|
||||
$date = time() - (86400*AmpConfig::get('user_ip_cardinality'));
|
||||
$sql = "DELETE FROM `ip_history` WHERE `date` < $date";
|
||||
$db_results = Dba::write($sql);
|
||||
}
|
||||
|
@ -710,7 +710,7 @@ class User extends database_object
|
|||
if (!$this->create_date) { $this->f_create_date = T_('Unknown'); } else { $this->f_create_date = date("m\/d\/Y - H:i",$this->create_date); }
|
||||
|
||||
// Base link
|
||||
$this->f_link = '<a href="' . Config::get('web_path') . '/stats.php?action=show_user&user_id=' . $this->id . '">' . $this->fullname . '</a>';
|
||||
$this->f_link = '<a href="' . AmpConfig::get('web_path') . '/stats.php?action=show_user&user_id=' . $this->id . '">' . $this->fullname . '</a>';
|
||||
|
||||
/* Calculate their total Bandwidth Usage */
|
||||
$sql = "SELECT `song`.`size` FROM `song` LEFT JOIN `object_count` ON `song`.`id`=`object_count`.`object_id` " .
|
||||
|
@ -1038,12 +1038,12 @@ class User extends database_object
|
|||
/**
|
||||
* get_ip_history
|
||||
* This returns the ip_history from the
|
||||
* last Config::get('user_ip_cardinality') days
|
||||
* last AmpConfig::get('user_ip_cardinality') days
|
||||
*/
|
||||
public function get_ip_history($count='',$distinct='')
|
||||
{
|
||||
$username = Dba::escape($this->id);
|
||||
$count = $count ? intval($count) : intval(Config::get('user_ip_cardinality'));
|
||||
$count = $count ? intval($count) : intval(AmpConfig::get('user_ip_cardinality'));
|
||||
|
||||
// Make sure it's something
|
||||
if ($count < 1) { $count = '1'; }
|
||||
|
@ -1087,7 +1087,7 @@ class User extends database_object
|
|||
public function is_xmlrpc()
|
||||
{
|
||||
/* If we aren't using XML-RPC return true */
|
||||
if (!Config::get('xml_rpc')) {
|
||||
if (!AmpConfig::get('xml_rpc')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ class Userflag extends database_object
|
|||
public static function get_latest($type, $user_id=null, $count='', $offset='')
|
||||
{
|
||||
if (!$count) {
|
||||
$count = Config::get('popular_threshold');
|
||||
$count = AmpConfig::get('popular_threshold');
|
||||
}
|
||||
$count = intval($count);
|
||||
if (!$offset) {
|
||||
|
@ -211,10 +211,10 @@ class Userflag extends database_object
|
|||
public static function show($object_id, $type)
|
||||
{
|
||||
// If user flags aren't enabled don't do anything
|
||||
if (!Config::get('userflags')) { return false; }
|
||||
if (!AmpConfig::get('userflags')) { return false; }
|
||||
|
||||
$userflag = new Userflag($object_id, $type);
|
||||
require Config::get('prefix') . '/templates/show_object_userflag.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_object_userflag.inc.php';
|
||||
|
||||
} // show
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class vainfo
|
|||
{
|
||||
$this->islocal = $islocal;
|
||||
$this->filename = $file;
|
||||
$this->encoding = $encoding ?: Config::get('site_charset');
|
||||
$this->encoding = $encoding ?: AmpConfig::get('site_charset');
|
||||
|
||||
/* These are needed for the filename mojo */
|
||||
$this->_file_pattern = $file_pattern;
|
||||
|
@ -93,8 +93,8 @@ class vainfo
|
|||
return false;
|
||||
}
|
||||
|
||||
if (Config::get('mb_detect_order')) {
|
||||
$mb_order = Config::get('mb_detect_order');
|
||||
if (AmpConfig::get('mb_detect_order')) {
|
||||
$mb_order = AmpConfig::get('mb_detect_order');
|
||||
} elseif (function_exists('mb_detect_order')) {
|
||||
$mb_order = implode(", ", mb_detect_order());
|
||||
} else {
|
||||
|
@ -115,7 +115,7 @@ class vainfo
|
|||
$this->encoding_id3v1 = self::_detect_encoding($tags, $mb_order);
|
||||
}
|
||||
|
||||
if (Config::get('getid3_detect_id3v2_encoding')) {
|
||||
if (AmpConfig::get('getid3_detect_id3v2_encoding')) {
|
||||
// The user has told us to be moronic, so let's do that thing
|
||||
foreach ($test_tags as $tag) {
|
||||
if ($value = $this->_raw['id3v2']['comments'][$tag]) {
|
||||
|
@ -196,7 +196,7 @@ class vainfo
|
|||
/* Figure out what type of file we are dealing with */
|
||||
$this->type = $this->_get_type();
|
||||
|
||||
$enabled_sources = (array) Config::get('metadata_order');
|
||||
$enabled_sources = (array) AmpConfig::get('metadata_order');
|
||||
|
||||
if (in_array('filename', $enabled_sources)) {
|
||||
$this->tags['filename'] = $this->_parse_filename($this->filename);
|
||||
|
@ -220,7 +220,7 @@ class vainfo
|
|||
*/
|
||||
public static function get_tag_type($results, $config_key = 'metadata_order')
|
||||
{
|
||||
$order = (array) Config::get($config_key);
|
||||
$order = (array) AmpConfig::get($config_key);
|
||||
|
||||
// Iterate through the defined key order adding them to an ordered array.
|
||||
foreach ($order as $key) {
|
||||
|
@ -436,7 +436,7 @@ class vainfo
|
|||
*/
|
||||
private function _get_plugin_tags()
|
||||
{
|
||||
$tag_order = Config::get('metadata_order');
|
||||
$tag_order = AmpConfig::get('metadata_order');
|
||||
if (!is_array($tag_order)) {
|
||||
$tag_order = array($tag_order);
|
||||
}
|
||||
|
@ -805,7 +805,7 @@ class vainfo
|
|||
public function set_broken()
|
||||
{
|
||||
/* Pull In the config option */
|
||||
$order = Config::get('tag_order');
|
||||
$order = AmpConfig::get('tag_order');
|
||||
|
||||
if (!is_array($order)) {
|
||||
$order = array($order);
|
||||
|
|
|
@ -32,7 +32,7 @@ class WebPlayer
|
|||
}
|
||||
}
|
||||
|
||||
return (count($playlist->urls) == 1 && count($radios) > 0 && Config::get('webplayer_flash'));
|
||||
return (count($playlist->urls) == 1 && count($radios) > 0 && AmpConfig::get('webplayer_flash'));
|
||||
}
|
||||
|
||||
public static function browser_info($agent=null)
|
||||
|
@ -93,7 +93,7 @@ class WebPlayer
|
|||
$js['album_id'] = $song->album;
|
||||
$js['song_id'] = $song->id;
|
||||
|
||||
$transcode_cfg = Config::get('transcode');
|
||||
$transcode_cfg = AmpConfig::get('transcode');
|
||||
// Check transcode is required
|
||||
if ($transcode_cfg == 'always' || $type != $ftype) {
|
||||
$valid_types = Song::get_stream_types_for_type($ftype);
|
||||
|
|
|
@ -322,7 +322,7 @@ class XML_Data
|
|||
$rating = new Rating($album_id,'album');
|
||||
|
||||
// Build the Art URL, include session
|
||||
$art_url = Config::get('web_path') . '/image.php?id=' . $album->id . '&auth=' . scrub_out($_REQUEST['auth']);
|
||||
$art_url = AmpConfig::get('web_path') . '/image.php?id=' . $album->id . '&auth=' . scrub_out($_REQUEST['auth']);
|
||||
|
||||
$string .= "<album id=\"$album->id\">\n" .
|
||||
"\t<name><![CDATA[$album->name]]></name>\n";
|
||||
|
@ -559,7 +559,7 @@ class XML_Data
|
|||
*/
|
||||
public static function rss_feed($data,$title,$description,$date)
|
||||
{
|
||||
$string = "\t<title>$title</title>\n\t<link>" . Config::get('web_path') . "</link>\n\t" .
|
||||
$string = "\t<title>$title</title>\n\t<link>" . AmpConfig::get('web_path') . "</link>\n\t" .
|
||||
"<pubDate>" . date("r",$date) . "</pubDate>\n";
|
||||
|
||||
// Pass it to the keyed array xml function
|
||||
|
@ -589,14 +589,14 @@ class XML_Data
|
|||
$header = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" .
|
||||
"<playlist version = \"1\" xmlns=\"http://xspf.org/ns/0/\">\n " .
|
||||
"<title>Ampache XSPF Playlist</title>\n" .
|
||||
"<creator>" . scrub_out(Config::get('site_title')) . "</creator>\n" .
|
||||
"<annotation>" . scrub_out(Config::get('site_title')) . "</annotation>\n" .
|
||||
"<info>". Config::get('web_path') ."</info>\n" .
|
||||
"<creator>" . scrub_out(AmpConfig::get('site_title')) . "</creator>\n" .
|
||||
"<annotation>" . scrub_out(AmpConfig::get('site_title')) . "</annotation>\n" .
|
||||
"<info>". AmpConfig::get('web_path') ."</info>\n" .
|
||||
"<trackList>\n";
|
||||
break;
|
||||
case 'itunes':
|
||||
$header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" .
|
||||
"<!-- XML Generated by Ampache v." . Config::get('version') . " -->\n";
|
||||
"<!-- XML Generated by Ampache v." . AmpConfig::get('version') . " -->\n";
|
||||
"<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"\n" .
|
||||
"\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" .
|
||||
"<plist version=\"1.0\">\n" .
|
||||
|
@ -610,12 +610,12 @@ class XML_Data
|
|||
" <dict>\n";
|
||||
break;
|
||||
case 'rss':
|
||||
$header = "<?xml version=\"1.0\" encoding=\"" . Config::get('site_charset') . "\" ?>\n " .
|
||||
"<!-- RSS Generated by Ampache v." . Config::get('version') . " on " . date("r",time()) . "-->\n" .
|
||||
$header = "<?xml version=\"1.0\" encoding=\"" . AmpConfig::get('site_charset') . "\" ?>\n " .
|
||||
"<!-- RSS Generated by Ampache v." . AmpConfig::get('version') . " on " . date("r",time()) . "-->\n" .
|
||||
"<rss version=\"2.0\">\n<channel>\n";
|
||||
break;
|
||||
default:
|
||||
$header = "<?xml version=\"1.0\" encoding=\"" . Config::get('site_charset') . "\" ?>\n<root>\n";
|
||||
$header = "<?xml version=\"1.0\" encoding=\"" . AmpConfig::get('site_charset') . "\" ?>\n<root>\n";
|
||||
break;
|
||||
} // end switch
|
||||
|
||||
|
|
|
@ -208,8 +208,8 @@ function check_override_exec_time()
|
|||
function check_config_writable()
|
||||
{
|
||||
// file eixsts && is writable, or dir is writable
|
||||
return ((file_exists(Config::get('prefix') . '/config/ampache.cfg.php') && is_writable(Config::get('prefix') . '/config/ampache.cfg.php'))
|
||||
|| (!file_exists(Config::get('prefix') . '/config/ampache.cfg.php') && is_writeable(Config::get('prefix') . '/config/')));
|
||||
return ((file_exists(AmpConfig::get('prefix') . '/config/ampache.cfg.php') && is_writable(AmpConfig::get('prefix') . '/config/ampache.cfg.php'))
|
||||
|| (!file_exists(AmpConfig::get('prefix') . '/config/ampache.cfg.php') && is_writeable(AmpConfig::get('prefix') . '/config/')));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -74,7 +74,7 @@ function generate_password($length)
|
|||
function scrub_in($input)
|
||||
{
|
||||
if (!is_array($input)) {
|
||||
return stripslashes(htmlspecialchars(strip_tags($input), ENT_QUOTES, Config::get('site_charset')));
|
||||
return stripslashes(htmlspecialchars(strip_tags($input), ENT_QUOTES, AmpConfig::get('site_charset')));
|
||||
} else {
|
||||
$results = array();
|
||||
foreach ($input as $item) {
|
||||
|
@ -92,7 +92,7 @@ function scrub_in($input)
|
|||
*/
|
||||
function scrub_out($string)
|
||||
{
|
||||
return htmlentities($string, ENT_QUOTES, Config::get('site_charset'));
|
||||
return htmlentities($string, ENT_QUOTES, AmpConfig::get('site_charset'));
|
||||
|
||||
} // scrub_out
|
||||
|
||||
|
@ -102,7 +102,7 @@ function scrub_out($string)
|
|||
*/
|
||||
function unhtmlentities($string)
|
||||
{
|
||||
return html_entity_decode($string, ENT_QUOTES, Config::get('site_charset'));
|
||||
return html_entity_decode($string, ENT_QUOTES, AmpConfig::get('site_charset'));
|
||||
|
||||
} //unhtmlentities
|
||||
|
||||
|
@ -155,7 +155,7 @@ function invert_bool($value)
|
|||
function get_languages()
|
||||
{
|
||||
/* Open the locale directory */
|
||||
$handle = @opendir(Config::get('prefix') . '/locale');
|
||||
$handle = @opendir(AmpConfig::get('prefix') . '/locale');
|
||||
|
||||
if (!is_resource($handle)) {
|
||||
debug_event('language','Error unable to open locale directory','1');
|
||||
|
@ -168,7 +168,7 @@ function get_languages()
|
|||
|
||||
while ($file = readdir($handle)) {
|
||||
|
||||
$full_file = Config::get('prefix') . '/locale/' . $file;
|
||||
$full_file = AmpConfig::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') {
|
||||
|
@ -275,7 +275,7 @@ function translate_pattern_code($code)
|
|||
function generate_config($current)
|
||||
{
|
||||
// Start building the new config file
|
||||
$distfile = Config::get('prefix') . '/config/ampache.cfg.php.dist';
|
||||
$distfile = AmpConfig::get('prefix') . '/config/ampache.cfg.php.dist';
|
||||
$handle = fopen($distfile,'r');
|
||||
$dist = fread($handle,filesize($distfile));
|
||||
fclose($handle);
|
||||
|
|
|
@ -28,13 +28,13 @@
|
|||
*/
|
||||
function load_gettext()
|
||||
{
|
||||
$lang = Config::get('lang');
|
||||
$charset = Config::get('site_charset') ?: 'UTF-8';
|
||||
$lang = AmpConfig::get('lang');
|
||||
$charset = AmpConfig::get('site_charset') ?: 'UTF-8';
|
||||
$locale = $lang . '.' . $charset;
|
||||
//debug_event('i18n', 'Setting locale to ' . $locale, 5);
|
||||
T_setlocale(LC_MESSAGES, $locale);
|
||||
/* Bind the Text Domain */
|
||||
T_bindtextdomain('messages', Config::get('prefix') . "/locale/");
|
||||
T_bindtextdomain('messages', AmpConfig::get('prefix') . "/locale/");
|
||||
T_bind_textdomain_codeset('messages', $charset);
|
||||
T_textdomain('messages');
|
||||
//debug_event('i18n', 'gettext is ' . (locale_emulation() ? 'emulated' : 'native'), 5);
|
||||
|
|
|
@ -34,12 +34,12 @@ $ampache_path = dirname(__FILE__);
|
|||
$prefix = realpath($ampache_path . "/../");
|
||||
$configfile = $prefix . '/config/ampache.cfg.php';
|
||||
require_once $prefix . '/lib/general.lib.php';
|
||||
require_once $prefix . '/lib/class/config.class.php';
|
||||
require_once $prefix . '/lib/class/ampconfig.class.php';
|
||||
require_once $prefix . '/lib/class/core.class.php';
|
||||
require_once $prefix . '/modules/php-gettext/gettext.inc';
|
||||
|
||||
// Define some base level config options
|
||||
Config::set('prefix', $prefix);
|
||||
AmpConfig::set('prefix', $prefix);
|
||||
|
||||
// Register the autoloader
|
||||
spl_autoload_register(array('Core', 'autoload'), true, true);
|
||||
|
|
34
lib/init.php
34
lib/init.php
|
@ -100,10 +100,10 @@ require_once $prefix . '/modules/ampacheapi/AmpacheApi.lib.php';
|
|||
/* Temp Fixes */
|
||||
$results = Preference::fix_preferences($results);
|
||||
|
||||
Config::set_by_array($results, true);
|
||||
AmpConfig::set_by_array($results, true);
|
||||
|
||||
// Modules (These are conditionally included depending upon config values)
|
||||
if (Config::get('ratings')) {
|
||||
if (AmpConfig::get('ratings')) {
|
||||
require_once $prefix . '/lib/rating.lib.php';
|
||||
}
|
||||
|
||||
|
@ -131,10 +131,10 @@ set_memory_limit($results['memory_limit']);
|
|||
/**** END Set PHP Vars ****/
|
||||
|
||||
// If we want a session
|
||||
if (!defined('NO_SESSION') && Config::get('use_auth')) {
|
||||
if (!defined('NO_SESSION') && AmpConfig::get('use_auth')) {
|
||||
/* Verify their session */
|
||||
if (!Session::exists('interface', $_COOKIE[Config::get('session_name')])) {
|
||||
Auth::logout($_COOKIE[Config::get('session_name')]);
|
||||
if (!Session::exists('interface', $_COOKIE[AmpConfig::get('session_name')])) {
|
||||
Auth::logout($_COOKIE[AmpConfig::get('session_name')]);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -145,21 +145,21 @@ if (!defined('NO_SESSION') && Config::get('use_auth')) {
|
|||
$GLOBALS['user'] = User::get_from_username($_SESSION['userdata']['username']);
|
||||
|
||||
/* If the user ID doesn't exist deny them */
|
||||
if (!$GLOBALS['user']->id && !Config::get('demo_mode')) {
|
||||
if (!$GLOBALS['user']->id && !AmpConfig::get('demo_mode')) {
|
||||
Auth::logout(session_id());
|
||||
exit;
|
||||
}
|
||||
|
||||
/* Load preferences and theme */
|
||||
$GLOBALS['user']->update_last_seen();
|
||||
} elseif (!Config::get('use_auth')) {
|
||||
} elseif (!AmpConfig::get('use_auth')) {
|
||||
$auth['success'] = 1;
|
||||
$auth['username'] = '-1';
|
||||
$auth['fullname'] = "Ampache User";
|
||||
$auth['id'] = -1;
|
||||
$auth['offset_limit'] = 50;
|
||||
$auth['access'] = Config::get('default_auth_level') ? User::access_name_to_level(Config::get('default_auth_level')) : '100';
|
||||
if (!Session::exists('interface', $_COOKIE[Config::get('session_name')])) {
|
||||
$auth['access'] = AmpConfig::get('default_auth_level') ? User::access_name_to_level(AmpConfig::get('default_auth_level')) : '100';
|
||||
if (!Session::exists('interface', $_COOKIE[AmpConfig::get('session_name')])) {
|
||||
Session::create_cookie();
|
||||
Session::create($auth);
|
||||
Session::check();
|
||||
|
@ -178,7 +178,7 @@ if (!defined('NO_SESSION') && Config::get('use_auth')) {
|
|||
$GLOBALS['user']->fullname = $auth['fullname'];
|
||||
$GLOBALS['user']->access = $auth['access'];
|
||||
}
|
||||
if (!$GLOBALS['user']->id AND !Config::get('demo_mode')) {
|
||||
if (!$GLOBALS['user']->id AND !AmpConfig::get('demo_mode')) {
|
||||
Auth::logout(session_id()); exit;
|
||||
}
|
||||
$GLOBALS['user']->update_last_seen();
|
||||
|
@ -187,7 +187,7 @@ if (!defined('NO_SESSION') && Config::get('use_auth')) {
|
|||
// If Auth, but no session is set
|
||||
else {
|
||||
if (isset($_REQUEST['sid'])) {
|
||||
session_name(Config::get('session_name'));
|
||||
session_name(AmpConfig::get('session_name'));
|
||||
session_id(scrub_in($_REQUEST['sid']));
|
||||
session_start();
|
||||
$GLOBALS['user'] = new User($_SESSION['userdata']['uid']);
|
||||
|
@ -207,14 +207,14 @@ if (session_id()) {
|
|||
}
|
||||
|
||||
/* Add in some variables for ajax done here because we need the user */
|
||||
Config::set('ajax_url', Config::get('web_path') . '/server/ajax.server.php', true);
|
||||
Config::set('ajax_server', Config::get('web_path') . '/server', true);
|
||||
AmpConfig::set('ajax_url', AmpConfig::get('web_path') . '/server/ajax.server.php', true);
|
||||
AmpConfig::set('ajax_server', AmpConfig::get('web_path') . '/server', true);
|
||||
|
||||
// Load gettext mojo
|
||||
load_gettext();
|
||||
|
||||
/* Set CHARSET */
|
||||
header ("Content-Type: text/html; charset=" . Config::get('site_charset'));
|
||||
header ("Content-Type: text/html; charset=" . AmpConfig::get('site_charset'));
|
||||
|
||||
/* Clean up a bit */
|
||||
unset($array);
|
||||
|
@ -223,14 +223,14 @@ unset($results);
|
|||
/* Check to see if we need to perform an update */
|
||||
if (!defined('OUTDATED_DATABASE_OK')) {
|
||||
if (Update::need_update()) {
|
||||
header("Location: " . Config::get('web_path') . "/update.php");
|
||||
header("Location: " . AmpConfig::get('web_path') . "/update.php");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
// For the XMLRPC stuff
|
||||
$GLOBALS['xmlrpc_internalencoding'] = Config::get('site_charset');
|
||||
$GLOBALS['xmlrpc_internalencoding'] = AmpConfig::get('site_charset');
|
||||
|
||||
// If debug is on GIMMIE DA ERRORS
|
||||
if (Config::get('debug')) {
|
||||
if (AmpConfig::get('debug')) {
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ function install_check_status($configfile)
|
|||
if they don't then they're cool
|
||||
*/
|
||||
$results = parse_ini_file($configfile);
|
||||
Config::set_by_array($results, true);
|
||||
AmpConfig::set_by_array($results, true);
|
||||
|
||||
if (!Dba::check_database()) {
|
||||
Error::add('general', T_('Unable to connect to database, check your ampache config'));
|
||||
|
@ -111,7 +111,7 @@ function install_check_status($configfile)
|
|||
*/
|
||||
function install_insert_db($db_user = null, $db_pass = null, $overwrite = false, $use_existing_db = false)
|
||||
{
|
||||
$database = Config::get('database_name');
|
||||
$database = AmpConfig::get('database_name');
|
||||
// Make sure that the database name is valid
|
||||
$is_valid = preg_match('/([^\d\w\_\-])/', $database, $matches);
|
||||
|
||||
|
@ -150,7 +150,7 @@ function install_insert_db($db_user = null, $db_pass = null, $overwrite = false,
|
|||
|
||||
// Check to see if we should create a user here
|
||||
if (strlen($db_user) && strlen($db_pass)) {
|
||||
$db_host = Config::get('database_hostname');
|
||||
$db_host = AmpConfig::get('database_hostname');
|
||||
$sql = 'GRANT ALL PRIVILEGES ON `' . Dba::escape($database) . '`.* TO ' .
|
||||
"'" . Dba::escape($db_user) . "'";
|
||||
if ($db_host == 'localhost' || strpos($db_host, '/') === 0) {
|
||||
|
@ -163,7 +163,7 @@ function install_insert_db($db_user = null, $db_pass = null, $overwrite = false,
|
|||
}
|
||||
} // end if we are creating a user
|
||||
|
||||
$sql_file = Config::get('prefix') . '/sql/ampache.sql';
|
||||
$sql_file = AmpConfig::get('prefix') . '/sql/ampache.sql';
|
||||
|
||||
$query = fread(fopen($sql_file, 'r'), filesize($sql_file));
|
||||
$pieces = split_sql($query);
|
||||
|
@ -177,15 +177,15 @@ function install_insert_db($db_user = null, $db_pass = null, $overwrite = false,
|
|||
}
|
||||
|
||||
$sql = 'ALTER DATABASE `' . $database . '` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci';
|
||||
$db_results = Dba::write($sql, array(Config::get('database_name')));
|
||||
$db_results = Dba::write($sql, array(AmpConfig::get('database_name')));
|
||||
|
||||
// If they've picked something other than English update default preferences
|
||||
if (Config::get('lang') != 'en_US') {
|
||||
if (AmpConfig::get('lang') != 'en_US') {
|
||||
// FIXME: 31? I hate magic.
|
||||
$sql = 'UPDATE `preference` SET `value`= ? WHERE `id` = 31';
|
||||
$db_results = Dba::write($sql, array(Config::get('lang')));
|
||||
$db_results = Dba::write($sql, array(AmpConfig::get('lang')));
|
||||
$sql = 'UPDATE `user_preference` SET `value` = ? WHERE `preference` = 31';
|
||||
$db_results = Dba::write($sql, array(Config::get('lang')));
|
||||
$db_results = Dba::write($sql, array(AmpConfig::get('lang')));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -198,7 +198,7 @@ function install_insert_db($db_user = null, $db_pass = null, $overwrite = false,
|
|||
*/
|
||||
function install_create_config($download = false)
|
||||
{
|
||||
$config_file = Config::get('prefix') . '/config/ampache.cfg.php';
|
||||
$config_file = AmpConfig::get('prefix') . '/config/ampache.cfg.php';
|
||||
|
||||
/* Attempt to make DB connection */
|
||||
$dbh = Dba::dbh();
|
||||
|
@ -209,7 +209,7 @@ function install_create_config($download = false)
|
|||
return false;
|
||||
}
|
||||
|
||||
$final = generate_config(Config::get_all());
|
||||
$final = generate_config(AmpConfig::get_all());
|
||||
|
||||
// Make sure the directory is writable OR the empty config file is
|
||||
if (!$download) {
|
||||
|
|
|
@ -36,7 +36,7 @@ function log_event($username, $event_name, $event_description, $log_name)
|
|||
$log_name = $log_name ? $log_name : 'ampache';
|
||||
$username = $username ? $username : 'ampache';
|
||||
|
||||
$log_filename = Config::get('log_path') . "/$log_name.$log_day.log";
|
||||
$log_filename = AmpConfig::get('log_path') . "/$log_name.$log_day.log";
|
||||
$log_line = "$log_time [$username] ($event_name) -> $event_description \n";
|
||||
|
||||
// Do the deed
|
||||
|
@ -131,7 +131,7 @@ function ampache_error_handler($errno, $errstr, $errfile, $errline)
|
|||
*/
|
||||
function debug_event($type, $message, $level, $file = '', $username = '')
|
||||
{
|
||||
if (!Config::get('debug') || $level > Config::get('debug_level')) {
|
||||
if (!AmpConfig::get('debug') || $level > AmpConfig::get('debug_level')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -180,13 +180,13 @@ function create_preference_input($name,$value)
|
|||
if ($value == 'localplay') { $is_local = 'selected="selected"'; } elseif ($value == 'democratic') { $is_vote = 'selected="selected"'; } elseif ($value == 'web_player') { $is_web_player = 'selected="selected"'; } else { $is_stream = "selected=\"selected\""; }
|
||||
echo "<select name=\"$name\">\n";
|
||||
echo "\t<option value=\"\">" . T_('None') . "</option>\n";
|
||||
if (Config::get('allow_stream_playback')) {
|
||||
if (AmpConfig::get('allow_stream_playback')) {
|
||||
echo "\t<option value=\"stream\" $is_stream>" . T_('Stream') . "</option>\n";
|
||||
}
|
||||
if (Config::get('allow_democratic_playback')) {
|
||||
if (AmpConfig::get('allow_democratic_playback')) {
|
||||
echo "\t<option value=\"democratic\" $is_vote>" . T_('Democratic') . "</option>\n";
|
||||
}
|
||||
if (Config::get('allow_localplay_playback')) {
|
||||
if (AmpConfig::get('allow_localplay_playback')) {
|
||||
echo "\t<option value=\"localplay\" $is_local>" . T_('Localplay') . "</option>\n";
|
||||
}
|
||||
echo "\t<option value=\"web_player\" $is_web_player>" . _('Web Player') . "</option>\n";
|
||||
|
|
|
@ -28,7 +28,7 @@ function show_rating($object_id,$type)
|
|||
{
|
||||
$rating = new Rating($object_id,$type);
|
||||
|
||||
require Config::get('prefix') . '/templates/show_object_rating.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_object_rating.inc.php';
|
||||
|
||||
} // show_rating
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
function get_themes()
|
||||
{
|
||||
/* Open the themes dir and start reading it */
|
||||
$handle = opendir(Config::get('prefix') . '/themes');
|
||||
$handle = opendir(AmpConfig::get('prefix') . '/themes');
|
||||
|
||||
if (!is_resource($handle)) {
|
||||
debug_event('theme', 'Failed to open /themes directory', 2);
|
||||
|
@ -41,7 +41,7 @@ function get_themes()
|
|||
|
||||
while (($f = readdir($handle)) !== false) {
|
||||
debug_event('theme', "Checking $f", 5);
|
||||
$file = Config::get('prefix') . '/themes/' . $f;
|
||||
$file = AmpConfig::get('prefix') . '/themes/' . $f;
|
||||
if (file_exists($file . $theme_cfg)) {
|
||||
debug_event('theme', "Loading $theme_cfg from $f", 5);
|
||||
$r = parse_ini_file($file . $theme_cfg);
|
||||
|
@ -68,7 +68,7 @@ function get_theme($name)
|
|||
{
|
||||
if (strlen($name) < 1) { return false; }
|
||||
|
||||
$config_file = Config::get('prefix') . "/themes/" . $name . "/theme.cfg.php";
|
||||
$config_file = AmpConfig::get('prefix') . "/themes/" . $name . "/theme.cfg.php";
|
||||
$results = parse_ini_file($config_file);
|
||||
$results['path'] = $name;
|
||||
return $results;
|
||||
|
@ -81,7 +81,7 @@ function get_theme($name)
|
|||
*/
|
||||
function get_theme_author($theme_name)
|
||||
{
|
||||
$theme_path = Config::get('prefix') . '/themes/' . Config::get('theme_name') . '/theme.cfg.php';
|
||||
$theme_path = AmpConfig::get('prefix') . '/themes/' . AmpConfig::get('theme_name') . '/theme.cfg.php';
|
||||
$results = read_config($theme_path);
|
||||
|
||||
return $results['author'];
|
||||
|
@ -94,7 +94,7 @@ function get_theme_author($theme_name)
|
|||
*/
|
||||
function theme_exists($theme_name)
|
||||
{
|
||||
$theme_path = Config::get('prefix') . '/themes/' . $theme_name . '/theme.cfg.php';
|
||||
$theme_path = AmpConfig::get('prefix') . '/themes/' . $theme_name . '/theme.cfg.php';
|
||||
|
||||
if (!file_exists($theme_path)) {
|
||||
return false;
|
||||
|
|
|
@ -37,13 +37,13 @@
|
|||
*/
|
||||
function show_confirmation($title,$text,$next_url,$cancel=0,$form_name='confirmation')
|
||||
{
|
||||
if (substr_count($next_url,Config::get('web_path'))) {
|
||||
if (substr_count($next_url,AmpConfig::get('web_path'))) {
|
||||
$path = $next_url;
|
||||
} else {
|
||||
$path = Config::get('web_path') . "/$next_url";
|
||||
$path = AmpConfig::get('web_path') . "/$next_url";
|
||||
}
|
||||
|
||||
require Config::get('prefix') . '/templates/show_confirmation.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_confirmation.inc.php';
|
||||
} // show_confirmation
|
||||
|
||||
/**
|
||||
|
@ -93,7 +93,7 @@ function get_location()
|
|||
}
|
||||
|
||||
/* Sanatize the $_SERVER['PHP_SELF'] variable */
|
||||
$source = str_replace(Config::get('raw_web_path'), "", $source);
|
||||
$source = str_replace(AmpConfig::get('raw_web_path'), "", $source);
|
||||
$location['page'] = preg_replace("/^\/(.+\.php)\/?.*/","$1",$source);
|
||||
|
||||
switch ($location['page']) {
|
||||
|
@ -176,7 +176,7 @@ function get_location()
|
|||
*/
|
||||
function show_preference_box($preferences)
|
||||
{
|
||||
require Config::get('prefix') . '/templates/show_preference_box.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_preference_box.inc.php';
|
||||
|
||||
} // show_preference_box
|
||||
|
||||
|
@ -453,12 +453,12 @@ function xml_get_header($type)
|
|||
break;
|
||||
case 'xspf':
|
||||
$header = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" .
|
||||
"<!-- XML Generated by Ampache v." . Config::get('version') . " -->";
|
||||
"<!-- XML Generated by Ampache v." . AmpConfig::get('version') . " -->";
|
||||
"<playlist version = \"1\" xmlns=\"http://xspf.org/ns/0/\">\n ".
|
||||
"<title>Ampache XSPF Playlist</title>\n" .
|
||||
"<creator>" . Config::get('site_title') . "</creator>\n" .
|
||||
"<annotation>" . Config::get('site_title') . "</annotation>\n" .
|
||||
"<info>". Config::get('web_path') ."</info>\n" .
|
||||
"<creator>" . AmpConfig::get('site_title') . "</creator>\n" .
|
||||
"<annotation>" . AmpConfig::get('site_title') . "</annotation>\n" .
|
||||
"<info>". AmpConfig::get('web_path') ."</info>\n" .
|
||||
"<trackList>\n\n\n\n";
|
||||
return $header;
|
||||
break;
|
||||
|
@ -532,8 +532,8 @@ function show_now_playing()
|
|||
Session::gc(null);
|
||||
Stream::gc_now_playing();
|
||||
|
||||
$web_path = Config::get('web_path');
|
||||
$web_path = AmpConfig::get('web_path');
|
||||
$results = Stream::get_now_playing();
|
||||
require_once Config::get('prefix') . '/templates/show_now_playing.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_now_playing.inc.php';
|
||||
|
||||
} // show_now_playing
|
||||
|
|
|
@ -1243,7 +1243,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr ""
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1226,7 +1226,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr ""
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1263,7 +1263,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Error creant la llista"
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1262,7 +1262,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Chyba při vytváření seznamu skladeb."
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1273,7 +1273,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Wiedergabeliste erstellt."
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1270,7 +1270,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Η playlist δημιουργήθηκε"
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1262,7 +1262,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Playlist creation error."
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1287,7 +1287,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Lista creada"
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1318,7 +1318,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "خطای ایجاد لیست پخش"
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1287,7 +1287,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Liste de lecture créée"
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1291,7 +1291,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Playlist creata."
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1242,7 +1242,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "プレイリスト作成エラーです。"
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1265,7 +1265,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Spilleliste opprettet"
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1264,7 +1264,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Fout bij het aanmaak van afspeellijst"
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1267,7 +1267,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Błąd tworzenia listy odtwarzania"
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1262,7 +1262,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Ошибка создания списка композиций"
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -1262,7 +1262,7 @@ msgstr ""
|
|||
msgid "Playlist creation error."
|
||||
msgstr "Fel när spellistan skapades."
|
||||
|
||||
#: ../../lib/class/config.class.php:113
|
||||
#: ../../lib/class/ampconfig.class.php:113
|
||||
#, php-format
|
||||
msgid "Trying to clobber '%s' without setting clobber"
|
||||
msgstr ""
|
||||
|
|
|
@ -25,7 +25,7 @@ require_once 'lib/init.php';
|
|||
UI::show_header();
|
||||
|
||||
// Check to see if we've got the rights to be here
|
||||
if (!Config::get('allow_localplay_playback') || !Access::check('interface','25')) {
|
||||
if (!AmpConfig::get('allow_localplay_playback') || !Access::check('interface','25')) {
|
||||
UI::access_denied();
|
||||
exit;
|
||||
}
|
||||
|
@ -37,51 +37,51 @@ switch ($_REQUEST['action']) {
|
|||
if (!Access::check('localplay','75')) { UI::access_denied(); break; }
|
||||
|
||||
// Get the current localplay fields
|
||||
$localplay = new Localplay(Config::get('localplay_controller'));
|
||||
$localplay = new Localplay(AmpConfig::get('localplay_controller'));
|
||||
$fields = $localplay->get_instance_fields();
|
||||
require_once Config::get('prefix') . '/templates/show_localplay_add_instance.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_localplay_add_instance.inc.php';
|
||||
break;
|
||||
case 'add_instance':
|
||||
// This requires 50 or better!
|
||||
if (!Access::check('localplay','75')) { UI::access_denied(); break; }
|
||||
|
||||
// Setup the object
|
||||
$localplay = new Localplay(Config::get('localplay_controller'));
|
||||
$localplay = new Localplay(AmpConfig::get('localplay_controller'));
|
||||
$localplay->add_instance($_POST);
|
||||
break;
|
||||
case 'update_instance':
|
||||
// Make sure they gots them rights
|
||||
if (!Access::check('localplay','75')) { UI::access_denied(); break; }
|
||||
$localplay = new Localplay(Config::get('localplay_controller'));
|
||||
$localplay = new Localplay(AmpConfig::get('localplay_controller'));
|
||||
$localplay->update_instance($_REQUEST['instance'],$_POST);
|
||||
header("Location:" . Config::get('web_path') . "/localplay.php?action=show_instances");
|
||||
header("Location:" . AmpConfig::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')) { UI::access_denied(); break; }
|
||||
$localplay = new Localplay(Config::get('localplay_controller'));
|
||||
$localplay = new Localplay(AmpConfig::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';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_localplay_edit_instance.inc.php';
|
||||
break;
|
||||
case 'show_instances':
|
||||
// First build the localplay object and then get the instances
|
||||
if (!Access::check('localplay','5')) { UI::access_denied(); break; }
|
||||
$localplay = new Localplay(Config::get('localplay_controller'));
|
||||
$localplay = new Localplay(AmpConfig::get('localplay_controller'));
|
||||
$instances = $localplay->get_instances();
|
||||
$fields = $localplay->get_instance_fields();
|
||||
require_once Config::get('prefix') . '/templates/show_localplay_instances.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_localplay_instances.inc.php';
|
||||
break;
|
||||
default:
|
||||
case 'show_playlist':
|
||||
if (!Access::check('localplay','5')) { UI::access_denied(); break; }
|
||||
// Init and then connect to our localplay instance
|
||||
$localplay = new Localplay(Config::get('localplay_controller'));
|
||||
$localplay = new Localplay(AmpConfig::get('localplay_controller'));
|
||||
$localplay->connect();
|
||||
|
||||
// Pull the current playlist and require the template
|
||||
$objects = $localplay->get();
|
||||
require_once Config::get('prefix') . '/templates/show_localplay_status.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_localplay_status.inc.php';
|
||||
$browse = new Browse();
|
||||
$browse->set_type('playlist_localplay');
|
||||
$browse->set_static_content(true);
|
||||
|
|
24
login.php
24
login.php
|
@ -34,7 +34,7 @@ Preference::init();
|
|||
* even want them to be able to get to the login
|
||||
* page if they aren't in the ACL
|
||||
*/
|
||||
if (Config::get('access_control')) {
|
||||
if (AmpConfig::get('access_control')) {
|
||||
if (!Access::check_network('interface', '', '5')) {
|
||||
debug_event('UI::access_denied', 'Access Denied:' . $_SERVER['REMOTE_ADDR'] . ' is not in the Interface Access list', '3');
|
||||
UI::access_denied();
|
||||
|
@ -48,7 +48,7 @@ unset($auth);
|
|||
/* Check for posted username and password, or appropriate environment
|
||||
variable if using HTTP auth */
|
||||
if (($_POST['username'] && $_POST['password']) ||
|
||||
(in_array('http', Config::get('auth_methods')) &&
|
||||
(in_array('http', AmpConfig::get('auth_methods')) &&
|
||||
($_SERVER['REMOTE_USER'] || $_SERVER['HTTP_REMOTE_USER']))) {
|
||||
|
||||
if ($_POST['rememberme']) {
|
||||
|
@ -56,7 +56,7 @@ if (($_POST['username'] && $_POST['password']) ||
|
|||
}
|
||||
|
||||
/* If we are in demo mode let's force auth success */
|
||||
if (Config::get('demo_mode')) {
|
||||
if (AmpConfig::get('demo_mode')) {
|
||||
$auth['success'] = true;
|
||||
$auth['info']['username'] = 'Admin - DEMO';
|
||||
$auth['info']['fullname'] = 'Administrative User';
|
||||
|
@ -90,7 +90,7 @@ if (($_POST['username'] && $_POST['password']) ||
|
|||
Error::add('general', T_('User Disabled please contact Admin'));
|
||||
debug_event('Login', scrub_out($username) . ' is disabled and attempted to login', '1');
|
||||
} // if user disabled
|
||||
elseif (Config::get('prevent_multiple_logins')) {
|
||||
elseif (AmpConfig::get('prevent_multiple_logins')) {
|
||||
$session_ip = $user->is_logged_in();
|
||||
$current_ip = inet_pton($_SERVER['REMOTE_ADDR']);
|
||||
if ($current_ip && ($current_ip != $session_ip)) {
|
||||
|
@ -99,12 +99,12 @@ if (($_POST['username'] && $_POST['password']) ||
|
|||
debug_event('Login', scrub_out($username) . ' is already logged in from ' . $session_ip . ' and attempted to login from ' . $current_ip, '1');
|
||||
} // if logged in multiple times
|
||||
} // if prevent multiple logins
|
||||
elseif (Config::get('auto_create') && $auth['success'] &&
|
||||
elseif (AmpConfig::get('auto_create') && $auth['success'] &&
|
||||
! $user->username) {
|
||||
/* This is run if we want to autocreate users who don't
|
||||
exist (useful for non-mysql auth) */
|
||||
$access = Config::get('auto_user')
|
||||
? User::access_name_to_level(Config::get('auto_user'))
|
||||
$access = AmpConfig::get('auto_user')
|
||||
? User::access_name_to_level(AmpConfig::get('auto_user'))
|
||||
: '5';
|
||||
$name = $auth['name'];
|
||||
$email = $auth['email'];
|
||||
|
@ -121,7 +121,7 @@ if (($_POST['username'] && $_POST['password']) ||
|
|||
|
||||
// This allows stealing passwords validated by external means
|
||||
// such as LDAP
|
||||
if (Config::get('auth_password_save') && $auth['success'] && $password) {
|
||||
if (AmpConfig::get('auth_password_save') && $auth['success'] && $password) {
|
||||
$user->update_password($password);
|
||||
}
|
||||
} // if we aren't in demo mode
|
||||
|
@ -139,14 +139,14 @@ if ($auth['success']) {
|
|||
$_SESSION['userdata'] = $auth;
|
||||
|
||||
// Record the IP of this person!
|
||||
if (Config::get('track_user_ip')) {
|
||||
if (AmpConfig::get('track_user_ip')) {
|
||||
$user->insert_ip_history();
|
||||
}
|
||||
|
||||
/* Make sure they are actually trying to get to this site and don't try
|
||||
* to redirect them back into an admin section
|
||||
*/
|
||||
$web_path = Config::get('web_path');
|
||||
$web_path = AmpConfig::get('web_path');
|
||||
if ((substr($_POST['referrer'], 0, strlen($web_path)) == $web_path) &&
|
||||
strpos($_POST['referrer'], 'install.php') === false &&
|
||||
strpos($_POST['referrer'], 'login.php') === false &&
|
||||
|
@ -158,8 +158,8 @@ if ($auth['success']) {
|
|||
header('Location: ' . $_POST['referrer']);
|
||||
exit();
|
||||
} // if we've got a referrer
|
||||
header('Location: ' . Config::get('web_path') . '/index.php');
|
||||
header('Location: ' . AmpConfig::get('web_path') . '/index.php');
|
||||
exit();
|
||||
} // auth success
|
||||
|
||||
require Config::get('prefix') . '/templates/show_login_form.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_login_form.inc.php';
|
||||
|
|
|
@ -41,10 +41,10 @@ switch ($action) {
|
|||
Error::add('general', T_('Password has not been sent'));
|
||||
}
|
||||
|
||||
require Config::get('prefix') . '/templates/show_login_form.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_login_form.inc.php';
|
||||
break;
|
||||
default:
|
||||
require Config::get('prefix') . '/templates/show_lostpassword_form.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_lostpassword_form.inc.php';
|
||||
}
|
||||
|
||||
function send_newpassword($email,$current_ip)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
require_once Config::get('prefix') . '/modules/Dropbox/autoload.php';
|
||||
require_once AmpConfig::get('prefix') . '/modules/Dropbox/autoload.php';
|
||||
|
||||
/**
|
||||
* Dropbox Catalog Class
|
||||
|
@ -77,7 +77,7 @@ class Catalog_dropbox extends Catalog
|
|||
"<li>Select 'Specific file types' at 'What type of files does your app need access to?'</li>" .
|
||||
"<li>Check Videos and Audio files</li>" .
|
||||
"<li>Give a name to your application and create it</li>" .
|
||||
//"<li>Add the following OAuth redirect URIs: <i>" . Config::get('web_path') . "/admin/catalog.php</i></li>" .
|
||||
//"<li>Add the following OAuth redirect URIs: <i>" . AmpConfig::get('web_path') . "/admin/catalog.php</i></li>" .
|
||||
"<li>Copy your App key and App secret here</li></ul>";
|
||||
return $help;
|
||||
|
||||
|
@ -473,7 +473,7 @@ class Catalog_dropbox extends Catalog
|
|||
public function format()
|
||||
{
|
||||
parent::format();
|
||||
$this->f_info = UI::truncate($this->apikey, Config::get('ellipse_threshold_title'));
|
||||
$this->f_info = UI::truncate($this->apikey, AmpConfig::get('ellipse_threshold_title'));
|
||||
$this->f_full_info = $this->apikey;
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ class Catalog_googlemusic extends Catalog
|
|||
}
|
||||
}
|
||||
|
||||
require_once Config::get('prefix') . '/modules/GMApi/GMApi.php';
|
||||
require_once AmpConfig::get('prefix') . '/modules/GMApi/GMApi.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -188,7 +188,7 @@ class Catalog_googlemusic extends Catalog
|
|||
public function createClient()
|
||||
{
|
||||
$api = new GMApi();
|
||||
$api->setDebug(Config::get('debug'));
|
||||
$api->setDebug(AmpConfig::get('debug'));
|
||||
$api->enableRestore(false);
|
||||
$api->enableMACAddressCheck(false);
|
||||
$api->enableSessionFile(false);
|
||||
|
|
|
@ -278,7 +278,7 @@ class Catalog_local extends Catalog
|
|||
// if it was set the day before
|
||||
unset($failed_check);
|
||||
|
||||
if (Config::get('no_symlinks')) {
|
||||
if (AmpConfig::get('no_symlinks')) {
|
||||
if (is_link($full_file)) {
|
||||
debug_event('read', "Skipping symbolic link $path", 5);
|
||||
continue;
|
||||
|
@ -300,7 +300,7 @@ class Catalog_local extends Catalog
|
|||
} //it's a directory
|
||||
|
||||
$is_audio_file = Catalog::is_audio_file($file);
|
||||
if (!$is_audio_file AND Config::get('catalog_video_pattern')) {
|
||||
if (!$is_audio_file AND AmpConfig::get('catalog_video_pattern')) {
|
||||
$is_video_file = Catalog::is_video_file($file);
|
||||
}
|
||||
|
||||
|
@ -326,8 +326,8 @@ class Catalog_local extends Catalog
|
|||
|
||||
// Check to make sure the filename is of the expected charset
|
||||
if (function_exists('iconv')) {
|
||||
if (strcmp($full_file,iconv(Config::get('site_charset'),Config::get('site_charset'),$full_file)) != '0') {
|
||||
debug_event('read',$full_file . ' has non-' . Config::get('site_charset') . ' characters and can not be indexed, converted filename:' . iconv(Config::get('site_charset'),Config::get('site_charset'),$full_file),'1');
|
||||
if (strcmp($full_file,iconv(AmpConfig::get('site_charset'),AmpConfig::get('site_charset'),$full_file)) != '0') {
|
||||
debug_event('read',$full_file . ' has non-' . AmpConfig::get('site_charset') . ' characters and can not be indexed, converted filename:' . iconv(AmpConfig::get('site_charset'),AmpConfig::get('site_charset'),$full_file),'1');
|
||||
/* HINT: FullFile */
|
||||
Error::add('catalog_add', sprintf(T_('%s does not match site charset'), $full_file));
|
||||
continue;
|
||||
|
@ -389,7 +389,7 @@ class Catalog_local extends Catalog
|
|||
|
||||
$this->count = 0;
|
||||
|
||||
require Config::get('prefix') . '/templates/show_adds_catalog.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_adds_catalog.inc.php';
|
||||
flush();
|
||||
|
||||
/* Set the Start time */
|
||||
|
@ -420,7 +420,7 @@ class Catalog_local extends Catalog
|
|||
|
||||
if ($options['gather_art']) {
|
||||
$catalog_id = $this->id;
|
||||
require Config::get('prefix') . '/templates/show_gather_art.inc.php';
|
||||
require AmpConfig::get('prefix') . '/templates/show_gather_art.inc.php';
|
||||
flush();
|
||||
$this->gather_art();
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ class Catalog_local extends Catalog
|
|||
$number = $stats['videos'] + $stats['songs'];
|
||||
$total_updated = 0;
|
||||
|
||||
require_once Config::get('prefix') . '/templates/show_verify_catalog.inc.php';
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_verify_catalog.inc.php';
|
||||
|
||||
foreach (array('video', 'song') as $media_type) {
|
||||
$total = $stats[$media_type . 's']; // UGLY
|
||||
|
@ -494,7 +494,7 @@ class Catalog_local extends Catalog
|
|||
"WHERE `catalog`='$this->id' LIMIT $count,$chunk_size";
|
||||
$db_results = Dba::read($sql);
|
||||
|
||||
if (Config::get('memory_cache')) {
|
||||
if (AmpConfig::get('memory_cache')) {
|
||||
while ($row = Dba::fetch_assoc($db_results, false)) {
|
||||
$media_ids[] = $row['id'];
|
||||
}
|
||||
|
@ -703,7 +703,7 @@ class Catalog_local extends Catalog
|
|||
public function format()
|
||||
{
|
||||
parent::format();
|
||||
$this->f_info = UI::truncate($this->path, Config::get('ellipse_threshold_title'));
|
||||
$this->f_info = UI::truncate($this->path, AmpConfig::get('ellipse_threshold_title'));
|
||||
$this->f_full_info = $this->path;
|
||||
}
|
||||
|
||||
|
|
|
@ -360,7 +360,7 @@ class Catalog_remote extends Catalog
|
|||
public function format()
|
||||
{
|
||||
parent::format();
|
||||
$this->f_info = UI::truncate($this->uri, Config::get('ellipse_threshold_title'));
|
||||
$this->f_info = UI::truncate($this->uri, AmpConfig::get('ellipse_threshold_title'));
|
||||
$this->f_full_info = $this->uri;
|
||||
}
|
||||
|
||||
|
|
|
@ -137,12 +137,12 @@ class Catalog_soundcloud extends Catalog
|
|||
}
|
||||
}
|
||||
|
||||
require_once Config::get('prefix') . '/modules/php-soundcloud/Soundcloud.php';
|
||||
require_once AmpConfig::get('prefix') . '/modules/php-soundcloud/Soundcloud.php';
|
||||
}
|
||||
|
||||
protected function getRedirectUri()
|
||||
{
|
||||
return Config::get('web_path') . "/show_get.php?param_name=code";
|
||||
return AmpConfig::get('web_path') . "/show_get.php?param_name=code";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -408,7 +408,7 @@ class Catalog_soundcloud extends Catalog
|
|||
public function format()
|
||||
{
|
||||
parent::format();
|
||||
$this->f_info = UI::truncate($this->userid, Config::get('ellipse_threshold_title'));
|
||||
$this->f_info = UI::truncate($this->userid, AmpConfig::get('ellipse_threshold_title'));
|
||||
$this->f_full_info = $this->userid;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue