diff options
author | xue <> | 2005-11-20 14:15:37 +0000 |
---|---|---|
committer | xue <> | 2005-11-20 14:15:37 +0000 |
commit | 4767317d3dcc4316609154287b643eb85afbd9e2 (patch) | |
tree | e55e155801713fd6bc0a010c0ab3eeb0374fa7cd /framework/core.php | |
parent | 0ba28834e1f3be042ab669b8336e03f70319e4a7 (diff) |
Diffstat (limited to 'framework/core.php')
-rw-r--r-- | framework/core.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/framework/core.php b/framework/core.php index efaf7f86..2a4ddcbb 100644 --- a/framework/core.php +++ b/framework/core.php @@ -232,6 +232,58 @@ interface ITemplate }
/**
+ * IUser interface.
+ *
+ * This interface must be implemented by user objects.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @version $Revision: $ $Date: $
+ * @package System
+ * @since 3.0
+ */
+interface IUser
+{
+ /**
+ * @return string username
+ */
+ public function getName();
+ /**
+ * @param string username
+ */
+ public function setName($value);
+ /**
+ * @return boolean if the user is a guest
+ */
+ public function getIsGuest();
+ /**
+ * @param boolean if the user is a guest
+ */
+ public function setIsGuest($value);
+ /**
+ * @return array list of roles that the user is of
+ */
+ public function getRoles();
+ /**
+ * @return array|string list of roles that the user is of. If it is a string, roles are assumed by separated by comma
+ */
+ public function setRoles($value);
+ /**
+ * @param string role to be tested
+ * @return boolean whether the user is of this role
+ */
+ public function isInRole($role);
+ /**
+ * @return string user data that is serialized and will be stored in session
+ */
+ public function saveToString();
+ /**
+ * @param string user data that is serialized and restored from session
+ * @return IUser the user object
+ */
+ public function loadFromString($string);
+}
+
+/**
* PradoBase class.
*
* PradoBase implements a few fundamental static methods.
|