#434 PHP 8.4 support

This commit is contained in:
Roland Gruber 2025-05-05 20:38:21 +02:00
parent 4167603f66
commit 48472af4e3
5 changed files with 9 additions and 8 deletions

View file

@ -1,4 +1,5 @@
June 2025 9.2 June 2025 9.2
- PHP 8.4 compatibility
- TAK support added - TAK support added
- Active Directory: allow to restore deleted entries in tree view (415) - Active Directory: allow to restore deleted entries in tree view (415)
- Multi-edit tool: change operations are combined by DN to allow e.g. adding object classes with required attributes (408) - Multi-edit tool: change operations are combined by DN to allow e.g. adding object classes with required attributes (408)

View file

@ -2914,7 +2914,7 @@ class LAMCfgMain {
const ERROR_REPORTING_DEFAULT = 'default'; const ERROR_REPORTING_DEFAULT = 'default';
/** PHP error reporting setting from php.ini */ /** PHP error reporting setting from php.ini */
const ERROR_REPORTING_SYSTEM = 'system'; const ERROR_REPORTING_SYSTEM = 'system';
/** PHP error reporting setting as E_ALL | E_STRICT */ /** PHP error reporting setting as E_ALL */
const ERROR_REPORTING_ALL = 'all'; const ERROR_REPORTING_ALL = 'all';
/** send license warnings via email */ /** send license warnings via email */

View file

@ -763,14 +763,14 @@ class accountContainer {
*/ */
function __construct($type, $base) { function __construct($type, $base) {
if (!($type instanceof ConfiguredType)) { if (!($type instanceof ConfiguredType)) {
trigger_error('Argument of accountContainer must be ConfiguredType.', E_USER_ERROR); die('Argument of accountContainer must be ConfiguredType.');
} }
if (!is_string($base)) { if (!is_string($base)) {
trigger_error('Argument of accountContainer must be string.', E_USER_ERROR); die('Argument base of accountContainer must be string: ' . $base);
} }
$this->type = $type; $this->type = $type;
$this->base = $base; $this->base = $base;
// Set startpage // Set start page
$this->current_page = 0; $this->current_page = 0;
$this->subpage = 'attributes'; $this->subpage = 'attributes';
$this->isNewAccount = false; $this->isNewAccount = false;

View file

@ -3,7 +3,7 @@
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2009 - 2012 Pavel Pozdnyak Copyright (C) 2009 - 2012 Pavel Pozdnyak
2009 - 2024 Roland Gruber 2009 - 2025 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
@ -1062,7 +1062,7 @@ class asteriskAccount extends baseModule implements passwordService {
'username', $this->messages['AstAccountType'][2], $messages); 'username', $this->messages['AstAccountType'][2], $messages);
//add password //add password
if ($rawAccounts[$i][$ids['asteriskAccount_AstAccountRealmedPassword']] != "") { if ($rawAccounts[$i][$ids['asteriskAccount_AstAccountRealmedPassword']] != "") {
$attributes = ['AstAccountCallerID' => [$partialAccounts[$i]['AstAccountCallerID']]]; // fake attribute list for password building $attributes = ['AstAccountCallerID' => $partialAccounts[$i]['AstAccountCallerID']]; // fake attribute list for password building
$pwdString = asteriskAccount::buildPasswordString($attributes, $this->moduleSettings, $rawAccounts[$i][$ids['asteriskAccount_AstAccountRealmedPassword']]); $pwdString = asteriskAccount::buildPasswordString($attributes, $this->moduleSettings, $rawAccounts[$i][$ids['asteriskAccount_AstAccountRealmedPassword']]);
$partialAccounts[$i]['AstAccountRealmedPassword'] = $pwdString; $partialAccounts[$i]['AstAccountRealmedPassword'] = $pwdString;
} }

View file

@ -137,13 +137,13 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
logNewMessage(LOG_DEBUG, 'Reading CSV file'); logNewMessage(LOG_DEBUG, 'Reading CSV file');
$handle = fopen($_FILES['inputfile']['tmp_name'], "r"); $handle = fopen($_FILES['inputfile']['tmp_name'], "r");
if ($handle !== false) { if ($handle !== false) {
$head = fgetcsv($handle, 2000); $head = fgetcsv($handle, 2000, escape: '');
if ($head !== false ) { // head row if ($head !== false ) { // head row
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, escape: '')) !== false ) { // account rows
$data[] = $line; $data[] = $line;
} }
fclose($handle); fclose($handle);