summaryrefslogtreecommitdiff
path: root/framework/Web/Security/TRoleProvider.php
blob: a83bfb0b4b4a254240d8d26c54b5778c6f636e7c (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
<?php
/**
 * TRoleProvider class.
 * Defines the contract that PRADO implements to provide role-management services using custom role providers. 
 *
 * @author Jason Ragsdale <jrags@jasrags.net>
 * @version $Id: TRoleProvider.php 1398 2006-09-08 19:31:03Z xue $
 * @package System.Web.Security
 * @since 3.1
 */
Prado::using('System.Configuration.Provider.TProviderBase');
abstract class TRoleProvider extends TProviderBase 
{
	private $_cacheRolesInCookie=false;
    private $_cookieName="PRADO";
    private $_cookieTimeout="30";
    private $_cookiePath="/";
    private $_cookieRequireSSL=false;
    private $_cookieSlidingExpiration=true;
	
	public function getCacheRolesInCookie()
	{
		return $this->_cacheRolesInCookie;
	}
	public function setCacheRolesInCookie($value)
	{
		$this->_cacheRolesInCookie = TPropertyValue::ensureBoolean($value);
	}
	public function getCookieName()
	{
		return $this->_cookieName;
	}
	public function setCookieName($value)
	{
		$this->_cookieName = TPropertyValue::ensureString($value);
	}
	public function getCookiePath()
	{
		return $this->_cookiePath;
	}
	public function setCookiePath($value)
	{
		$this->_cookiePath = TPropertyValue::ensureString($value);
	}
	public function getCookieRequireSSL()
	{
		return $this->_cookieRequireSSL;
	}
	public function setCookieRequireSSL($value)
	{
		$this->_cookieRequireSSL = TPropertyValue::ensureBoolean($value);
	}
	public function getCookieSlidingExpiration()
	{
		return $this->_cookieSlidingExpiration;
	}
	public function setCookieSlidingExpiration($value)
	{
		$this->_cookieSlidingExpiration = TPropertyValue::ensureBoolean($value);
	}
	public function getCookieTimeout()
	{
		return $this->_cookieTimeout;
	}
	public function setCookieTimeout($value)
	{
		$this->_cookieTimeout = TPropertyValue::ensureInteger($value);
	}
	
	
	public function __construct()
	{
		
	}
	public abstract function addUsersToRoles($usernames,$roleNames);
	public abstract function createRole($roleName);
	public abstract function deleteRole($roleName);
	public abstract function findUsersInRole($roleName,$usernameToMatch);
	public abstract function getAllRoles();
	public abstract function getRolesForUser($username);
	public abstract function getUsersIsRole($username,$roleName);
	public abstract function isUserIsRole($username,$roleName);
	public abstract function removeUsersFromRoles($usernames,$roleNames);
	public abstract function roleExists($roleName);
}
?>