mirror of
https://github.com/LDAPAccountManager/lam.git
synced 2025-10-03 17:59:21 +02:00
refactoring
This commit is contained in:
parent
bff5f58279
commit
cdfdfbac26
3 changed files with 14 additions and 20 deletions
|
@ -985,7 +985,7 @@ function searchLDAPPaged($server, $dn, $filter, $attributes, $attrsOnly, $limit)
|
||||||
*
|
*
|
||||||
* @param String $dn DN
|
* @param String $dn DN
|
||||||
* @param array $attributes list of attributes to fetch
|
* @param array $attributes list of attributes to fetch
|
||||||
* @param handle $handle LDAP handle (optional for admin interface pages)
|
* @param Connection $handle LDAP handle (optional for admin interface pages)
|
||||||
* @return ?array attributes or null if not found
|
* @return ?array attributes or null if not found
|
||||||
*/
|
*/
|
||||||
function ldapGetDN($dn, $attributes = ['dn'], $handle = null): ?array {
|
function ldapGetDN($dn, $attributes = ['dn'], $handle = null): ?array {
|
||||||
|
@ -2008,8 +2008,8 @@ function formatSecondsToShortFormat($numSeconds) {
|
||||||
/**
|
/**
|
||||||
* Unformats text like 1m10s back to number of seconds.
|
* Unformats text like 1m10s back to number of seconds.
|
||||||
*
|
*
|
||||||
* @param String $text formatted text
|
* @param string $text formatted text
|
||||||
* @return int number of seconds
|
* @return int|string number of seconds
|
||||||
*/
|
*/
|
||||||
function unformatShortFormatToSeconds($text) {
|
function unformatShortFormatToSeconds($text) {
|
||||||
if (empty($text)) {
|
if (empty($text)) {
|
||||||
|
|
|
@ -2446,8 +2446,8 @@ interface passwordService {
|
||||||
* This function is called whenever the password should be changed. Account modules
|
* This function is called whenever the password should be changed. Account modules
|
||||||
* must change their password attributes only if the modules list contains their module name.
|
* must change their password attributes only if the modules list contains their module name.
|
||||||
*
|
*
|
||||||
* @param String $password new password
|
* @param string $password new password
|
||||||
* @param array $modules list of modules for which the password should be changed
|
* @param string[] $modules list of modules for which the password should be changed
|
||||||
* @param boolean $forcePasswordChange force the user to change his password at next login
|
* @param boolean $forcePasswordChange force the user to change his password at next login
|
||||||
* @return array list of error messages if any as parameter array for StatusMessage
|
* @return array list of error messages if any as parameter array for StatusMessage
|
||||||
* e.g. return array(array('ERROR', 'Password change failed.'))
|
* e.g. return array(array('ERROR', 'Password change failed.'))
|
||||||
|
@ -2542,7 +2542,7 @@ interface AccountStatusProvider {
|
||||||
* Returns the list of account status detail lines.
|
* Returns the list of account status detail lines.
|
||||||
*
|
*
|
||||||
* @param ConfiguredType $type account type
|
* @param ConfiguredType $type account type
|
||||||
* @param array<string, array<string>|string>|null $attributes LDAP attributes (use account container attributes if not provided)
|
* @param array<string, string[]|string>|null $attributes LDAP attributes (use account container attributes if not provided)
|
||||||
* @return AccountStatusDetails[] status details
|
* @return AccountStatusDetails[] status details
|
||||||
*/
|
*/
|
||||||
public function getAccountStatusDetails(ConfiguredType $type, ?array &$attributes): array;
|
public function getAccountStatusDetails(ConfiguredType $type, ?array &$attributes): array;
|
||||||
|
@ -2559,7 +2559,7 @@ interface AccountStatusProvider {
|
||||||
* Returns a list of options how the account could be locked.
|
* Returns a list of options how the account could be locked.
|
||||||
*
|
*
|
||||||
* @param ConfiguredType $type type
|
* @param ConfiguredType $type type
|
||||||
* @param array<string, array<string>|string>|null $attributes LDAP attributes
|
* @param array<string, string[]|string>|null $attributes LDAP attributes
|
||||||
* @return AccountStatusDetails[] lock options
|
* @return AccountStatusDetails[] lock options
|
||||||
*/
|
*/
|
||||||
public function getAccountStatusPossibleLockOptions(ConfiguredType $type, ?array &$attributes): array;
|
public function getAccountStatusPossibleLockOptions(ConfiguredType $type, ?array &$attributes): array;
|
||||||
|
@ -2568,7 +2568,7 @@ interface AccountStatusProvider {
|
||||||
* Locks the account with the given lock IDs.
|
* Locks the account with the given lock IDs.
|
||||||
*
|
*
|
||||||
* @param ConfiguredType $type type
|
* @param ConfiguredType $type type
|
||||||
* @param array<string, array<string>|string>|null $attributes LDAP attributes
|
* @param array<string, string[]|string>|null $attributes LDAP attributes
|
||||||
* @param array $lockIds IDs from AccountStatusDetails
|
* @param array $lockIds IDs from AccountStatusDetails
|
||||||
* @throws LAMException error during locking
|
* @throws LAMException error during locking
|
||||||
*/
|
*/
|
||||||
|
@ -2578,7 +2578,7 @@ interface AccountStatusProvider {
|
||||||
* Unlocks the account with the given lock IDs.
|
* Unlocks the account with the given lock IDs.
|
||||||
*
|
*
|
||||||
* @param ConfiguredType $type type
|
* @param ConfiguredType $type type
|
||||||
* @param array<string, array<string>|string>|null $attributes LDAP attributes
|
* @param array<string, string[]|string>|null $attributes LDAP attributes
|
||||||
* @param array $lockIds IDs from AccountStatusDetails
|
* @param array $lockIds IDs from AccountStatusDetails
|
||||||
*/
|
*/
|
||||||
public function accountStatusPerformUnlock(ConfiguredType $type, ?array &$attributes, array $lockIds): void;
|
public function accountStatusPerformUnlock(ConfiguredType $type, ?array &$attributes, array $lockIds): void;
|
||||||
|
|
|
@ -28,12 +28,7 @@ window.lam = window.lam || {};
|
||||||
*/
|
*/
|
||||||
function list_click(box) {
|
function list_click(box) {
|
||||||
var cbox = document.getElementsByName(box)[0];
|
var cbox = document.getElementsByName(box)[0];
|
||||||
if (cbox.checked) {
|
cbox.checked = !cbox.checked;
|
||||||
cbox.checked = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
cbox.checked = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -323,7 +318,7 @@ async function confirmLoadProfile(title, text, okText, cancelText, e) {
|
||||||
selectValue.value = selectedProfile;
|
selectValue.value = selectedProfile;
|
||||||
form.appendChild(selectValue);
|
form.appendChild(selectValue);
|
||||||
form.submit();
|
form.submit();
|
||||||
};
|
}
|
||||||
if (e.preventDefault) {
|
if (e.preventDefault) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
@ -1353,7 +1348,7 @@ window.lam.tools.webcam.init = function() {
|
||||||
if (mediaDevice.kind === 'videoinput') {
|
if (mediaDevice.kind === 'videoinput') {
|
||||||
contentDiv.classList.remove('hidden');
|
contentDiv.classList.remove('hidden');
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1901,7 +1896,6 @@ window.lam.webauthn.run = function(prefix, isSelfService, newDeviceNameTitle, ne
|
||||||
hiddenSkip.value = 'skip';
|
hiddenSkip.value = 'skip';
|
||||||
form.appendChild(hiddenSkip);
|
form.appendChild(hiddenSkip);
|
||||||
form.submit();
|
form.submit();
|
||||||
return;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const token = document.getElementById('sec_token').value;
|
const token = document.getElementById('sec_token').value;
|
||||||
|
@ -2923,7 +2917,7 @@ window.lam.treeview.updatePossibleNewAttributes = function(tokenName, tokenValue
|
||||||
option.value = data[attributeName];
|
option.value = data[attributeName];
|
||||||
option.innerText = attributeName;
|
option.innerText = attributeName;
|
||||||
select.appendChild(option);
|
select.appendChild(option);
|
||||||
};
|
}
|
||||||
window.lam.treeview.updatePossibleNewAttributesRequest = null;
|
window.lam.treeview.updatePossibleNewAttributesRequest = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -3698,7 +3692,7 @@ window.lam.config.updateModuleFilter = function(inputField) {
|
||||||
if (cell.innerText.toLowerCase().includes(filterValue)) {
|
if (cell.innerText.toLowerCase().includes(filterValue)) {
|
||||||
matches = true;
|
matches = true;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
if (matches) {
|
if (matches) {
|
||||||
row.classList.remove('hidden');
|
row.classList.remove('hidden');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue