Generate memberId on joinig the session
This commit is contained in:
parent
32016d8381
commit
37a767ad48
@ -43,12 +43,13 @@ class Controller {
|
|||||||
$session = Session::add($genesisPath, $hash, $path);
|
$session = Session::add($genesisPath, $hash, $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
$session['member_id'] = Member::add($session['es_id'], \OCP\User::getDisplayName(), '#00f000');
|
$session['member_id'] = Member::add($session['es_id'], \OCP\User::getUser(), '#00f000');
|
||||||
|
|
||||||
\OCP\JSON::success($session);
|
\OCP\JSON::success($session);
|
||||||
exit();
|
exit();
|
||||||
} catch (\Exception $e){
|
} catch (\Exception $e){
|
||||||
throw $e;
|
//TODO: Log
|
||||||
|
throw $e; //Debug
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
\OCP\JSON::error();
|
\OCP\JSON::error();
|
||||||
@ -66,12 +67,18 @@ class Controller {
|
|||||||
public static function joinSession($args){
|
public static function joinSession($args){
|
||||||
$esId = @$args['es_id'];
|
$esId = @$args['es_id'];
|
||||||
\OCP\JSON::checkLoggedIn();
|
\OCP\JSON::checkLoggedIn();
|
||||||
|
try {
|
||||||
if ($esId){
|
if ($esId){
|
||||||
$session = Session::getSession($esId);
|
$session = Session::getSession($esId);
|
||||||
// !TODO: return member_id here ???
|
|
||||||
\OCP\JSON::success($session);
|
$session['member_id'] = Member::add($session['es_id'], \OCP\User::getUser(), '#00f000');
|
||||||
exit();
|
\OCP\JSON::success($session);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \Exception();
|
||||||
|
} catch (\Exception $e){
|
||||||
|
//TODO: Log
|
||||||
}
|
}
|
||||||
\OCP\JSON::error();
|
\OCP\JSON::error();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user