Skip to content

Instantly share code, notes, and snippets.

@Fi1osof
Created January 17, 2013 14:27
Show Gist options
  • Save Fi1osof/4556274 to your computer and use it in GitHub Desktop.
Save Fi1osof/4556274 to your computer and use it in GitHub Desktop.
<?
$rt = false; /* $rt will be an array if the event fires */
if ($mgrEvents) {
$rt = $modx->invokeEvent("OnBeforeManagerLogin", $onBeforeLoginParams);
} else {
$rt = $modx->invokeEvent("OnBeforeWebLogin", $onBeforeLoginParams);
}
/* If the event fired, loop through the event array and fail if there's an error message */
if (is_array($rt)) {
foreach ($rt as $key => $value) { /* php4 compatible */
if ($value !== true) {
return $modx->error->failure($value);
}
}
unset($key,$value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment