1 edb Feb 26, 2009 04:08
3 edb Feb 26, 2009 09:30
In /inc/users/users.ctrl.php find and modify:
$Messages->add( T_('You can\'t delete User #1!'), 'error' );
$action = 'view_user';
break;
}
$Plugins->trigger_event( 'BeforeUserDelete', array( 'delete_User' => & $edited_User ) );
if( $Messages->count('error') )
{ // There have been some validation errors:
// Params we need for tab switching:
$action = 'view_user';
break;
}
if( param( 'confirm', 'integer', 0 ) )
{ // confirmed, Delete from DB:
In /inc/plugins/plugin.class.php add this before function AfterUserDelete():
/**
* Event handler: Called at the beginning of the User::dbdelete() process
* an user from the database}.
*
* @param array Associative array of parameters
* - 'User': the related User (by reference)
*/
function BeforeUserDelete( & $params )
{
}
Still untested though. Seems doing things "the right way" doesn't work so now I gotta go back and redo the wrong way.
oops! just noticed this is a repost of a [url=http://forums.b2evolution.net/viewtopic.php?t=17861]very recent similar request[/url]. I'll try to make ammends for this lapse of judgment with a bit of code that can make it happen.