For the Captcha component, I need a url to captcha.php -- which stores the $_SESSION variable and returns the generated image.
In my current organization, it resides in MODX_BASE_PATH. ’assets/captcha/core/processors/captcha.php’
I expect to have the captcha namespace path set to MODX_BASE_PATH. ’assets/captcha/’
In the existing code, where captcha is part of the core, the results look like this:
$captcha_image= '<a href="'.$_SERVER['PHP_SELF'].'" class="loginCaptcha"><img src="'.$modx->config['connectors_url'].'security/captcha.php?rand='.rand().'" alt="'.$alt.'" /></a>';
I’m thinking it should be
$namespace = $modx->getObject('modNamespace','captcha');
$namespacePath = $namespace->get('path');
$captcha_image= '<a href="'.$_SERVER['PHP_SELF'].'" class="loginCaptcha"><img src="'.$modx->config['base_url'].$namespacePath.'core/processors/captcha.php?rand='.rand().'" alt="'.$alt.'" /></a>';
but thought I’d better check.