summaryrefslogtreecommitdiffstats
path: root/play
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-09-25 01:05:23 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-09-25 01:05:23 +0000
commite32557bf900153c5cfb0d2f28640aa9091ef7488 (patch)
tree56e2d9b722c582d536a6b3e8065914851894db72 /play
parent3ad79fc4c9a6718a336fd929e33b6a0ac9bbf173 (diff)
downloadampache-e32557bf900153c5cfb0d2f28640aa9091ef7488.tar.gz
ampache-e32557bf900153c5cfb0d2f28640aa9091ef7488.tar.bz2
ampache-e32557bf900153c5cfb0d2f28640aa9091ef7488.zip
finished up ACL work
Diffstat (limited to 'play')
-rw-r--r--play/index.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/play/index.php b/play/index.php
index 91f1323f..1dbf8ef1 100644
--- a/play/index.php
+++ b/play/index.php
@@ -74,7 +74,8 @@ if (conf('demo_mode') || (!$GLOBALS['user']->has_access('25') && !$xml_rpc) ) {
*/
if (conf('access_control')) {
$access = new Access(0);
- if (!$access->check("25", $_SERVER['REMOTE_ADDR'])) {
+ if (!$access->check('stream',$_SERVER['REMOTE_ADDR'],$GLOBALS['user']->username,'25') AND
+ !$access->check('network',$_SERVER['REMOTE_ADDR'],$GLOBALS['user']->username,'25')) {
debug_event('access_denied', "Streaming Access Denied: " . $_SERVER['REMOTE_ADDR'] . " does not have stream level access",'3');
access_denied();
}
@@ -189,8 +190,15 @@ header("Accept-Ranges: bytes" );
// Prevent the script from timing out
set_time_limit(0);
+
+/* If access control is on and they aren't local, downsample! */
+if (conf('access_control')) {
+ if (!$access->check('network',$_SERVER['REMOTE_ADDR'],$GLOBALS['user']->username,'25')) {
+ $not_local = true;
+ }
+} // if access_control
-if ($GLOBALS['user']->prefs['play_type'] == 'downsample' || !$song->native_stream()) {
+if ($GLOBALS['user']->prefs['play_type'] == 'downsample' || !$song->native_stream() || $not_local) {
$results = start_downsample($song,$lastid,$song_name);
$fp = $results['handle'];
$song->size = $results['size'];