mirror of
https://github.com/LDAPAccountManager/lam.git
synced 2025-10-03 17:59:21 +02:00
refactoring
This commit is contained in:
parent
b8d44f505e
commit
9b9eaa6fde
3 changed files with 21 additions and 13 deletions
|
@ -22,7 +22,7 @@ use ServerProfilePersistenceManager;
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2003 - 2006 Michael Duergner
|
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
|
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
|
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
|
// save both in cookie
|
||||||
$cookieOptions = lamDefaultCookieOptions();
|
$cookieOptions = lamDefaultCookieOptions();
|
||||||
$cookieOptions['expires'] = 0;
|
$cookieOptions['expires'] = 0;
|
||||||
|
if ($key !== false) {
|
||||||
setcookie("Key", base64_encode($key), $cookieOptions);
|
setcookie("Key", base64_encode($key), $cookieOptions);
|
||||||
|
}
|
||||||
|
if ($iv !== false) {
|
||||||
setcookie("IV", base64_encode($iv), $cookieOptions);
|
setcookie("IV", base64_encode($iv), $cookieOptions);
|
||||||
|
}
|
||||||
|
|
||||||
$serverProfilePersistenceManager = new ServerProfilePersistenceManager();
|
$serverProfilePersistenceManager = new ServerProfilePersistenceManager();
|
||||||
$profiles = $serverProfilePersistenceManager->getProfiles();
|
$profiles = $serverProfilePersistenceManager->getProfiles();
|
||||||
|
|
|
@ -131,10 +131,12 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
|
||||||
$handle = fopen ($_FILES['inputfile']['tmp_name'], "r");
|
$handle = fopen ($_FILES['inputfile']['tmp_name'], "r");
|
||||||
if ($handle !== false) {
|
if ($handle !== false) {
|
||||||
if (($head = fgetcsv($handle, 2000)) !== false ) { // head row
|
if (($head = fgetcsv($handle, 2000)) !== false ) { // head row
|
||||||
|
if (($head !== null) && ($head !== false)) {
|
||||||
foreach ($head as $i => $headItem) {
|
foreach ($head as $i => $headItem) {
|
||||||
$ids[$headItem] = $i;
|
$ids[$headItem] = $i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
while (($line = fgetcsv($handle, 2000)) !== false ) { // account rows
|
while (($line = fgetcsv($handle, 2000)) !== false ) { // account rows
|
||||||
$data[] = $line;
|
$data[] = $line;
|
||||||
}
|
}
|
||||||
|
@ -193,7 +195,7 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
|
||||||
if (sizeof($values_given) != sizeof($values_unique)) {
|
if (sizeof($values_given) != sizeof($values_unique)) {
|
||||||
$duplicates = array();
|
$duplicates = array();
|
||||||
foreach ($values_given as $key => $value) {
|
foreach ($values_given as $key => $value) {
|
||||||
if (!isset($values_unique[$key])) {
|
if (!isset($values_unique[$key]) && ($value !== null)) {
|
||||||
$duplicates[] = htmlspecialchars($value);
|
$duplicates[] = htmlspecialchars($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
16
phpstan.neon
16
phpstan.neon
|
@ -23,15 +23,17 @@ parameters:
|
||||||
- '#Throwing object of an unknown class [a-zA-Z0-9\\_-]+.#'
|
- '#Throwing object of an unknown class [a-zA-Z0-9\\_-]+.#'
|
||||||
- '#Parameter \#[0-9] \$[a-zA-Z_]+ of function [a-zA-Z_]+ expects [(]?callable.*#'
|
- '#Parameter \#[0-9] \$[a-zA-Z_]+ of function [a-zA-Z_]+ expects [(]?callable.*#'
|
||||||
- '#Call to an undefined method object::.*#'
|
- '#Call to an undefined method object::.*#'
|
||||||
- '#Parameter \#2 \$string of function explode expects string, array<int, string>\|string given.#'
|
- '#Parameter \#2 \$str 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 \#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 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 \$haystack of function strpos expects string, int\|string given.#'
|
||||||
- '#Parameter \#1 \$string of function htmlspecialchars expects string, array<int, string>\|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.#'
|
- '#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 \$input of function array_keys expects array, mixed given.#'
|
||||||
- '#Parameter \#1 \$array of function array_keys expects array, mixed given.#'
|
- '#Offset int does not exist on array<int, string\|null>\|null.#'
|
||||||
- '#Cannot access offset .+ on mixed.#'
|
|
||||||
- '#Argument of an invalid type mixed supplied for foreach, only iterables are supported.#'
|
- '#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.#'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue