summaryrefslogtreecommitdiffstats
path: root/lib/class/browse.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-01-14 01:38:50 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-01-14 01:38:50 +0000
commitd7c3ede9e757dab9889503a415d78c7937a311b3 (patch)
tree4311b7aac78600968bdb151c6873eaca80caee5f /lib/class/browse.class.php
parentfda4bd6deb683fc937f1ae831d9c8ed5b4748eaf (diff)
downloadampache-d7c3ede9e757dab9889503a415d78c7937a311b3.tar.gz
ampache-d7c3ede9e757dab9889503a415d78c7937a311b3.tar.bz2
ampache-d7c3ede9e757dab9889503a415d78c7937a311b3.zip
fixed public/private aspect of playlists, default is to filter out non-owned private playlists now
Diffstat (limited to 'lib/class/browse.class.php')
-rw-r--r--lib/class/browse.class.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php
index ae82d271..6eda41c7 100644
--- a/lib/class/browse.class.php
+++ b/lib/class/browse.class.php
@@ -62,7 +62,6 @@ class Browse {
switch ($key) {
case 'show_art':
- $key = $_REQUEST['key'];
if ($_SESSION['browse']['filter'][$key]) {
unset($_SESSION['browse']['filter'][$key]);
}
@@ -80,6 +79,11 @@ class Browse {
if ($value == _('All')) { $value = ''; }
$_SESSION['browse']['filter'][$key] = $value;
break;
+ case 'playlist_type':
+ // They must be content managers to turn this off
+ if ($_SESSION['browse']['filter'][$key] AND Access::check('interface','50')) { unset($_SESSION['browse']['filter'][$key]); }
+ else { $_SESSION['browse']['filter'][$key] = '1'; }
+ break;
default:
// Rien a faire
return false;
@@ -477,6 +481,10 @@ class Browse {
case 'alpha_match':
$filter_sql = " `playlist`.`name` LIKE '" . Dba::escape($value) . "%' AND ";
break;
+ case 'playlist_type':
+ $user_id = intval($GLOBALS['user']->id);
+ $filter_sql = " (`playlist`.`type` = 'public' OR `playlist`.`user`='$user_id') AND ";
+ break;
default;
// Rien a faire
break;
@@ -553,6 +561,9 @@ class Browse {
case 'name':
$sql = "`playlist`.`name`";
break;
+ case 'user':
+ $sql = "`playlist`.`user`";
+ break;
} // end switch
break;
case 'live_stream':