summaryrefslogtreecommitdiffstats
path: root/lib/class/playlist.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-02-28 19:27:37 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-02-28 19:27:37 +0000
commitf9e3b1360f40ada7645d6fdd0be6ee6c721269a0 (patch)
tree3c9e1d5bc87fb84a87a06acc428d889c6a52da2b /lib/class/playlist.class.php
parent2b49c1dfc894b77272128de9ea80f8f055d4bd47 (diff)
downloadampache-f9e3b1360f40ada7645d6fdd0be6ee6c721269a0.tar.gz
ampache-f9e3b1360f40ada7645d6fdd0be6ee6c721269a0.tar.bz2
ampache-f9e3b1360f40ada7645d6fdd0be6ee6c721269a0.zip
fixed playlist permission issue for users
Diffstat (limited to 'lib/class/playlist.class.php')
-rw-r--r--lib/class/playlist.class.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php
index 0eeb6d4a..5ee93800 100644
--- a/lib/class/playlist.class.php
+++ b/lib/class/playlist.class.php
@@ -61,7 +61,7 @@ class Playlist {
*/
function _get_info() {
- $sql = "SELECT * FROM playlist WHERE id='" . sql_escape($this->id) . "'";
+ $sql = "SELECT * FROM `playlist` WHERE `id`='" . sql_escape($this->id) . "'";
$db_results = mysql_query($sql, dbh());
$results = mysql_fetch_assoc($db_results);
@@ -231,22 +231,13 @@ class Playlist {
*/
function has_access() {
- if (!$GLOBALS['user']->has_access(25)) { return false; }
-
- /* If they are a full admin, then they always get rights */
+ // Admin always have rights
if ($GLOBALS['user']->has_access(100)) { return true; }
- if ($this->user == $GLOBALS['user']->id) { return true; }
-
- /* Check the Playlist_permission table */
- $sql = "SELECT id FROM playlist_permission WHERE " .
- "playlist='" . sql_escape($this->id) . "' AND userid='" . sql_escape($GLOBALS['user']->id) . "'" .
- " AND level >= '25'";
- $db_results = mysql_query($sql, dbh());
-
- $results = mysql_fetch_row($db_results);
+ // People under 25 don't get playlist access even if they created it
+ if (!$GLOBALS['user']->has_access(25)) { return false; }
- if ($results) { return true; }
+ if ($this->user == $GLOBALS['user']->id) { return true; }
return false;