HI,
I want to know if it’s possible to attach some code to the OnManagerDeleteUser event, without hacking the core.
I created my own custom web user registration using eform and I’m using a custom table for custom user information. When a web user is deleted(inside manager) I want to delete all the references from the other tables.
Thank you
solution
//<?php
$e = &$modx->Event;
switch($e->name) {
case 'OnWebDeleteUser':
//delete extended user information
$modx->db->delete($modx->getFullTableName('web_user_attributes_extended'), "internalKey = $userid");
break;
default:
$modx->logEvent(5, 3, 'Delete Web User Extended Attributes', 'Possible error when deleting this user: ' . $userid);
return;
break;
}