mirror of
https://github.com/LDAPAccountManager/lam.git
synced 2025-10-03 09:49:16 +02:00
#451 PHPStan level 5
This commit is contained in:
parent
55ba56cfa2
commit
9c899f1791
4 changed files with 20 additions and 18 deletions
|
@ -7,7 +7,7 @@ use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2011 - 2024 Roland Gruber
|
Copyright (C) 2011 - 2025 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -157,16 +157,16 @@ class systemQuotas extends baseModule {
|
||||||
// new entry
|
// new entry
|
||||||
$container->addElement(new htmlInputField('path', null, 20));
|
$container->addElement(new htmlInputField('path', null, 20));
|
||||||
$container->addElement($spacer);
|
$container->addElement($spacer);
|
||||||
$newSoftBlockInput = new htmlInputField('softBlock', 0, 10);
|
$newSoftBlockInput = new htmlInputField('softBlock', '0', 10);
|
||||||
$container->addElement($newSoftBlockInput);
|
$container->addElement($newSoftBlockInput);
|
||||||
$container->addElement($spacer);
|
$container->addElement($spacer);
|
||||||
$newHardBlockInput = new htmlInputField('hardBlock', 0, 10);
|
$newHardBlockInput = new htmlInputField('hardBlock', '0', 10);
|
||||||
$container->addElement($newHardBlockInput);
|
$container->addElement($newHardBlockInput);
|
||||||
$container->addElement($spacer);
|
$container->addElement($spacer);
|
||||||
$newSoftInodeInput = new htmlInputField('softInode', 0, 10);
|
$newSoftInodeInput = new htmlInputField('softInode', '0', 10);
|
||||||
$container->addElement($newSoftInodeInput);
|
$container->addElement($newSoftInodeInput);
|
||||||
$container->addElement($spacer);
|
$container->addElement($spacer);
|
||||||
$newHardInodeInput = new htmlInputField('hardInode', 0, 10);
|
$newHardInodeInput = new htmlInputField('hardInode', '0', 10);
|
||||||
$container->addElement($newHardInodeInput);
|
$container->addElement($newHardInodeInput);
|
||||||
$container->addElement(new htmlButton('add', 'add.svg', true));
|
$container->addElement(new htmlButton('add', 'add.svg', true));
|
||||||
return $container;
|
return $container;
|
||||||
|
@ -242,12 +242,12 @@ class systemQuotas extends baseModule {
|
||||||
/**
|
/**
|
||||||
* Checks if the quota parameters are valid.
|
* Checks if the quota parameters are valid.
|
||||||
*
|
*
|
||||||
* @param String $path mountpoint
|
* @param string $path mountpoint
|
||||||
* @param int $softBlock soft block limit
|
* @param string $softBlock soft block limit
|
||||||
* @param int $hardBlock hard block limit
|
* @param string $hardBlock hard block limit
|
||||||
* @param int $softInode soft inode limit
|
* @param string $softInode soft inode limit
|
||||||
* @param int $hardInode hard inode limit
|
* @param string $hardInode hard inode limit
|
||||||
* @param boolean $uploadIndex position is upload table
|
* @param int $uploadIndex position in upload table
|
||||||
* @return array array where error messages are returned
|
* @return array array where error messages are returned
|
||||||
*/
|
*/
|
||||||
private function checkQuota($path, $softBlock, $hardBlock, $softInode, $hardInode, $uploadIndex = null) {
|
private function checkQuota($path, $softBlock, $hardBlock, $softInode, $hardInode, $uploadIndex = null) {
|
||||||
|
|
|
@ -200,12 +200,15 @@ class takUser extends baseModule {
|
||||||
if (!in_array('takUser', $partialAccounts[$i]['objectClass'])) {
|
if (!in_array('takUser', $partialAccounts[$i]['objectClass'])) {
|
||||||
$partialAccounts[$i]['objectClass'][] = 'takUser';
|
$partialAccounts[$i]['objectClass'][] = 'takUser';
|
||||||
}
|
}
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takcallsign', 'takcallsign', 'username', $this->messages['takcallsign'][3], $errors);
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takcallsign',
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takrole', 'takrole', null, null, $errors);
|
'takcallsign', 'username', $this->messages['takcallsign'][3], $errors);
|
||||||
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takrole',
|
||||||
|
'takrole', null, [], $errors);
|
||||||
if (!in_array($partialAccounts[$i]['takrole'][0], self::ROLE_TYPES)) {
|
if (!in_array($partialAccounts[$i]['takrole'][0], self::ROLE_TYPES)) {
|
||||||
$errors[] = array_merge($this->messages['takrole'][0], [[$i]]);
|
$errors[] = array_merge($this->messages['takrole'][0], [[$i]]);
|
||||||
}
|
}
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takcolor', 'takcolor', null, null, $errors);
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takcolor',
|
||||||
|
'takcolor', null, [], $errors);
|
||||||
if (!in_array($partialAccounts[$i]['takcolor'][0], self::COLOR_TYPES)) {
|
if (!in_array($partialAccounts[$i]['takcolor'][0], self::COLOR_TYPES)) {
|
||||||
$errors[] = array_merge($this->messages['takcolor'][0], [[$i]]);
|
$errors[] = array_merge($this->messages['takcolor'][0], [[$i]]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -539,7 +539,7 @@ class windowsGroup extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addDoubleSelectionArea($return, _("Selected groups"), _("Available groups"), $selectedGroups,
|
$this->addDoubleSelectionArea($return, _("Selected groups"), _("Available groups"), $selectedGroups,
|
||||||
null, $availableGroups, null, 'memberof', false, true);
|
[], $availableGroups, [], 'memberof', false, true);
|
||||||
|
|
||||||
$return->addVerticalSpacer('2rem');
|
$return->addVerticalSpacer('2rem');
|
||||||
$backButton = new htmlAccountPageButton(static::class, 'attributes', 'back', _('Back'));
|
$backButton = new htmlAccountPageButton(static::class, 'attributes', 'back', _('Back'));
|
||||||
|
@ -642,7 +642,6 @@ class windowsGroup extends baseModule {
|
||||||
$filterGroup = new htmlGroup();
|
$filterGroup = new htmlGroup();
|
||||||
$filterGroup->addElement(new htmlOutputText(_('Filter') . ' '));
|
$filterGroup->addElement(new htmlOutputText(_('Filter') . ' '));
|
||||||
$filter = new htmlInputField('windows_filter');
|
$filter = new htmlInputField('windows_filter');
|
||||||
$filter->setFieldSize('5em');
|
|
||||||
$filter->filterSelectBox('members');
|
$filter->filterSelectBox('members');
|
||||||
$filterGroup->addElement($filter);
|
$filterGroup->addElement($filter);
|
||||||
$return->add($filterGroup);
|
$return->add($filterGroup);
|
||||||
|
|
|
@ -372,8 +372,8 @@ class windowsHost extends baseModule {
|
||||||
/**
|
/**
|
||||||
* Formats a value in file time (100 ns since 1601-01-01).
|
* Formats a value in file time (100 ns since 1601-01-01).
|
||||||
*
|
*
|
||||||
* @param integer $value time value
|
* @param string $value time value
|
||||||
* @return String formatted value
|
* @return string formatted value
|
||||||
*/
|
*/
|
||||||
private function formatFileTime($value) {
|
private function formatFileTime($value) {
|
||||||
if (empty($value) || ($value == '-1')) {
|
if (empty($value) || ($value == '-1')) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue