AnonymousUser.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 
14 
15 /**
16  * Anonymous user
17  *
18  * @author ingo herwig <ingo@wemove.com>
19  */
20 class AnonymousUser implements User {
21 
22  const USER_GROUP_NAME = 'anonymous';
23 
24  private $config = null;
25 
26  /**
27  * @see User::getOID()
28  */
29  public function getOID() {
30  return null;
31  }
32 
33  /**
34  * @see User::setLogin()
35  */
36  public function setLogin($login) {}
37 
38  /**
39  * @see User::getLogin()
40  */
41  public function getLogin() {
42  return self::USER_GROUP_NAME;
43  }
44 
45  /**
46  * @see User::setPassword()
47  */
48  public function setPassword($password) {}
49 
50  /**
51  * @see User::getPassword()
52  */
53  public function getPassword() {
54  return null;
55  }
56 
57  /**
58  * @see User::verifyPassword()
59  */
60  public function verifyPassword($password) {
61  return false;
62  }
63 
64  /**
65  * @see User::setIsActive()
66  */
67  public function setIsActive($isActive) {}
68 
69  /**
70  * @see User::isActive()
71  */
72  public function isActive() {
73  return true;
74  }
75 
76  /**
77  * @see User::setIsSuperUser()
78  */
79  public function setIsSuperUser($isSuperUser) {}
80 
81  /**
82  * @see User::isSuperUser()
83  */
84  public function isSuperUser() {
85  return false;
86  }
87 
88  /**
89  * @see User::setConfig()
90  */
91  public function setConfig($config) {
92  $this->config = $config;
93  }
94 
95  /**
96  * @see User::getConfig()
97  */
98  public function getConfig() {
99  return $this->config;
100  }
101 
102  /**
103  * @see User::hasRole()
104  */
105  public function hasRole($rolename) {
106  return $rolename == self::USER_GROUP_NAME;
107  }
108 
109  /**
110  * @see User::getRoles()
111  */
112  public function getRoles() {
113  return [self::USER_GROUP_NAME];
114  }
115 }
116 ?>
User is the interface for users.
Definition: User.php:18