From d1c6fd3d5e71972edeae2216b20251796bc1ea58 Mon Sep 17 00:00:00 2001 From: Harvie Date: Mon, 17 Dec 2012 15:55:11 +0100 Subject: [PATCH] Support for empty cache password --- example_config.php | 2 +- index.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/example_config.php b/example_config.php index 5956ab0..7c5c6e1 100755 --- a/example_config.php +++ b/example_config.php @@ -13,7 +13,7 @@ $title = 'Harvie\'s JuKe!Box'; //Title of jukebox $music_dir = 'music'; //Local path to directory with music $music_dir_url = 'http://your-server.net/jukebox/music'; //URL path to the same directory CHANGE IT! -$cache_passwd = 'renew123'; //You need this passwd to refresh search cache CHANGE IT! +$cache_passwd = ''; //You need this passwd to refresh search cache CHANGE IT! //Login $realm = 'music'; //HTTP Auth Banner $users = array( //List of 'user' => 'password' pairs diff --git a/index.php b/index.php index 0301767..704dc91 100755 --- a/index.php +++ b/index.php @@ -21,7 +21,7 @@ $title = 'Harvie\'s JuKe!Box'; //Title of jukebox $music_dir = 'music'; //Local path to directory with music $base_url = preg_replace('/[^\/]*$/', '', $_SERVER['SCRIPT_NAME']); //URL of this directory (always ends with slash) $music_dir_url = 'http://your-server.net/jukebox/music'; //URL path to the same directory -$cache_passwd = 'renew123'; //You need this passwd to refresh search cache +$cache_passwd = ''; //You need this passwd to refresh search cache $sort = 3; //Sort? 0 = none, 1 = playlists, 2 = 1+listings; 3 = 2+search-EXPERIMENTAL! (sorting could eat lot of memory) $access_limit = 40; //How many files could be accessed without using cache (while searching) @@ -307,11 +307,12 @@ if(isset($_GET['song'])) { -if($_POST['cache-refresh'] == $cache_passwd) { +if(isset($_POST['cache-refresh']) && $_POST['cache-refresh'] == $cache_passwd) { generate_search_cache($music_dir, $search_cache); die("\n"); } + if(isset($_GET['playlist'])) { generate_m3u($dir, dirname($music_dir_url), isset($_GET['recursive'])); die(); -- 2.30.2