summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-07-27 18:05:18 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-07-30 10:07:19 -0400
commitd07b8448d1e96f07c6e6b41293797a89a4530c3d (patch)
tree5842d3359ab5eb2ca587abc43faf1aabdf1c438d /apps
parent7d17c59a51d06e7aeaf8b52fb5268dc14a7b51dd (diff)
downloadnextcloud-server-d07b8448d1e96f07c6e6b41293797a89a4530c3d.tar.gz
nextcloud-server-d07b8448d1e96f07c6e6b41293797a89a4530c3d.zip
Set the user id when authenticating user for Ampache, fixes bug oc-219
Diffstat (limited to 'apps')
-rw-r--r--apps/media/lib_ampache.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/media/lib_ampache.php b/apps/media/lib_ampache.php
index f5c91661abe..7c4e1dac3f6 100644
--- a/apps/media/lib_ampache.php
+++ b/apps/media/lib_ampache.php
@@ -71,6 +71,7 @@ class OC_MEDIA_AMPACHE{
$pass=$users[0]['user_password_sha256'];
$key=hash('sha256',$time.$pass);
if($key==$auth){
+
$token=hash('sha256','oc_media_'.$key);
OC_MEDIA_COLLECTION::$uid=$users[0]['user_id'];
$date=date('c');//todo proper update/add/clean dates
@@ -144,6 +145,7 @@ class OC_MEDIA_AMPACHE{
$users=$query->execute(array($auth))->fetchAll();
if(count($users)>0){
OC_MEDIA_COLLECTION::$uid=$users[0]['user_id'];
+ OC_User::setUserId($users[0]['user_id']);
return $users[0]['user_id'];
}else{
return false;