everybody! Could you please help me with the following problem.
Kunena 4.0.1. I have created several special user ranks. Some users have a permission to create new users. The task is to set rank of the new user differ to the default value but one of the special ranks. I've tried to do it using a custom plugin related to the "onUserAfterSave" event. But it didn't work. What I’m doing wrong?
function onUserAfterSave ($user, $isnew)
{
if ($isnew)
{
$NewKUser = KunenaFactory::getUser(intval($user['id']));
$NewKUser->rank['rank_id'] = 11;
$NewKUser->save(true);
}
}
Problem solved: