Skip to content

Instantly share code, notes, and snippets.

@andrewwatson
Forked from caleywoods/User.php
Created February 17, 2012 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewwatson/1854021 to your computer and use it in GitHub Desktop.
Save andrewwatson/1854021 to your computer and use it in GitHub Desktop.
// models/User.php
/**
* Check if the user used the domain prefix
* to login. If they did pass param through
* unchanged. If they didn't, prepend it and
* return it.
* @param string $username
* @return string
*/
protected function checkUsername(string $username)
{
if (!substr($username, 0, 4) == "DOM\\")
{
$username = "DOM\\" . $username
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment