summaryrefslogtreecommitdiffstats
path: root/lib/class/user.class.php
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2012-03-31 17:50:04 -0400
committerPaul Arthur <paul.arthur@flowerysong.com>2012-03-31 17:52:07 -0400
commitccb9edbf2d1eb0e60d9a976e034567e3c91a33ff (patch)
treeb5d965dc1cdd9e08ccba0ea611993443d9364565 /lib/class/user.class.php
parent7fad98238e52dc23fe066aefacc8fd4e488bdbc4 (diff)
downloadampache-ccb9edbf2d1eb0e60d9a976e034567e3c91a33ff.tar.gz
ampache-ccb9edbf2d1eb0e60d9a976e034567e3c91a33ff.tar.bz2
ampache-ccb9edbf2d1eb0e60d9a976e034567e3c91a33ff.zip
Clean up get_preferences a little bit
Don't use userid as some sort of weird flag value. Especially when your flag value is a valid value for userid. Just...no.
Diffstat (limited to 'lib/class/user.class.php')
-rw-r--r--lib/class/user.class.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/class/user.class.php b/lib/class/user.class.php
index 84fb700e..4b283d62 100644
--- a/lib/class/user.class.php
+++ b/lib/class/user.class.php
@@ -193,17 +193,15 @@ class User extends database_object {
* []['prefs'] = array(array('name','display','value'));
* []['admin'] = t/f value if this is an admin only section
*/
- function get_preferences($user_id=0,$type=0) {
+ function get_preferences($type = 0, $system = false) {
// Fill out the user id
- $user_id = $user_id ? Dba::escape($user_id) : Dba::escape($this->id);
+ $user_id = $system ? Dba::escape(-1) : Dba::escape($this->id);
- if ($user_id != '-1') {
+ if (!$system) {
$user_limit = "AND preference.catagory != 'system'";
}
- if (!Config::get('use_auth')) { $user_id = '-1'; }
-
if ($type != '0') {
$user_limit = "AND preference.catagory = '" . Dba::escape($type) . "'";
}