Thanks for the input. I'm ending up going along similar lines to the ActivationEmail plugin. However, instead of a front end interface as Adrian suggested I'm using the approach taken by Quip. The email sent to the moderator includes a link to the manager with the "update user" action and user id specified, along with a custom GET variable. A plugin firing on OnUserFormRender checks for that var and tries to activate the user if present, and sends out the email to the user on success. In my case the admins are generally working through the back-end anyway which makes this more appropriate.
Check out the "checkForApproval" method in core/components/quip/index.class.php. Adding the JS status message completes the experience.
However, I've just thought that you could probably get away with a plugin OnManagerPageInit and pointing the email link at the dashboard or just the main users list page. In this case you wouldn't have to worry about checking the Active checkbox on the user form after you'd actioned this in your plugin, you'd just have the status message.
For reference, this is the sort of code you could use in the plugin, although obviously it's just an example of the logic:
if($modx->event->name === 'OnManagerPageInit') {
if(isset($_GET['activateuser'])) {
$TheUser = $modx->getObject('modUser',$_GET['activateuser']);
if($TheUser && !$TheUser->get('active')) {
$TheUser->set('active',1);
if($TheUser->save()) {
$Title = 'Hooray! Get a cup of tea!';
$Message = "Your message or your lexicon call";
}
else {
$Title = 'This alert is bad news!';
$Message = 'Uh oh! There was a bit of a problem activating the user!';
}
$modx->regClientStartupHTMLBlock('<script type="text/javascript">
Ext.onReady(function() {
MODx.msg.status({
title: "'.$Title.'"
,message: "'.$Message.'"
,delay: 10
});
});
</script>');
}
}
}