diff options
author | xue <> | 2006-05-30 03:26:33 +0000 |
---|---|---|
committer | xue <> | 2006-05-30 03:26:33 +0000 |
commit | 6e0338629774fffe5fbe7136dfce34ce83844a5c (patch) | |
tree | 9520eaa7c3c278b5ebf525a0d1e09f0a4cdf7779 /demos/blog/protected/Common/BlogUserManager.php | |
parent | 7f508e187e4539a16cdbb1dd6a4b1133c53cf24d (diff) |
Blog demo is completed.
Diffstat (limited to 'demos/blog/protected/Common/BlogUserManager.php')
-rw-r--r-- | demos/blog/protected/Common/BlogUserManager.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/demos/blog/protected/Common/BlogUserManager.php b/demos/blog/protected/Common/BlogUserManager.php index c3ddb80b..3a7f4789 100644 --- a/demos/blog/protected/Common/BlogUserManager.php +++ b/demos/blog/protected/Common/BlogUserManager.php @@ -1,8 +1,25 @@ <?php
+/**
+ * BlogUserManager class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Revision: $ $Date: $
+ */
Prado::using('System.Security.IUserManager');
Prado::using('Application.Common.BlogUser');
+/**
+ * BlogUserManager class
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ */
class BlogUserManager extends TModule implements IUserManager
{
public function getGuestName()
@@ -29,7 +46,7 @@ class BlogUserManager extends TModule implements IUserManager $user->setID($userRecord->ID);
$user->setName($username);
$user->setIsGuest(false);
- $user->setRoles($userRecord->Role===0?'user':'admin');
+ $user->setRoles($userRecord->Role===UserRecord::ROLE_USER?'user':'admin');
return $user;
}
else
@@ -47,7 +64,7 @@ class BlogUserManager extends TModule implements IUserManager {
$db=$this->Application->getModule('data');
if(($userRecord=$db->queryUserByName($username))!==null)
- return $userRecord->Password===md5($password);
+ return $userRecord->Password===md5($password) && $userRecord->Status===UserRecord::STATUS_NORMAL;
else
return false;
}
|