Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberroland committed Oct 12, 2023
1 parent 72f0ccf commit aaa1a97
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lam/lib/schema.inc
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ class ObjectClass extends SchemaItem
*
* @return array An array of objectClass names (strings)
*/
function getSupClasses()
function getSupClasses(): array
{
return $this->sup_classes;
}
Expand Down
10 changes: 4 additions & 6 deletions lam/templates/pdfedit/pdfmain.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2003 - 2006 Michael Duergner
2005 - 2022 Roland Gruber
2005 - 2023 Roland Gruber
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
Expand Down Expand Up @@ -517,11 +517,9 @@
foreach ($typesImport as $typeImport) {
if (($profile != $_SESSION['config']->getName()) || ($typeImport->getId() != $typeId)) {
$accountProfiles = $pdfStructurePersistenceManager->getPDFStructures($profile, $typeImport->getId());
if (!empty($accountProfiles)) {
foreach ($accountProfiles as $accountProfile) {
$importOptions[$profile][$typeImport->getAlias() . ': ' . $accountProfile] = $profile . '##' . $typeImport->getId() . '##' . $accountProfile;
}
}
foreach ($accountProfiles as $accountProfile) {
$importOptions[$profile][$typeImport->getAlias() . ': ' . $accountProfile] = $profile . '##' . $typeImport->getId() . '##' . $accountProfile;
}
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions lam/templates/profedit/profilemain.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2003 - 2022 Roland Gruber
Copyright (C) 2003 - 2023 Roland Gruber
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
Expand Down Expand Up @@ -346,10 +346,8 @@
foreach ($typesImport as $typeImport) {
if (($profile != $_SESSION['config']->getName()) || ($typeImport->getId() != $typeId)) {
$accountProfiles = $accountProfilePersistenceManager->getAccountProfileNames($typeImport->getId(), $profile);
if (!empty($accountProfiles)) {
foreach ($accountProfiles as $accountProfile) {
$importOptions[$profile][$typeImport->getAlias() . ': ' . $accountProfile] = $profile . '##' . $typeImport->getId() . '##' . $accountProfile;
}
foreach ($accountProfiles as $accountProfile) {
$importOptions[$profile][$typeImport->getAlias() . ': ' . $accountProfile] = $profile . '##' . $typeImport->getId() . '##' . $accountProfile;
}
}
}
Expand Down
10 changes: 4 additions & 6 deletions lam/templates/schema/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,11 @@ function displayObjectClassList(htmlResponsiveRow &$row): void {

// fill child object classes
foreach ($objectClasses as $name => $objectClass) {
if (!empty($objectClass->getSupClasses())) {
foreach ($objectClass->getSupClasses() as $subClass) {
if (!isset($objectClasses[strtolower($subClass)])) {
continue;
}
$objectClasses[strtolower($subClass)]->addChildObjectClass($name);
foreach ($objectClass->getSupClasses() as $subClass) {
if (!isset($objectClasses[strtolower($subClass)])) {
continue;
}
$objectClasses[strtolower($subClass)]->addChildObjectClass($name);
}
}

Expand Down

0 comments on commit aaa1a97

Please sign in to comment.