refactoring

This commit is contained in:
Roland Gruber 2023-01-12 07:37:47 +01:00
parent b8d44f505e
commit 9b9eaa6fde
3 changed files with 21 additions and 13 deletions

View file

@ -22,7 +22,7 @@ use ServerProfilePersistenceManager;
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
@ -210,8 +210,12 @@ function display_LoginPage(?LAMLicenseValidator $licenseValidator, ?string $erro
// save both in cookie
$cookieOptions = lamDefaultCookieOptions();
$cookieOptions['expires'] = 0;
if ($key !== false) {
setcookie("Key", base64_encode($key), $cookieOptions);
}
if ($iv !== false) {
setcookie("IV", base64_encode($iv), $cookieOptions);
}
$serverProfilePersistenceManager = new ServerProfilePersistenceManager();
$profiles = $serverProfilePersistenceManager->getProfiles();

View file

@ -131,10 +131,12 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
$handle = fopen ($_FILES['inputfile']['tmp_name'], "r");
if ($handle !== false) {
if (($head = fgetcsv($handle, 2000)) !== false ) { // head row
if (($head !== null) && ($head !== false)) {
foreach ($head as $i => $headItem) {
$ids[$headItem] = $i;
}
}
}
while (($line = fgetcsv($handle, 2000)) !== false ) { // account rows
$data[] = $line;
}
@ -193,7 +195,7 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
if (sizeof($values_given) != sizeof($values_unique)) {
$duplicates = array();
foreach ($values_given as $key => $value) {
if (!isset($values_unique[$key])) {
if (!isset($values_unique[$key]) && ($value !== null)) {
$duplicates[] = htmlspecialchars($value);
}
}

View file

@ -23,15 +23,17 @@ parameters:
- '#Throwing object of an unknown class [a-zA-Z0-9\\_-]+.#'
- '#Parameter \#[0-9] \$[a-zA-Z_]+ of function [a-zA-Z_]+ expects [(]?callable.*#'
- '#Call to an undefined method object::.*#'
- '#Parameter \#2 \$string of function explode expects string, array<int, string>\|string given.#'
- '#Parameter \#2 \$result of function ldap_get_entries expects LDAP\\Result, array\|LDAP\\Result given.#'
- '#Parameter \#2 \$str of function explode expects string, array<int, string>\|string given.#'
- '#Parameter \#1 \$link_identifier of function ldap_.* expects resource, LDAP\\Connection given.#'
- '#Parameter \#1 \$link of function ldap_read expects array\|resource, LDAP\\Connection given.#'
- '#Cannot assign new offset to array<int, string>\|string.#'
- '#Cannot access offset .* on array\|int.#'
- '#Cannot access offset .* on mixed.#'
- '#Parameter \#1 \$haystack of function strpos expects string, int\|string given.#'
- '#Parameter \#1 \$string of function htmlspecialchars expects string, array<int, string>\|string given.#'
- '#Parameter \#1 \$name of function LAM\\ACCOUNTLIST\\search_username expects string, array<int, string>\|string given.#'
- '#Cannot access offset int\|string on mixed.#'
- '#Parameter \#1 \$array of function array_keys expects array, mixed given.#'
- '#Cannot access offset .+ on mixed.#'
- '#Parameter \#1 \$input of function array_keys expects array, mixed given.#'
- '#Offset int does not exist on array<int, string\|null>\|null.#'
- '#Argument of an invalid type mixed supplied for foreach, only iterables are supported.#'
- '#Parameter \#2 \$args of function call_user_func_array expects array<int\|string, mixed>, mixed given.#'
- '#Parameter \#2 \$parameters of function call_user_func_array expects array<int, mixed>, mixed given.#'
- '#Parameter \#1 \$input of method LAM\\AJAX\\Ajax::managePasswordChange\(\) expects array, mixed given.#'
- '#Strict comparison using === between array<string, class-string> and false will always evaluate to false.#'