‪TYPO3CMS  10.4
BackendUser.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 
26 {
33  protected ‪$allowedLanguages = '';
34 
38  protected ‪$dbMountPoints = '';
39 
43  protected ‪$description;
44 
48  protected ‪$fileMountPoints = '';
49 
54 
59  {
60  $this->allowedLanguages = ‪$allowedLanguages;
61  }
62 
66  public function ‪getAllowedLanguages()
67  {
69  }
70 
74  public function ‪setDbMountPoints(‪$dbMountPoints)
75  {
76  $this->dbMountPoints = ‪$dbMountPoints;
77  }
78 
82  public function ‪getDbMountPoints()
83  {
85  }
86 
91  {
92  $this->fileMountPoints = ‪$fileMountPoints;
93  }
94 
98  public function ‪getFileMountPoints()
99  {
101  }
102 
108  public function ‪isActive()
109  {
110  if ($this->‪getIsDisabled()) {
111  return false;
112  }
113  $now = new \DateTime('now');
114  return !$this->‪getStartDateAndTime() && !$this->‪getEndDateAndTime() || $this->‪getStartDateAndTime() <= $now && (!$this->‪getEndDateAndTime() || $this->‪getEndDateAndTime() > $now);
115  }
116 
121  {
122  $this->backendUserGroups = ‪$backendUserGroups;
123  }
124 
128  public function ‪getBackendUserGroups()
129  {
131  }
132 
138  public function ‪isCurrentlyLoggedIn()
139  {
140  return $this->‪getUid() === (int)$this->‪getBackendUser()->user['uid'];
141  }
142 
148  public function ‪isPasswordResetEnabled(): bool
149  {
150  return !$this->‪isCurrentlyLoggedIn() && GeneralUtility::makeInstance(PasswordReset::class)->isEnabledForUser((int)$this->‪getUid());
151  }
152 
158  public function ‪getBackendUser()
159  {
160  return ‪$GLOBALS['BE_USER'];
161  }
162 }
‪TYPO3\CMS\Beuser\Domain\Model
Definition: BackendUser.php:16
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\setFileMountPoints
‪setFileMountPoints($fileMountPoints)
Definition: BackendUser.php:85
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\getBackendUser
‪TYPO3 CMS Core Authentication BackendUserAuthentication getBackendUser()
Definition: BackendUser.php:153
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\$description
‪string $description
Definition: BackendUser.php:40
‪TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\getUid
‪int null getUid()
Definition: AbstractDomainObject.php:67
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\$dbMountPoints
‪string $dbMountPoints
Definition: BackendUser.php:36
‪TYPO3\CMS\Backend\Authentication\PasswordReset
Definition: PasswordReset.php:58
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\getFileMountPoints
‪string getFileMountPoints()
Definition: BackendUser.php:93
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\isActive
‪bool isActive()
Definition: BackendUser.php:103
‪TYPO3\CMS\Extbase\Domain\Model\BackendUser\getEndDateAndTime
‪DateTime null getEndDateAndTime()
Definition: BackendUser.php:168
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\setBackendUserGroups
‪setBackendUserGroups($backendUserGroups)
Definition: BackendUser.php:115
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\$allowedLanguages
‪string $allowedLanguages
Definition: BackendUser.php:32
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\$fileMountPoints
‪string $fileMountPoints
Definition: BackendUser.php:44
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\$backendUserGroups
‪TYPO3 CMS Extbase Persistence ObjectStorage<\TYPO3\CMS\Beuser\Domain\Model\BackendUserGroup > $backendUserGroups
Definition: BackendUser.php:48
‪TYPO3\CMS\Extbase\Domain\Model\BackendUser\getIsDisabled
‪bool getIsDisabled()
Definition: BackendUser.php:128
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\isCurrentlyLoggedIn
‪bool isCurrentlyLoggedIn()
Definition: BackendUser.php:133
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\getDbMountPoints
‪string getDbMountPoints()
Definition: BackendUser.php:77
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\isPasswordResetEnabled
‪bool isPasswordResetEnabled()
Definition: BackendUser.php:143
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\setAllowedLanguages
‪setAllowedLanguages($allowedLanguages)
Definition: BackendUser.php:53
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\getAllowedLanguages
‪string getAllowedLanguages()
Definition: BackendUser.php:61
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\getBackendUserGroups
‪TYPO3 CMS Extbase Persistence ObjectStorage getBackendUserGroups()
Definition: BackendUser.php:123
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser
Definition: BackendUser.php:26
‪TYPO3\CMS\Beuser\Domain\Model\BackendUser\setDbMountPoints
‪setDbMountPoints($dbMountPoints)
Definition: BackendUser.php:69
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Extbase\Domain\Model\BackendUser
Definition: BackendUser.php:25
‪TYPO3\CMS\Extbase\Domain\Model\BackendUser\getStartDateAndTime
‪DateTime null getStartDateAndTime()
Definition: BackendUser.php:148