]> source.dussan.org Git - nextcloud-server.git/commitdiff
Set the user id when authenticating user for Ampache, fixes bug oc-219
authorMichael Gapczynski <mtgap@owncloud.com>
Fri, 27 Jul 2012 22:05:18 +0000 (18:05 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Mon, 30 Jul 2012 14:07:19 +0000 (10:07 -0400)
apps/media/lib_ampache.php

index f5c91661abee3747c1f69ec30b446951b4261793..7c4e1dac3f65a99824029566d213a5703c3f66ba 100644 (file)
@@ -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;