Set the user id when authenticating user for Ampache, fixes bug oc-219

This commit is contained in:
Michael Gapczynski 2012-07-27 18:05:18 -04:00
parent 7d17c59a51
commit d07b8448d1
1 changed files with 2 additions and 0 deletions

View 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;