diff --git a/lam/templates/changePassword.php b/lam/templates/changePassword.php index 55012d08b..04e2aede3 100644 --- a/lam/templates/changePassword.php +++ b/lam/templates/changePassword.php @@ -11,7 +11,7 @@ use htmlStatusMessage; /* This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2020 - 2021 Roland Gruber + Copyright (C) 2020 - 2022 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 diff --git a/lam/templates/delete.php b/lam/templates/delete.php index fa89e3f8b..5fb9c519a 100644 --- a/lam/templates/delete.php +++ b/lam/templates/delete.php @@ -11,7 +11,7 @@ use \htmlStatusMessage; This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) Copyright (C) 2003 - 2006 Tilo Lutz - Copyright (C) 2007 - 2021 Roland Gruber + Copyright (C) 2007 - 2022 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 @@ -207,26 +207,24 @@ if (isset($_POST['delete'])) { $attributes = array(); $errors = array(); // predelete actions - if (!$stopprocessing) { - foreach ($moduleNames as $singlemodule) { - $success = true; - $messages = $modules[$singlemodule]->preDeleteActions(); - foreach ($messages as $message) { - $errors[] = $message; - if ($message[0] == 'ERROR') { - $success = false; - $allOk = false; - } - elseif ($message[0] == 'WARN') { - $allOk = false; - } - } - if (!$success) { - $stopprocessing = true; - break; - } - } - } + foreach ($moduleNames as $singlemodule) { + $success = true; + $messages = $modules[$singlemodule]->preDeleteActions(); + foreach ($messages as $message) { + $errors[] = $message; + if ($message[0] == 'ERROR') { + $success = false; + $allOk = false; + } + elseif ($message[0] == 'WARN') { + $allOk = false; + } + } + if (!$success) { + $stopprocessing = true; + break; + } + } if (!$stopprocessing) { // load attributes foreach ($moduleNames as $singlemodule) { @@ -260,7 +258,7 @@ if (isset($_POST['delete'])) { } if (!$stopprocessing) { // modify attributes - if (isset($attributes[$dn]['modify']) && !$stopprocessing) { + if (isset($attributes[$dn]['modify'])) { $success = ldap_mod_replace($_SESSION['ldap']->server(), $dn, $attributes[$dn]['modify']); if (!$success) { $errors[] = array ('ERROR', sprintf(_('Was unable to modify attributes from DN: %s.'), $dn), getDefaultLDAPErrorString($_SESSION['ldap']->server())); diff --git a/lam/templates/schema/schema.php b/lam/templates/schema/schema.php index 079421c9c..880712023 100644 --- a/lam/templates/schema/schema.php +++ b/lam/templates/schema/schema.php @@ -294,7 +294,7 @@ function displayAttributeList(htmlResponsiveRow $row) { if (isset($_GET['sel']) && (empty($_GET['sel']) || array_key_exists(strtolower($_GET['sel']), $attributes))) { $selectedAttribute[0] = $_GET['sel']; } - if (empty($selectedAttribute) && (sizeof($availableAttributes) > 0)) { + if (empty($selectedAttribute) && (sizeof($availableAttributes) > 1)) { // select first attribute by default $attributeNames = array_keys($availableAttributes); $selectedAttribute[0] = $attributeNames[1]; diff --git a/lam/templates/tools/ou_edit.php b/lam/templates/tools/ou_edit.php index 5ef04fa9a..733624f7d 100644 --- a/lam/templates/tools/ou_edit.php +++ b/lam/templates/tools/ou_edit.php @@ -156,10 +156,10 @@ display_main($message, $error); /** * Displays the main page of the OU editor * - * @param String $message info message - * @param String $error error message + * @param string|null $message info message + * @param string|null $error error message */ -function display_main($message, $error) { +function display_main(?string $message, ?string $error): void { // display main page include __DIR__ . '/../../lib/adminHeader.inc'; echo '