diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-22 19:00:45 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-22 19:00:45 +0000 |
commit | a66bf4c5f663d16d6c2ceb4a6cb0a85f642dde43 (patch) | |
tree | 0eb8916039977a20e44260ab8fe522eae1522376 /lib/preferences.php | |
parent | 91eab2086875ad35aa93af00fc8b37d039d9f93c (diff) | |
download | ampache-a66bf4c5f663d16d6c2ceb4a6cb0a85f642dde43.tar.gz ampache-a66bf4c5f663d16d6c2ceb4a6cb0a85f642dde43.tar.bz2 ampache-a66bf4c5f663d16d6c2ceb4a6cb0a85f642dde43.zip |
Plugin work. Plugins are now pluggable: no plugin-specific code in the main Ampache
code. Plugins are now updatable, if configuration changes are needed for a new
version.
Diffstat (limited to 'lib/preferences.php')
-rw-r--r-- | lib/preferences.php | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/preferences.php b/lib/preferences.php index 79ecf7a1..0d76cc19 100644 --- a/lib/preferences.php +++ b/lib/preferences.php @@ -58,17 +58,17 @@ function update_preferences($pref_id=0) { case 'sample_rate': $value = Stream::validate_bitrate($value); break; - /* MD5 the LastFM & MyStrands so it's not plainTXT */ - case 'librefm_pass': - case 'lastfm_pass': - /* If it's our default blanking thing then don't use it */ - if ($value == '******') { unset($_REQUEST[$name]); break; } - $value = md5($value); - break; default: break; } + if (preg_match('/_pass$/', $name)) { + if ($value == '******') { unset($_REQUEST[$name]); } + else if (preg_match('/md5_pass$/', $name)) { + $value = md5($value); + } + } + /* Run the update for this preference only if it's set */ if (isset($_REQUEST[$name])) { Preference::update($id,$pref_id,$value,$_REQUEST[$apply_to_all]); @@ -247,10 +247,6 @@ function create_preference_input($name,$value) { } // foreach themes echo "</select>\n"; break; - case 'lastfm_pass': - case 'librefm_pass': - echo "<input type=\"password\" size=\"16\" name=\"$name\" value=\"******\" />"; - break; case 'playlist_method': ${$value} = ' selected="selected"'; echo "<select name=\"$name\">\n"; @@ -293,7 +289,12 @@ function create_preference_input($name,$value) { echo "</select>\n"; break; default: - echo "<input type=\"text\" size=\"$len\" name=\"$name\" value=\"$value\" />"; + if (preg_match('/_pass$/', $name)) { + echo '<input type="password" size="16" name="' . $name . '" value="******" />'; + } + else { + echo '<input type="text" size="' . $len . '" name="' . $name . '" value="' . $value .'" />'; + } break; } |