if ($user = $modx->getObject('modUser', $modx->getLoginUserID('web'))) { $user->remove(); // works, user is deleted. }
if ($user = $modx->getObject('modUser', $modx->getLoginUserID('web'))) { $user->set('active',0); // but this don't work at all.. ??? }
$userId = $modx->getObject('modUser', 51); // 51 is a user with active set to 1 $userId->set('active',0);
This question has been answered by BobRay. See the first response.
$user->save();
$user->get(); $user->set(); $user->remove(); $user->save();
function set function setSudo function save function remove function loadAttributes function isAuthenticated function endSession function passwordMatches function activatePassword function changePassword function getSessionContexts function addSessionContext function generateToken function getUserToken function removeSessionContext function removeSessionContextVars function removeSessionCookie function hasSessionContext function countMessages function getSettings function getResourceGroups function getUserGroups function getPrimaryGroup function getUserGroupNames function isMember function joinGroup function leaveGroup function removeLocks function generatePassword function sendEmail function getDashboard