News here : I got it working, but I need some more tests to be sure.
First of all, I was modifying only the files in the core/components/discuss folder, and I forget that there were snippets !
So, here's what I did with postHook.DiscussLogin snippet :
/** @var disUser $disUser */
$disUser = $modx->getObject('disUser',$c);
if (empty($disUser)) {
/* ok, we need to create a parallel disUser obj since none exists */
/** @var modUserProfile $profile */
$profile = $user->getOne('Profile');
$disUser = $modx->newObject('disUser');
$disUser->fromArray(array(
'user' => $user->get('id'),
//'username' => $user->get('username'), //don't create username here, need fullname
'password' => $user->get('password'),
'salt' => $user->get('salt'),
'confirmed' => true,
'confirmedon' => date('Y-m-d H:I:S'),
'createdon' => date('Y-m-d H:I:S'),
'source' => 'internal',
'status' => disUser::ACTIVE,
));
if ($profile) {
$disUser->fromArray($profile->toArray());
$disUser->set('birthdate',strftime($discuss->dateFormat,$profile->get('dob')));
$disUser->set('gender',$profile->get('gender') == 2 ? 'f' : 'm');
$name = $profile->get('fullname');
$name = explode(' ',$name);
$disUser->fromArray(array(
'username' => $profile->get('fullname'), //create username with the fullname
'name_first' => $name[0],
'name_last' => isset($name[1]) ? $name[1] : '',
));
}
$disUser->save();
}
Now, my users are created in Discuss once they log in (in frontend). I confirm they aren't created before. They don't appear in discuss's users database.
Tryied to update profile with login snippet and the data where synced in discuss database.
But now, the posthook.discusslogin.php dissetup.class.php and in discuss.class.php files (not snippets in manager ;-) have the same hack as shown upper. So, I need to "reset" back the files now to be sure. Because in discuss.class.php I changed 'source' => 'internal', with 'source' => 'discuss.class.php', and I saw it in 50% of my creation/login tests... Weird.
I need more investigate to get it solved
PS : strange behavior of my Modx these days, my error.log files isn't created anymore. If I create it manually, it remains blank. Lack of feedback