If you process a form and execute this code on submission, the user should be deactivated:
/* only works for logged in users */
if ($modx->user->hasSessionContext($modx->context->get('key) ) ) {
$modx->user->set('active', 0);
$modx->user->save();
}
That won't delete the user record, it will just mark the user as inactive and he or she won't be able to log in. Also, the user will still be logged in unless you explicitly log them out.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
[ed. note: BobRay last edited this post 14 years, 5 months ago.]