mirror of
https://github.com/LDAPAccountManager/lam.git
synced 2025-10-03 09:49:16 +02:00
refactoring
This commit is contained in:
parent
e52cfd54b6
commit
9ac2f2f621
11 changed files with 13 additions and 15 deletions
|
@ -65,6 +65,7 @@ This is a list of API changes for all LAM releases.
|
|||
<li>Module/Type API
|
||||
<ul>
|
||||
<li>Added defined parameter and return types to some methods (e.g. "getTitleBarSubtitle")</li>
|
||||
<li>getPasswordQuickChangeOptions(): new parameter $forcePasswordChangeByDefault</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -2422,9 +2422,10 @@ interface passwordService {
|
|||
/**
|
||||
* Returns a list of password quick change options.
|
||||
*
|
||||
* @param bool $forcePasswordChangeByDefault password change should be preselected
|
||||
* @return PasswordQuickChangeOption[] options
|
||||
*/
|
||||
public function getPasswordQuickChangeOptions(): array;
|
||||
public function getPasswordQuickChangeOptions(bool $forcePasswordChangeByDefault): array;
|
||||
|
||||
/**
|
||||
* Returns a list of LDAP attribute changes to perform.
|
||||
|
|
|
@ -1273,7 +1273,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPasswordQuickChangeOptions(): array {
|
||||
public function getPasswordQuickChangeOptions(bool $forcePasswordChangeByDefault): array {
|
||||
$options = [];
|
||||
if (in_array_ignore_case('AsteriskSIPUser', $this->attributes['objectClass'])) {
|
||||
$options[] = new PasswordQuickChangeOption('syncAsterisk', _('Change Asterisk password'));
|
||||
|
|
|
@ -543,7 +543,7 @@ class asteriskVoicemail extends baseModule implements passwordService {
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPasswordQuickChangeOptions(): array {
|
||||
public function getPasswordQuickChangeOptions(bool $forcePasswordChangeByDefault): array {
|
||||
$options = [];
|
||||
if (in_array_ignore_case('AsteriskVoiceMail', $this->attributes['objectClass'])) {
|
||||
$options[] = new PasswordQuickChangeOption('syncAsteriskVoiceMail', _('Change Asterisk voicemail password'));
|
||||
|
|
|
@ -3944,7 +3944,7 @@ class inetOrgPerson extends baseModule implements passwordService, AccountStatus
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPasswordQuickChangeOptions(): array {
|
||||
public function getPasswordQuickChangeOptions(bool $forcePasswordChangeByDefault): array {
|
||||
if ($this->isUnixActive() && in_array_ignore_case('posixAccount', $this->attributes['objectClass'])) {
|
||||
return [];
|
||||
}
|
||||
|
|
|
@ -4215,7 +4215,7 @@ class posixAccount extends baseModule implements passwordService, AccountStatusP
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPasswordQuickChangeOptions(): array {
|
||||
public function getPasswordQuickChangeOptions(bool $forcePasswordChangeByDefault): array {
|
||||
if (!in_array_ignore_case('posixAccount', $this->attributes['objectClass'])) {
|
||||
return [];
|
||||
}
|
||||
|
|
|
@ -1401,7 +1401,7 @@ class posixGroup extends baseModule implements passwordService {
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPasswordQuickChangeOptions(): array {
|
||||
public function getPasswordQuickChangeOptions(bool $forcePasswordChangeByDefault): array {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
use LAM\REMOTE\Remote;
|
||||
use LAM\TYPES\ConfiguredType;
|
||||
use LDAP\Connection;
|
||||
use function LAM\ACCOUNTLIST\isPasswordChangeByDefault;
|
||||
|
||||
/*
|
||||
|
||||
|
@ -2900,7 +2899,7 @@ class sambaSamAccount extends baseModule implements passwordService, AccountStat
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPasswordQuickChangeOptions(): array {
|
||||
public function getPasswordQuickChangeOptions(bool $forcePasswordChangeByDefault): array {
|
||||
$options = [];
|
||||
if (isset($this->attributes['sambaacctflags'][0])
|
||||
&& (str_contains($this->attributes['sambaacctflags'][0], 'L')
|
||||
|
@ -2909,7 +2908,7 @@ class sambaSamAccount extends baseModule implements passwordService, AccountStat
|
|||
}
|
||||
if (in_array_ignore_case('sambaSamAccount', $this->attributes['objectClass'])) {
|
||||
$options[] = new PasswordQuickChangeOption('syncSambaNT', _('Change Samba NT password'));
|
||||
$options[] = new PasswordQuickChangeOption('forcePasswordChangeSamba', _('Force Samba password change'), isPasswordChangeByDefault());
|
||||
$options[] = new PasswordQuickChangeOption('forcePasswordChangeSamba', _('Force Samba password change'), $forcePasswordChangeByDefault);
|
||||
}
|
||||
if (isset($this->attributes['sambaPwdLastSet'][0])) {
|
||||
$options[] = new PasswordQuickChangeOption('updateSambaTimestamps', _('Update Samba password timestamp'));
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
use LAM\JOB\AccountExpirationCleanupJob;
|
||||
use LAM\JOB\PasswordExpirationJob;
|
||||
use function LAM\ACCOUNTLIST\isPasswordChangeByDefault;
|
||||
use LAM\TYPES\ConfiguredType;
|
||||
|
||||
/*
|
||||
|
@ -892,10 +891,10 @@ class shadowAccount extends baseModule implements passwordService, AccountStatus
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPasswordQuickChangeOptions(): array {
|
||||
public function getPasswordQuickChangeOptions(bool $forcePasswordChangeByDefault): array {
|
||||
$options = [];
|
||||
if (in_array_ignore_case('shadowAccount', $this->attributes['objectClass'])) {
|
||||
$options[] = new PasswordQuickChangeOption('forcePasswordChangeUnix', _('Force Unix password change'), isPasswordChangeByDefault());
|
||||
$options[] = new PasswordQuickChangeOption('forcePasswordChangeUnix', _('Force Unix password change'), $forcePasswordChangeByDefault);
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
|
|
|
@ -4648,7 +4648,7 @@ class windowsUser extends baseModule implements passwordService, AccountStatusPr
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPasswordQuickChangeOptions(): array {
|
||||
public function getPasswordQuickChangeOptions(bool $forcePasswordChangeByDefault): array {
|
||||
if (!in_array_ignore_case('user', $this->attributes['objectClass'])) {
|
||||
return [];
|
||||
}
|
||||
|
|
|
@ -15,8 +15,6 @@ parameters:
|
|||
analyseAndScan:
|
||||
- */lists/changePassword.php
|
||||
ignoreErrors:
|
||||
- '#Function [a-zA-Z0-9\\_-]+ not found.#'
|
||||
- '#Used function [a-zA-Z0-9\\_-]+ not found.#'
|
||||
- '#Variable \$helpArray might not be defined.#'
|
||||
- '#Binary operation .* between .* and .* results in an error.#'
|
||||
- '#Offset .SID. on array.*in isset\(\) always exists.*#'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue