OnBeforeManagerLogin not working correctly?

According to docs on OnBeforeManagerLogin - System Events | MODX Documentation

setting output to false, should prevent manager login. Reproducing the same code on my site doesn’t prevent the login at all. The event fires correctly, tried logging inside it.

Running MODX Revolution 2.8.2-pl

Code sample I used:

$eventName = $modx->event->name;
switch($eventName) {
    case 'OnBeforeManagerLogin':
        $modx->event->_output = false;
        return;
    break;
}

Tried using

$modx->event->output(false);

as well, but the issue persisted.

I believe you have to return an error message to make it work. Something like

$modx->event->output('not allowed to log in');
//or
$modx->event->_output = 'not allowed to log in';

The code checks if the return value is empty().

That was it! Thank you!

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.