TYPO3 CMS  TYPO3_7-6
BackendUser.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
23 {
28  protected $userName = '';
29 
33  protected $description = '';
34 
38  protected $isAdministrator = false;
39 
43  protected $isDisabled = false;
44 
48  protected $startDateAndTime = null;
49 
53  protected $endDateAndTime = null;
54 
58  protected $email = '';
59 
63  protected $realName = '';
64 
69 
73  protected $ipLockIsDisabled = false;
74 
80  public function getUserName()
81  {
82  return $this->userName;
83  }
84 
91  public function setUserName($userName)
92  {
93  $this->userName = $userName;
94  }
95 
99  public function getDescription()
100  {
101  return $this->description;
102  }
103 
107  public function setDescription($description)
108  {
109  $this->description = $description;
110  }
111 
117  public function getIsAdministrator()
118  {
119  return $this->isAdministrator;
120  }
121 
129  {
130  $this->isAdministrator = $isAdministrator;
131  }
132 
138  public function getIsDisabled()
139  {
140  return $this->isDisabled;
141  }
142 
149  public function setIsDisabled($isDisabled)
150  {
151  $this->isDisabled = $isDisabled;
152  }
153 
159  public function getStartDateAndTime()
160  {
162  }
163 
170  public function setStartDateAndTime(\DateTime $dateAndTime = null)
171  {
172  $this->startDateAndTime = $dateAndTime;
173  }
174 
180  public function getEndDateAndTime()
181  {
182  return $this->endDateAndTime;
183  }
184 
191  public function setEndDateAndTime(\DateTime $dateAndTime = null)
192  {
193  $this->endDateAndTime = $dateAndTime;
194  }
195 
201  public function getEmail()
202  {
203  return $this->email;
204  }
205 
212  public function setEmail($email)
213  {
214  $this->email = $email;
215  }
216 
222  public function getRealName()
223  {
224  return $this->realName;
225  }
226 
232  public function setRealName($name)
233  {
234  $this->realName = $name;
235  }
236 
244  public function isActivated()
245  {
246  return !$this->getIsDisabled() && $this->isActivatedViaStartDateAndTime() && $this->isActivatedViaEndDateAndTime();
247  }
248 
254  protected function isActivatedViaStartDateAndTime()
255  {
256  if ($this->getStartDateAndTime() === null) {
257  return true;
258  }
259  $now = new \DateTime('now');
260  return $this->getStartDateAndTime() <= $now;
261  }
262 
268  protected function isActivatedViaEndDateAndTime()
269  {
270  if ($this->getEndDateAndTime() === null) {
271  return true;
272  }
273  $now = new \DateTime('now');
274  return $now <= $this->getEndDateAndTime();
275  }
276 
283  public function setIpLockIsDisabled($disableIpLock)
284  {
285  $this->ipLockIsDisabled = $disableIpLock;
286  }
287 
293  public function getIpLockIsDisabled()
294  {
296  }
297 
303  public function getLastLoginDateAndTime()
304  {
306  }
307 
314  public function setLastLoginDateAndTime(\DateTime $dateAndTime = null)
315  {
316  $this->lastLoginDateAndTime = $dateAndTime;
317  }
318 }
setLastLoginDateAndTime(\DateTime $dateAndTime=null)
setStartDateAndTime(\DateTime $dateAndTime=null)
setEndDateAndTime(\DateTime $dateAndTime=null)