$userid = 1; $user = $modx->getObject('modUser', $userid); if($user){ $user->set('active', 1); if($user->save() == false){ $modx->log(modX::LOG_LEVEL_ERROR,'$user active state not saved for user id: '.$userid); } }
This question has been answered by BobRay. See the first response.
$cm = $modx->getCacheManager(); $cm->refresh();
https://bobsguides.com/mgnr/?a=security/user/update&id=1&bogusparam=12
if($user->save(true) == false){
I had another thought.
Try this:
if($user->save(true) == false){
Ok, good because I looked all over the /core/cache folder, thought I was going crazy.