mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-30 00:09:10 -04:00
Add user::lookup_by_name()
This commit is contained in:
@@ -281,6 +281,19 @@ class user_Core {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Look up a user by id.
|
||||
* @param integer $id the user id
|
||||
* @return User_Model the user object, or null if the id was invalid.
|
||||
*/
|
||||
static function lookup_by_name($name) {
|
||||
$user = model_cache::get("user", $name, "name");
|
||||
if ($user->loaded) {
|
||||
return $user;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a hashed password using md5 plus salt.
|
||||
* @param string $password plaintext password
|
||||
|
||||
Reference in New Issue
Block a user