Skip to content

Commit dd63f0f

Browse files
committed
Version 6.0.4
1 parent 537433d commit dd63f0f

3 files changed

Lines changed: 38 additions & 35 deletions

File tree

Classes/Domain/Model/BackendUser.php

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
namespace Fixpunkt\Backendtools\Domain\Model;
1717

18+
use TYPO3\CMS\Backend\Authentication\PasswordReset;
1819
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
20+
use TYPO3\CMS\Core\Utility\GeneralUtility;
1921
use TYPO3\CMS\Extbase\Annotation as Extbase;
2022
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
2123
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
@@ -28,8 +30,8 @@ class BackendUser extends AbstractEntity
2830
{
2931
/**
3032
* @var string
33+
* @Extbase\Validate("NotEmpty")
3134
*/
32-
#[Extbase\Validate(['validator' => 'NotEmpty'])]
3335
protected $userName = '';
3436

3537
/**
@@ -98,7 +100,7 @@ class BackendUser extends AbstractEntity
98100
/**
99101
* @param string $allowedLanguages
100102
*/
101-
public function setAllowedLanguages($allowedLanguages): void
103+
public function setAllowedLanguages($allowedLanguages)
102104
{
103105
$this->allowedLanguages = $allowedLanguages;
104106
}
@@ -114,7 +116,7 @@ public function getAllowedLanguages()
114116
/**
115117
* @param string $dbMountPoints
116118
*/
117-
public function setDbMountPoints($dbMountPoints): void
119+
public function setDbMountPoints($dbMountPoints)
118120
{
119121
$this->dbMountPoints = $dbMountPoints;
120122
}
@@ -130,7 +132,7 @@ public function getDbMountPoints()
130132
/**
131133
* @param string $fileMountPoints
132134
*/
133-
public function setFileMountPoints($fileMountPoints): void
135+
public function setFileMountPoints($fileMountPoints)
134136
{
135137
$this->fileMountPoints = $fileMountPoints;
136138
}
@@ -160,7 +162,7 @@ public function isActive()
160162
/**
161163
* @param ObjectStorage<BackendUserGroup> $backendUserGroups
162164
*/
163-
public function setBackendUserGroups($backendUserGroups): void
165+
public function setBackendUserGroups($backendUserGroups)
164166
{
165167
$this->backendUserGroups = $backendUserGroups;
166168
}
@@ -183,6 +185,21 @@ public function isCurrentlyLoggedIn()
183185
return $this->getUid() === (int)($this->getBackendUser()->user['uid'] ?? 0);
184186
}
185187

