AnonymousUser.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 
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, $passwordHash) {
61  return false;
62  }
63 
64  /**
65  * @see User::setConfig()
66  */
67  public function setConfig($config) {
68  $this->_config = $config;
69  }
70 
71  /**
72  * @see User::getConfig()
73  */
74  public function getConfig() {
75  return $this->_config;
76  }
77 
78  /**
79  * @see User::hasRole()
80  */
81  public function hasRole($rolename) {
82  return $rolename == self::USER_GROUP_NAME;
83  }
84 
85  /**
86  * @see User::getRoles()
87  */
88  public function getRoles() {
89  return array(self::USER_GROUP_NAME);
90  }
91 }
92 ?>
User is the interface for users.
Definition: User.php:18