User.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 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 the given password against the password of the user.
55  * @param $password The plaintext password to verify
56  * @return Boolean.
57  */
58  public function verifyPassword($password);
59 
60  /**
61  * Set if the user is active.
62  * @param $isActive Boolean whether the user is active or not
63  */
64  public function setIsActive($isActive);
65 
66  /**
67  * Check if the user is active.
68  * @return Boolean.
69  */
70  public function isActive();
71 
72  /**
73  * Set if the user is super user (can't be inactive).
74  * @param $isSuperUser Boolean whether the user is super user or not
75  */
76  public function setIsSuperUser($isSuperUser);
77 
78  /**
79  * Check if the user is super user (can't be inactive).
80  * @return Boolean
81  */
82  public function isSuperUser();
83 
84  /**
85  * Set the configuration file of the user.
86  * @param $config The configuration file of the user.
87  */
88  public function setConfig($config);
89 
90  /**
91  * Get the configuration file of the user.
92  * @return The configuration file of the user.
93  */
94  public function getConfig();
95 
96  /**
97  * Check for a certain role in the user roles.
98  * @param $roleName The role name to check for. e.g. "administrators"
99  * @return Boolean whether the user has the role
100  */
101  public function hasRole($roleName);
102 
103  /**
104  * Get the roles of a user.
105  * @return Array of role names
106  */
107  public function getRoles();
108 }
109 ?>
getRoles()
Get the roles of a user.
getPassword()
Get the password of the user.
setIsActive($isActive)
Set if the user is active.
setConfig($config)
Set the configuration file of the user.
isActive()
Check if the user is active.
setLogin($login)
Set the login of the user.
verifyPassword($password)
Verify the given password against the password of the user.
setPassword($password)
Set the password of the user.
hasRole($roleName)
Check for a certain role in the user roles.
isSuperUser()
Check if the user is super user (can't be inactive).
getLogin()
Get the login of the user.
getOID()
Get the object id of the user.
setIsSuperUser($isSuperUser)
Set if the user is super user (can't be inactive).
getConfig()
Get the configuration file of the user.
User is the interface for users.
Definition: User.php:18