Skip to content

Instantly share code, notes, and snippets.

@Mark-H
Created August 20, 2014 22:24
Show Gist options
  • Save Mark-H/c66bf4afaa820b2db326 to your computer and use it in GitHub Desktop.
Save Mark-H/c66bf4afaa820b2db326 to your computer and use it in GitHub Desktop.
Auto Login Plugin for MODX Demo Sites. Add to OnManagerLoginFormRender event.
<?php
if ($modx->getOption('http_host') == 'YOUR_DOMAIN_HERE') {
$op = '<script type="text/javascript">
Ext.onReady(function() {
document.getElementById("modx-login-username").value = "USER";
document.getElementById("modx-login-password").value = "PASS";
document.getElementById("modx-login-btn").click();
});
</script>';
$modx->event->output($op);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment