-
- 7 Posts
Is it possible for a prehook to automatically log in a specific user (either by username/password or simply by ID) IF their IP is within an array of IPs? Otherwise, just continue with the login form as is.
<?php
$ips = array('123.456.78.90','123.456.78.91');
if(in_array($_SERVER['REMOTE_ADDR'], $ips)) {
// Login user ID #2
} else {
// show login form to allow manual login
}
?>
44+ MODXed sites and counting...