modx.customize Reply #1, 3 months, 2 weeks ago
Hi
I managed to add new users with this code:
This add user to Manger area but only to table : *prefix*users
Then I add :
I am sure I get this crashed ((
I need to populate *prefix*user_attributes table cause I think this must be updated / synchronised together with the first table but my first part code does not do it. That's why i am trying to use Profile and SET..
Probably I should not use profile and set method? Or I use it wrong in terms of users updates?
Thanks
I managed to add new users with this code:
$userTmp = $modx->newObject("modUser");
$userTmp->set('username', $lender);
$userTmp->set("password", md5($pass));
$userTmp->save();
$idUser = $userTmp->get('id');This add user to Manger area but only to table : *prefix*users
Then I add :
$_usr = $modx->getObject('modUser',$idUser);
if (!$_usr) return 'no user??';
$_profile = $_usr->getOne('Profile');
$_profile->setValue('email', 'no-reply@demo-site.com');
$_profile->save();I am sure I get this crashed ((
I need to populate *prefix*user_attributes table cause I think this must be updated / synchronised together with the first table but my first part code does not do it. That's why i am trying to use Profile and SET..
Probably I should not use profile and set method? Or I use it wrong in terms of users updates?
Thanks