188+
/**
189+
* Check if the user is allowed to trigger a password reset
190+
*
191+
* Requirements:
192+
* 1. The user for which the password reset should be triggered is not the currently logged in user
193+
* 2. Password reset is enabled for the user (Email+Password are set)
194+
* 3. The currently logged in user is allowed to reset passwords in the backend (Enabled in user TSconfig)
195+
*/
196+
public function isPasswordResetEnabled(): bool
197+
{
198+
return !$this->isCurrentlyLoggedIn()
199+
&& GeneralUtility::makeInstance(PasswordReset::class)->isEnabledForUser((int)$this->getUid())
200+
&& ($this->getBackendUser()->getTSConfig()['options.']['passwordReset'] ?? true);
201+
}
202+
186203
/**
187204
* Gets the user name.
188205
*
@@ -198,7 +215,7 @@ public function getUserName()
198215
*
199216
* @param string $userName the user name to set, must not be empty
200217
*/
201-
public function setUserName($userName): void
218+
public function setUserName($userName)
202219
{
203220
$this->userName = $userName;
204221
}
@@ -214,7 +231,7 @@ public function getDescription()
214231
/**
215232
* @param string $description
216233
*/
217-
public function setDescription($description): void
234+
public function setDescription($description)
218235
{
219236
$this->description = $description;
220237
}
@@ -234,7 +251,7 @@ public function getIsAdministrator()
234251
*
235252
* @param bool $isAdministrator whether this user should be an administrator
236253
*/
237-
public function setIsAdministrator($isAdministrator): void
254+
public function setIsAdministrator($isAdministrator)
238255
{
239256
$this->isAdministrator = $isAdministrator;
240257
}
@@ -254,7 +271,7 @@ public function getIsDisabled()
254271
*
255272
* @param bool $isDisabled whether this user is disabled
256273
*/
257-
public function setIsDisabled($isDisabled): void
274+
public function setIsDisabled($isDisabled)
258275
{
259276
$this->isDisabled = $isDisabled;
260277
}
@@ -274,7 +291,7 @@ public function getStartDateAndTime()
274291
*
275292
* @param \DateTime|null $dateAndTime the start date and time
276293
*/
277-
public function setStartDateAndTime(\DateTime $dateAndTime = null): void
294+
public function setStartDateAndTime(?\DateTime $dateAndTime = null)
278295
{
279296
$this->startDateAndTime = $dateAndTime;
280297
}
@@ -294,7 +311,7 @@ public function getEndDateAndTime()
294311
*
295312
* @param \DateTime|null $dateAndTime the end date and time
296313
*/
297-
public function setEndDateAndTime(\DateTime $dateAndTime = null): void
314+
public function setEndDateAndTime(?\DateTime $dateAndTime = null)
298315
{
299316
$this->endDateAndTime = $dateAndTime;
300317
}
@@ -314,7 +331,7 @@ public function getEmail()
314331
*
315332
* @param string $email the e-mail address, may be empty
316333
*/
317-
public function setEmail($email): void
334+
public function setEmail($email)
318335
{
319336
$this->email = $email;
320337
}
@@ -334,7 +351,7 @@ public function getRealName()
334351
*
335352
* @param string $name the user's real name, may be empty.
336353
*/
337-
public function setRealName($name): void
354+
public function setRealName($name)
338355
{
339356
$this->realName = $name;
340357
}
@@ -394,7 +411,7 @@ public function getLastLoginDateAndTime()
394411
*
395412
* @param \DateTime|null $dateAndTime this user's last login date and time
396413
*/
397-
public function setLastLoginDateAndTime(\DateTime $dateAndTime = null): void
414+
public function setLastLoginDateAndTime(?\DateTime $dateAndTime = null)
398415
{
399416
$this->lastLoginDateAndTime = $dateAndTime;
400417
}

README.md

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,14 @@
11
# backendtools
22

3-
Version 6.0.3
3+
Version 6.0.4
44

55
8 admin tools for extensions, pages, (backend) layouts, slug, redirects, files, images and links:
6-
extension-list, recent pages and content elements, used (backend) layouts, import redirects, check redirects,
6+
extension-list, recent pages and content elements, used (backend) layouts, import redirects, check redirects,
77
show where missing files are used, images with no title/alt-text and linklist.
88

99
You find the documentation for this extension at typo3.org:
1010
https://docs.typo3.org/p/fixpunkt/backendtools/master/en-us/
1111

12-
Version 5.0:
13-
- First version for TYPO3 12 LTS.
14-
15-
Version 5.1.2:
16-
- New tool: show where missing files are used.
17-
- Bugfix: show meta-data again in "Show images without title- or alt-text".
18-
19-
Version 5.2.0:
20-
- Refactored with the rector-tool.
21-
- setup.txt and constants.txt renamed to .typoscript.
22-
23-
Version 5.3.0:
24-
- Possibility added, to delete missing image-entries.
25-
- Image-preview added to "Find used images without title- or alt-text".
26-
27-
Version 5.3.1/2/3:
28-
- Widget "No. of extensions" deleted. Widget "Statistic about image meta tags" added.
2912

3013
Version 6.0:
3114
- Version for TYPO3 12 and 13 LTS.
@@ -41,4 +24,7 @@ Version 6.0.2:
4124

4225
Version 6.0.3:
4326
- Access of the module changed from invalid value to "admin".
44-
- Dashboard requirement removed. TYPO3 requirement changed from 12.5 to 12.4.
27+
- Dashboard requirement removed. TYPO3 requirement changed from 12.5 to 12.4.
28+
29+
Version 6.0.4:
30+
- Compatibility for PHP 8.4.

ext_emconf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'author' => 'Kurt Gusbeth',
1818
'author_company' => 'fixpunkt für digitales GmbH',
1919
'state' => 'stable',
20-
'version' => '6.0.3',
20+
'version' => '6.0.4',
2121
'constraints' => [
2222
'depends' => [
2323
'typo3' => '12.4.0-13.4.99',

0 commit comments

Comments
 (0)