1: <?php
2: /**
3: *
4: * @package XCube
5: * @version $Id: XCube_Identity.class.php,v 1.3 2008/10/12 04:30:27 minahito Exp $
6: * @copyright Copyright 2005-2007 XOOPS Cube Project <https://github.com/xoopscube/legacy>
7: * @license https://github.com/xoopscube/legacy/blob/master/docs/bsd_licenses.txt Modified BSD license
8: *
9: */
10:
11: /**
12: * Defines the basic functionality of an identity object.
13: */
14: class XCube_Identity
15: {
16: /**
17: * A name of the identity.
18: * @var string
19: */
20: var $mName = "";
21:
22: /**
23: * The authentication type
24: * @var string
25: */
26: var $_mAuthenticationType = "";
27:
28: function XCube_Identity()
29: {
30: }
31:
32: /**
33: * Sets the authentication type.
34: * @param string $type
35: */
36: function setAuthenticationType($type)
37: {
38: $this->_mAuthenticationType = $type;
39: }
40:
41: /**
42: * Gets the authentication type.
43: * @return string
44: */
45: function getAuthenticationType()
46: {
47: return $this->_mAuthenticationType;
48: }
49:
50: /**
51: * Sets a name of this object.
52: */
53: function setName($name)
54: {
55: $this->mName = $name;
56: }
57:
58: /**
59: * Gets a name of this object.
60: *
61: * @return string
62: */
63: function getName()
64: {
65: return $this->mName;
66: }
67:
68: /**
69: * Gets a value that indicates whether the user has been authenticated.
70: *
71: * @return bool
72: */
73: function isAuthenticated()
74: {
75: }
76: }
77:
78: /**
79: * Defines the basic functionality of a principal object.
80: */
81: class XCube_Principal
82: {
83: /**
84: * The identity object which is tied to this object.
85: */
86: var $mIdentity = null;
87:
88: /**
89: * Roles in this object.
90: * @var string[]
91: */
92: var $_mRoles = array();
93:
94: function XCube_Principal($identity, $roles = array())
95: {
96: $this->mIdentity =& $identity;
97: $this->_mRoles = $roles;
98: }
99:
100: /**
101: * Gets a identity object which is tied to this object.
102: * @return XCube_Identity
103: */
104: function getIdentity()
105: {
106: return $this->mIdentity;
107: }
108:
109: /**
110: * Gets a value that indicates whether this principal has a role specified by $rolename.
111: *
112: * @var string $rolename
113: * @return bool
114: */
115: function isInRole($rolename)
116: {
117: }
118: }
119:
120:
121:
122:
123: ?>