#440 show comparison data

This commit is contained in:
Roland Gruber 2025-07-09 20:11:41 +02:00
parent 7559c9b37f
commit 60e6c91569
3 changed files with 14 additions and 7 deletions

View file

@ -1,4 +1,5 @@
September 2025 9.3 September 2025 9.3
- Tree view: added comparison feature (440)
- Lamdaemon: run /usr/sbin/userdel.local before (and no longer after) home directory is deleted (443) - Lamdaemon: run /usr/sbin/userdel.local before (and no longer after) home directory is deleted (443)
- LAM Pro: - LAM Pro:
-> SMS support for password sending and password self-reset (441) -> SMS support for password sending and password self-reset (441)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Before After
Before After

View file

@ -1482,16 +1482,20 @@ class TreeView {
* Stops processing if DN is invalid. * Stops processing if DN is invalid.
* *
* @param string $dn DN * @param string $dn DN
* @return bool DN is valid
*/ */
private function validateDn(string $dn): void { private function validateDn(string $dn, bool $die = true): bool {
$dn = strtolower($dn); $dn = strtolower($dn);
$rootDns = TreeViewTool::getRootDns(); $rootDns = TreeViewTool::getRootDns();
foreach ($rootDns as $rootDn) { foreach ($rootDns as $rootDn) {
$rootDn = strtolower($rootDn); $rootDn = strtolower($rootDn);
if (str_ends_with($dn, $rootDn)) { if (str_ends_with($dn, $rootDn)) {
return; return true;
} }
} }
if (!$die) {
return false;
}
logNewMessage(LOG_ERR, 'Invalid DN for tree view: ' . $dn); logNewMessage(LOG_ERR, 'Invalid DN for tree view: ' . $dn);
die(); die();
} }
@ -1771,11 +1775,13 @@ class TreeView {
* @return string JSON data * @return string JSON data
*/ */
private function compare(): string { private function compare(): string {
$dnList = explode(',', $_POST['dnList']); $dnListToCheck = explode(',', $_POST['dnList']);
for ($i = 0; $i < count($dnList); $i++) { $dnList = [];
$dn = base64_decode($dnList[$i]); foreach ($dnListToCheck as $dn) {
$this->validateDn($dn); $dn = base64_decode($dn);
$dnList[$i] = $dn; if ($this->validateDn($dn, false)) {
$dnList[] = $dn;
}
} }
natcasesort($dnList); natcasesort($dnList);
try { try {