Auto Append Domain

From Michael's Information Zone
Revision as of 15:30, 9 April 2019 by Michael.mast (talk | contribs) (Created page with "==Purpose== To allow people to log in with simple first.last names without having to add domain information. <br> <br> In this case I was using a plugin for kerberos based aut...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Purpose

To allow people to log in with simple first.last names without having to add domain information.

In this case I was using a plugin for kerberos based authentication. If that failed, I needed users to log in with their standard user names. To do this I needed Wordpress to add the domain to the user name and use it as their "email address".

  • In wp-login.php, add the following lines before

/**
* Output the login page header.

if (isset($_POST['log'])) {
$testinput = $_POST['log'];
if (!preg_match('/@/', $testinput)) {
$_POST['log'] .= '@domain.tld';
}
}