summaryrefslogtreecommitdiffstats
path: root/play
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-09 07:49:59 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-09 07:49:59 +0000
commitc5d6e04d114d3c4b3f31743ccd0d4a60c9ef9632 (patch)
treebc3196cb97d63079013ebfc5b183d2038ee7c9e7 /play
parentc9170314af9139abef87629d218c7999bd3c8df3 (diff)
downloadampache-c5d6e04d114d3c4b3f31743ccd0d4a60c9ef9632.tar.gz
ampache-c5d6e04d114d3c4b3f31743ccd0d4a60c9ef9632.tar.bz2
ampache-c5d6e04d114d3c4b3f31743ccd0d4a60c9ef9632.zip
removed ID field from user table, and everything that goes with that...
Diffstat (limited to 'play')
-rw-r--r--play/index.php11
-rw-r--r--play/pupload.php8
2 files changed, 11 insertions, 8 deletions
diff --git a/play/index.php b/play/index.php
index 8555f444..3772d8de 100644
--- a/play/index.php
+++ b/play/index.php
@@ -39,7 +39,7 @@ $sid = htmlspecialchars($_REQUEST['sid']);
/* Misc Housework */
$dbh = dbh();
-$user = new User(0,$uid);
+$user = new User($uid);
if (conf('require_session') && !conf('xml_rpc')) {
if(!session_exists($sid)) {
@@ -90,7 +90,10 @@ if ( isset( $uid ) ) {
echo "Error: No Song";
exit;
}
- if ($song->status === 'disabled') {
+ if ($song->status == '0') {
+ if (conf('debug')) {
+ log_event($user->username,' song_disabled ',"Error: $song->file is currently disabled, song skipped");
+ }
exit;
}
if ($user->disabled == '1') {
@@ -100,9 +103,9 @@ if ( isset( $uid ) ) {
echo "Error: User Disabled";
exit;
}
- if (!$user->id && !$user->is_xmlrpc()) {
+ if (!$user->username && !$user->is_xmlrpc()) {
if (conf('debug')) {
- log_event($user->username,' user_not_found ',"Error $user->id not found, stream access denied");
+ log_event($user->username,' user_not_found ',"Error $user->username not found, stream access denied");
}
echo "Error: No User Found";
exit;
diff --git a/play/pupload.php b/play/pupload.php
index 2290a59d..e7de7a6c 100644
--- a/play/pupload.php
+++ b/play/pupload.php
@@ -78,13 +78,13 @@ $site->get_preferences();
// require a uid and valid song
if ( isset( $uid ) ) {
// Create the user object if possible
- $user = new User(0,$uid);
+ $user = new User($uid);
$song = $site->prefs['upload_dir'] . $song;
if (!file_exists ( $song )) { echo "Error: No Song"; exit; }
if ($user->access === 'disabled') { echo "Error: User Disabled"; exit; }
- if (!$user->id && !$user->is_xmlrpc()) { echo "Error: No User Found"; exit; }
+ if (!$user->username && !$user->is_xmlrpc()) { echo "Error: No User Found"; exit; }
}
else {
@@ -136,7 +136,7 @@ if ( $_REQUEST['action'] == 'm3u' ) {
$song_name = $artist . " - " . $title . "." . $type;
$sess = $_COOKIE[libglue_param('sess_name')];
//echo "Song Name: $song_name<BR>\n";
- $url = escapeshellarg("$web_path/play/pupload.php?song=$song_nm&uid=$user->id&sid=$sess");
+ $url = escapeshellarg("$web_path/play/pupload.php?song=$song_nm&uid=$user->username&sid=$sess");
$localplay_add = conf('localplay_add');
$localplay_add = str_replace("%URL%", $url, $localplay_add);
//echo "Executing: $localplay_add<BR>";
@@ -165,7 +165,7 @@ if ( $_REQUEST['action'] == 'm3u' ) {
$sess = $_COOKIE[libglue_param('sess_name')];
if($temp_user->prefs['down-sample'] == 'true')
$ds = $temp_user->prefs['sample_rate'];
- echo "$web_path/play/pupload.php?song=" . rawurlencode($song_nm) . "&uid=$user->id&sid=$sess";
+ echo "$web_path/play/pupload.php?song=" . rawurlencode($song_nm) . "&uid=$user->username&sid=$sess";
}
exit;