In theory, you can use Captcha anywhere.
The Captcha code will produce an image and write the correct answer to a $_SESSION variable:
<?php
/* CaptchaImage snippet code */
$captchaImage = <a href="'.$_SERVER['PHP_SELF'].'" class="loginCaptcha"><img src="'.$modx->getOption('site_url').'assets/components/captcha/captcha.php?rand='.rand().'" alt="'.$alt.'" /></a>
The output is controlled by the System Settings in the captcha namespace, most of which can (IIRC) be overridden by properties in the snippet tag.
Then, in the snippet or hook that processes the submission, something like this (untested):
$rt = true;
$modx->lexicon->load('captcha:default');
if ($modx->getOption('captcha.enabled',null,true)) {
if (!isset ($_SESSION['veriword'])) {
$rt = false;
$modx->setPlaceholder('error', '$_SESSION Variable not set');
} else if ($_SESSION['veriword'] != $_POST['captcha_code']) {
$rt = false;
if ($modx->getOption('captcha.use_mathstring',null,true)) {
$modx->setPlaceholder('error', $modx->lexicon('login_mathstring_error'));
} else {
$modx->setPlaceholder('error', $modx->lexicon('login_captcha_error'));
}
}
}
return $rt;