User.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2015 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
12 
13 /**
14  * User is the interface for users.
15  *
16  * @author ingo herwig <ingo@wemove.com>
17  */
18 interface User {
19 
20  /**
21  * Get the object id of the user.
22  * @return ObjectId
23  */
24  public function getOID();
25 
26  /**
27  * Set the login of the user.
28  * @param $login The login of the user.
29  */
30  public function setLogin($login);
31 
32  /**
33  * Get the login of the user.
34  * @return The login of the user.
35  */
36  public function getLogin();
37 
38  /**
39  * Set the password of the user. Implementations of User must
40  * hash the password before persisting it.
41  * @param $password The plaintext password of the user.
42  */
43  public function setPassword($password);
44 
45  /**
46  * Get the password of the user. The result is expected to
47  * be hashed, if the user was persisted already. If not
48  * persisted, the result may be the plaintext password.
49  * @return The password of the user,
50  */
51  public function getPassword();
52 
53  /**
54  * Verify a password.
55  * @param $password The plaintext password to verify
56  * @param $passwordHash The password hash to match
57  * @return Boolean.
58  */
59  public function verifyPassword($password, $passwordHash);
60 
61  /**
62  * Set the configuration file of the user.
63  * @param $config The configuration file of the user.
64  */
65  public function setConfig($config);
66 
67  /**
68  * Get the configuration file of the user.
69  * @return The configuration file of the user.
70  */
71  public function getConfig();
72 
73  /**
74  * Check for a certain role in the user roles.
75  * @param $roleName The role name to check for. e.g. "administrators"
76  * @return Boolean whether the user has the role
77  */
78  public function hasRole($roleName);
79 
80  /**
81  * Get the roles of a user.
82  * @return Array of role names
83  */
84  public function getRoles();
85 }
86 ?>
getRoles()
Get the roles of a user.
setLogin($login)
Set the login of the user.
setConfig($config)
Set the configuration file of the user.
getConfig()
Get the configuration file of the user.
User is the interface for users.
Definition: User.php:18
getPassword()
Get the password of the user.
verifyPassword($password, $passwordHash)
Verify a password.
setPassword($password)
Set the password of the user.
hasRole($roleName)
Check for a certain role in the user roles.
getOID()
Get the object id of the user.
getLogin()
Get the login of the user.