gglnx/auth

此包已被 废弃 且不再维护。未建议替代包。

PHP 5.3+ 简单身份验证类

1.0.3 2012-08-11 17:41 UTC

This package is auto-updated.

Last update: 2021-10-22 17:52:43 UTC


README

基于 cookie 的 PHP 5.3+ 简单身份验证类。还包含基于 phpass (http://www.openwall.com/phpass/) 0.3 的密码散列类。

使用 Auth

检查用户是否已登录

如果当前会话有效,则返回 User 模型对象。

$user = Auth\Session::check(function($user, $md5) {
	$user = User::findOne()->is('username', $user)->select();
	return array('username' => $user->username, 'password' => $user->password, 'object' => $user);
});