gglnx / auth
Simple auth class for PHP 5.3+
Installs: 2 227
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2021-10-22 17:52:43 UTC
README
Simple auth class for PHP 5.3+ based on cookies. Also included a password hash class based on phpass (http://www.openwall.com/phpass/) 0.3.
Using Auth
Checking if a user is currently logged in
If the current session is valid you get the User model object as return value.
$user = Auth\Session::check(function($user, $md5) { $user = User::findOne()->is('username', $user)->select(); return array('username' => $user->username, 'password' => $user->password, 'object' => $user); });