diff options
Diffstat (limited to 'demos/blog/protected/Common/BlogUser.php')
-rw-r--r-- | demos/blog/protected/Common/BlogUser.php | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/demos/blog/protected/Common/BlogUser.php b/demos/blog/protected/Common/BlogUser.php index 865d7659..08418965 100644 --- a/demos/blog/protected/Common/BlogUser.php +++ b/demos/blog/protected/Common/BlogUser.php @@ -1,60 +1,60 @@ -<?php
-/**
- * BlogUser 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 $Id$
- */
-
-Prado::using('System.Security.TUser');
-
-/**
- * BlogUser class
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @link http://www.pradosoft.com/
- * @copyright Copyright © 2006 PradoSoft
- * @license http://www.pradosoft.com/license/
- */
-class BlogUser extends TUser
-{
- private $_id;
-
- public function getID()
- {
- return $this->_id;
- }
-
- public function setID($value)
- {
- $this->_id=$value;
- }
-
- public function getIsAdmin()
- {
- return $this->isInRole('admin');
- }
-
- public function saveToString()
- {
- $a=array($this->_id,parent::saveToString());
- return serialize($a);
- }
-
- public function loadFromString($data)
- {
- if(!empty($data))
- {
- list($id,$str)=unserialize($data);
- $this->_id=$id;
- return parent::loadFromString($str);
- }
- else
- return $this;
- }
-}
-
+<?php +/** + * BlogUser 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 $Id$ + */ + +Prado::using('System.Security.TUser'); + +/** + * BlogUser class + * + * @author Qiang Xue <qiang.xue@gmail.com> + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2006 PradoSoft + * @license http://www.pradosoft.com/license/ + */ +class BlogUser extends TUser +{ + private $_id; + + public function getID() + { + return $this->_id; + } + + public function setID($value) + { + $this->_id=$value; + } + + public function getIsAdmin() + { + return $this->isInRole('admin'); + } + + public function saveToString() + { + $a=array($this->_id,parent::saveToString()); + return serialize($a); + } + + public function loadFromString($data) + { + if(!empty($data)) + { + list($id,$str)=unserialize($data); + $this->_id=$id; + return parent::loadFromString($str); + } + else + return $this; + } +} + ?>
\ No newline at end of file |