diff --git a/lam/templates/initsuff.php b/lam/templates/initsuff.php index adc680d4..b90e2259 100644 --- a/lam/templates/initsuff.php +++ b/lam/templates/initsuff.php @@ -92,19 +92,21 @@ if (isset($_POST['add_suff']) || isset($_POST['cancel'])) { if (!@ldap_add($_SESSION['ldap']->server(), $dn, $attr)) { // check if we have to add parent entries if (ldap_errno($_SESSION['ldap']->server()) == 32) { - $temp = explode(",", $suff); + $dnParts = explode(",", $suff); $subsuffs = array(); // make list of subsuffixes - for ($k = 0; $k < sizeof($temp); $k++) { - $part = explode("=", $temp[$k]); - if ($part[0] == "ou") $subsuffs[] = implode(",", array_slice($temp, $k)); + $dnPartsCount = sizeof($dnParts); + for ($k = 0; $k < $dnPartsCount; $k++) { + $part = explode("=", $dnParts[$k]); + if ($part[0] == "ou") $subsuffs[] = implode(",", array_slice($dnParts, $k)); else { - $subsuffs[] = implode(",", array_slice($temp, $k)); + $subsuffs[] = implode(",", array_slice($dnParts, $k)); break; } } // create missing entries - for ($k = sizeof($subsuffs) - 1; $k >= 0; $k--) { + $subsuffCount = sizeof($subsuffs); + for ($k = $subsuffCount - 1; $k >= 0; $k--) { // check if subsuffix is present $info = ldap_read($_SESSION['ldap']->server(), escapeDN($subsuffs[$k]), "objectclass=*", array('dn'), 0, 0, 0, LDAP_DEREF_NEVER); $res = ldap_get_entries($_SESSION['ldap']->server(), $info); diff --git a/lam/templates/login.php b/lam/templates/login.php index c8660b54..bc04bf37 100644 --- a/lam/templates/login.php +++ b/lam/templates/login.php @@ -294,9 +294,9 @@ function display_LoginPage(LAMConfig $config_object, LAMCfgMain $cfgMain, $licen if (!empty($config_object)) { // check extensions $extList = getRequiredExtensions(); - for ($i = 0; $i < sizeof($extList); $i++) { - if (!extension_loaded($extList[$i])) { - StatusMessage("ERROR", "A required PHP extension is missing!", $extList[$i]); + foreach ($extList as $extension) { + if (!extension_loaded($extension)) { + StatusMessage("ERROR", "A required PHP extension is missing!", $extension); echo "
"; } } @@ -369,14 +369,14 @@ function display_LoginPage(LAMConfig $config_object, LAMCfgMain $cfgMain, $licen if ($config_object->getLoginMethod() == LAMConfig::LOGIN_LIST) { $admins = $config_object->get_Admins(); $adminList = array(); - for($i = 0; $i < count($admins); $i++) { - $text = explode(",", $admins[$i]); + foreach ($admins as $admin) { + $text = explode(",", $admin); $text = explode("=", $text[0]); if (isset($text[1])) { - $adminList[$text[1]] = $admins[$i]; + $adminList[$text[1]] = $admin; } else { - $adminList[$text[0]] = $admins[$i]; + $adminList[$text[0]] = $admin; } } $selectedAdmin = array(); diff --git a/lam/templates/login2Factor.php b/lam/templates/login2Factor.php index ce1f458b..e3c232f6 100644 --- a/lam/templates/login2Factor.php +++ b/lam/templates/login2Factor.php @@ -144,16 +144,6 @@ if (isset($_POST['submit'])) { foreach ($cssFiles as $cssEntry) { echo "\n"; } - if (isset($profile->additionalCSS) && ($profile->additionalCSS != '')) { - $CSSlinks = explode("\n", $profile->additionalCSS); - for ($i = 0; $i < sizeof($CSSlinks); $i++) { - $CSSlinks[$i] = trim($CSSlinks[$i]); - if ($CSSlinks[$i] == '') { - continue; - } - echo "\n"; - } - } ?>