Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * IUserManager interface file
4
 *
5
 * @author Qiang Xue <qiang.xue@gmail.com>
6
 * @link http://www.pradosoft.com/
7
 * @copyright Copyright &copy; 2005-2008 PradoSoft
8
 * @license http://www.pradosoft.com/license/
9
 * @version $Id: IUserManager.php 2541 2008-10-21 15:05:13Z qiang.xue $
10
 * @package System.Security
11
 */
12
 
13
/**
14
 * IUserManager interface
15
 *
16
 * IUserManager specifies the interface that must be implemented by
17
 * a user manager class if it is to be used together with {@link TAuthManager}
18
 * and {@link TUser}.
19
 *
20
 * @author Qiang Xue <qiang.xue@gmail.com>
21
 * @version $Id: IUserManager.php 2541 2008-10-21 15:05:13Z qiang.xue $
22
 * @package System.Security
23
 * @since 3.0
24
 */
25
interface IUserManager
26
{
27
	/**
28
	 * @return string name for a guest user.
29
	 */
30
	public function getGuestName();
31
	/**
32
	 * Returns a user instance given the user name.
33
	 * @param string user name, null if it is a guest.
34
	 * @return TUser the user instance, null if the specified username is not in the user database.
35
	 */
36
	public function getUser($username=null);
37
	/**
38
	 * Returns a user instance according to auth data stored in a cookie.
39
	 * @param THttpCookie the cookie storing user authentication information
40
	 * @return TUser the user instance generated based on the cookie auth data, null if the cookie does not have valid auth data.
41
	 * @since 3.1.1
42
	 */
43
	public function getUserFromCookie($cookie);
44
	/**
45
	 * Saves user auth data into a cookie.
46
	 * @param THttpCookie the cookie to receive the user auth data.
47
	 * @since 3.1.1
48
	 */
49
	public function saveUserToCookie($cookie);
50
	/**
51
	 * Validates if the username and password are correct.
52
	 * @param string user name
53
	 * @param string password
54
	 * @return boolean true if validation is successful, false otherwise.
55
	 */
56
	public function validateUser($username,$password);
57
}
58