Hi,
i want to add a funtion to Volt, i am using vokuro. Here is the compiler
$compiler->addFunction('authUserById', function ($resolvedArgs) {return '!empty($this->session->auth-identity)';});
And that is the function to add:
public function authUserById($id)
{
$user = Users::findFirstById($id);
if ($user == false) {
throw new Exception('The user does not exist');
}
$this->checkUserFlags($user);
$this->session->set('auth-identity', array(
'id' => $user->id,
'name' => $user->name,
'profile' => $user->profile->name
));
}
i only need the ID from the logged client, thank you in advance.
Rgds
Stefan