summaryrefslogtreecommitdiff
path: root/framework/Web/Security/TRoles.php
blob: 45e112c7f35074628b8d130dce6eabb1e67478c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<?php
final class TRoles
{
	private static $_ApplicationName;
	private static $_CacheRolesInCookie=false;
	private static $_CookieName;
	private static $_CookiePath;
	private static $_CookieProtectionValue;
	private static $_CookieRequireSSL=false;
	private static $_CookieSlidingExpiration=false;
	private static $_CookieTimeout;
	private static $_CreatePersistentCookie=false;
	private static $_Domain;
	private static $_Enabled=false;
	private static $_MaxCachedResults;
	private static $_Provider;
	private static $_Providers;
	private static $_s_EnabledSet=false;
	private static $_s_Initialized=false;
	private static $_s_InitializeException;
	private static $_s_lock;

	public static function getApplicationName()
	{
		return self::$_ApplicationName;
	}
	public static function setApplicationName($value)
	{
		self::$_ApplicationName = TPropertyValue::ensureString($value);
	}
	public static function getCacheRolesInCookie()
	{
		return self::$_CacheRolesInCookie;
	}
	public static function getCookieName()
	{
		return self::$_CookieName;
	}
	public static function getCookiePath()
	{
		return self::$_CookiePath;
	}
	public static function getCookieProtectionValue()
	{
		return self::$_CookieProtectionValue;
	}
	public static function getCookieRequireSSL()
	{
		return self::$_CookieRequireSSL;
	}
	public static function getCookieSlidingExpiration()
	{
		return self::$_CookieSlidingExpiration;
	}
	public static function getCookieTimeout()
	{
		return self::$_CookieTimeout;
	}
	public static function getCreatePersistentCookie()
	{
		return self::$_CreatePersistentCookie;
	}
	public static function getDomain()
	{
		return self::$_Domain;
	}
	public static function getEnabled()
	{
		return self::$_Enabled;
	}
	public static function getMaxCachedResults()
	{
		return self::$_MaxCachedResults;
	}
	public static function getProvider()
	{
		return self::$_Provider;
	}
	public static function getProviders()
	{
		return self::$_Providers;
	}

	public static function AddUsersToRole($usernames,$roleName)
	{

	}
	public static function AddUsersToRoles($usernames,$roleNames)
	{

	}
	public static function AddUserToRole($username,$roleName)
	{

	}
	public static function AddUserToRoles($username,$roleNames)
	{

	}
	public static function CreateRole($roleName)
	{
		self::EnsureEnabled();
		self::$_Provider->CreateRole($roleName);
	}
	public static function DeleteCookie()
	{

	}
	public static function DeleteRole($roleName,$throwOnPopulatedRole=true)
	{
		self::EnsureEnabled();

		//		$flag1 = self::$_Provider->DeleteRole($roleName,$throwOnPopulatedRole);
		//		try
		//		{
		//			$principal1 = self::GetCurrentUser();
		//		}
		//		catch ()
		//		{
		//
		//		}

	}
	private static function EnsureEnabled()
	{
		self::Initialize();
		if (!self::$_s_Initialized)
		{
			throw new TException('Roles_feature_not_enabled');
		}
	}
	public static function FindUsersInRole($roleName,$usernameToMatch)
	{

	}
	public static function GetAllRoles()
	{

	}
	private static function GetCurrentUser()
	{

	}
	private static function GetCurrentUserName()
	{

	}
	public static function GetRolesForUser($username=null)
	{

	}
	public static function GetUsersInRole($roleName)
	{

	}
	private static function Initialize()
	{
		if (self::$_s_Initialized)
		{
			if (self::$_s_InitializeException!==null)
			{
				throw new $_s_InitializeException;
			}
		}
		else
		{
			if (self::$_s_Initialized)
			{
				if (self::$_s_InitializeException!==null)
				{
					throw new $_s_InitializeException;
				}
				return;
			}
			try 
			{
				self::$_Enabled;
				self::$_CookieName;
				self::$_CookiePath;
				self::$_CacheRolesInCookie;
				self::$_CookieTimeout;
				self::$_CookiePath;
				self::$_CookieRequireSSL;
				self::$_CookieSlidingExpiration;
				self::$_CookieProtectionValue;
				self::$_Domain;
				self::$_CreatePersistentCookie;
				self::$_MaxCachedResults;
				if (self::$_Enabled)
				{
					if (self::$_MaxCachedResults < 0)
					{
						throw new TException('Value_must_be_non_negative_integer',self::$_MaxCachedResults);
					}////stopped here
				}
			}
			catch (TException $e)
			{
				
			}
		}
	}
	public static function IsUserInRole($roleName,$username=null)
	{

	}
	public static function RemoveUserFromRole($username,$roleName)
	{

	}
	public static function RemoreUserFromRoles($username,$roleNames)
	{

	}
	public static function RemoveUsersFromRole($usernames,$roleName)
	{

	}
	public static function RemoveUsersFromRoles($usernames,$roleNames)
	{

	}
	public static function RoleExists($roleName)
	{

	}
}
?>