Skip to content

Commit 4cd422f

Browse files
committed
Merge branch '11.0/bugfixes'
2 parents 522bfd8 + 1355f4e commit 4cd422f

28 files changed

Lines changed: 859 additions & 390 deletions

.github/dependabot.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ updates:
132132
- "twig/*"
133133

134134

135-
# main branch (next version is a minor version, i.e. 11.x)
136-
# -> minor updates for both production and developement dependencies (prevent BC breaks)
135+
# main branch (next version is a major version, i.e. 12.x)
136+
# -> major updates for both production and developement dependencies (until the first RC release)
137137
- package-ecosystem: "npm"
138138
directory: "/"
139139
schedule:
@@ -145,8 +145,12 @@ updates:
145145
target-branch: "main"
146146
versioning-strategy: "increase"
147147
ignore:
148-
# ignore major versions for all dependencies
149-
- dependency-name: "*"
148+
# ignore major versions of the `fullcalendar` component (the code upgrade needs to be done by ourselves)
149+
- dependency-name: "@fullcalendar/*"
150+
update-types:
151+
- "version-update:semver-major"
152+
# ignore major versions of the `gridstack` component (too much issues due to BC-breaks)
153+
- dependency-name: "gridstack"
150154
update-types:
151155
- "version-update:semver-major"
152156
groups:
@@ -180,10 +184,10 @@ updates:
180184
target-branch: "main"
181185
versioning-strategy: "increase"
182186
ignore:
183-
# ignore major versions for all dependencies
184-
- dependency-name: "*"
185-
update-types:
186-
- "version-update:semver-major"
187+
# stick to symfony 7.4 LTS
188+
- dependency-name: "symfony/*"
189+
versions:
190+
- "8.x"
187191
groups:
188192
# dev-dependencies group first, to be sure that they will not be included in the following groups
189193
dev-dependencies:

.github/workflows/audit_dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
printf "LOG<<EOF\n$LOG\nEOF" >> $GITHUB_OUTPUT
6565
- name: "Create issue if npm audit fails"
6666
if: "${{ steps.npmaudit.outputs.CODE != '0' }}"
67-
uses: "actions/github-script@v8"
67+
uses: "actions/github-script@v9"
6868
with:
6969
script: |
7070
const result = await github.rest.issues.create({
@@ -84,7 +84,7 @@ jobs:
8484
printf "LOG<<EOF\n$LOG\nEOF" >> $GITHUB_OUTPUT
8585
- name: "Create issue if composer audit fails"
8686
if: "${{ steps.composeraudit.outputs.CODE != '0' }}"
87-
uses: "actions/github-script@v8"
87+
uses: "actions/github-script@v9"
8888
with:
8989
script: |
9090
const result = await github.rest.issues.create({

.github/workflows/bump_version_after_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
git push origin ${{ env.BUMP_BRANCH }}
7474
- name: "Create Pull Request"
7575
if: ${{ env.IS_STABLE_RELEASE == 'yes' }}
76-
uses: "actions/github-script@v8"
76+
uses: "actions/github-script@v9"
7777
with:
7878
script: |
7979
const { repo, owner } = context.repo;

.github/workflows/docker_rebuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
steps:
3232
- name: "Resolve versions and build matrix"
3333
id: "resolve"
34-
uses: "actions/github-script@v8"
34+
uses: "actions/github-script@v9"
3535
with:
3636
script: |
3737
const isSchedule = context.eventName === 'schedule';

.phpstan-baseline.php

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,12 +1021,6 @@
10211021
'count' => 1,
10221022
'path' => __DIR__ . '/front/item_project.form.php',
10231023
];
1024-
$ignoreErrors[] = [
1025-
'message' => '#^Offset \'id\' might not exist on array\\{id\\: mixed\\}\\|array\\{racks_id\\: mixed, orientation\\: mixed, position\\: mixed, _onlypdu\\?\\: mixed\\}\\.$#',
1026-
'identifier' => 'offsetAccess.notFound',
1027-
'count' => 1,
1028-
'path' => __DIR__ . '/front/item_rack.form.php',
1029-
];
10301024
$ignoreErrors[] = [
10311025
'message' => '#^Offset \'racks_id\' might not exist on array\\<string, mixed\\>\\|null\\.$#',
10321026
'identifier' => 'offsetAccess.notFound',
@@ -4238,7 +4232,7 @@
42384232
'path' => __DIR__ . '/src/Config.php',
42394233
];
42404234
$ignoreErrors[] = [
4241-
'message' => '#^Cannot access offset \'endpoint\' on array\\{api_version\\: string, version\\: \'2\\.[0-9]+\\.0\', description\\?\\: string, endpoint\\: string\\}\\|false\\.$#',
4235+
'message' => '#^Cannot access offset \'endpoint\' on array\\{api_version\\: string, version\\: \'2\\.3\\.0\', description\\?\\: string, endpoint\\: string\\}\\|false\\.$#',
42424236
'identifier' => 'offsetAccess.nonOffsetAccessible',
42434237
'count' => 3,
42444238
'path' => __DIR__ . '/src/Config.php',
@@ -10537,6 +10531,12 @@
1053710531
'count' => 1,
1053810532
'path' => __DIR__ . '/src/Glpi/Inventory/Asset/NetworkPort.php',
1053910533
];
10534+
$ignoreErrors[] = [
10535+
'message' => '#^Call to an undefined method object\\:\\:getManagementPorts\\(\\)\\.$#',
10536+
'identifier' => 'method.notFound',
10537+
'count' => 1,
10538+
'path' => __DIR__ . '/src/Glpi/Inventory/Asset/NetworkPort.php',
10539+
];
1054010540
$ignoreErrors[] = [
1054110541
'message' => '#^Cannot access constant class on Glpi\\\\Inventory\\\\MainAsset\\\\MainAsset\\|null\\.$#',
1054210542
'identifier' => 'classConstant.nonObject',
@@ -10606,7 +10606,7 @@
1060610606
$ignoreErrors[] = [
1060710607
'message' => '#^Cannot call method getManagementPorts\\(\\) on object\\|null\\.$#',
1060810608
'identifier' => 'method.nonObject',
10609-
'count' => 2,
10609+
'count' => 1,
1061010610
'path' => __DIR__ . '/src/Glpi/Inventory/Asset/NetworkPort.php',
1061110611
];
1061210612
$ignoreErrors[] = [
@@ -12277,12 +12277,6 @@
1227712277
'count' => 1,
1227812278
'path' => __DIR__ . '/src/Glpi/ItemTranslation/ItemTranslation.php',
1227912279
];
12280-
$ignoreErrors[] = [
12281-
'message' => '#^Cannot access property \\$strategy on Glpi\\\\Security\\\\Attribute\\\\SecurityStrategy\\|false\\.$#',
12282-
'identifier' => 'property.nonObject',
12283-
'count' => 1,
12284-
'path' => __DIR__ . '/src/Glpi/Kernel/Listener/ControllerListener/FirewallStrategyListener.php',
12285-
];
1228612280
$ignoreErrors[] = [
1228712281
'message' => '#^Parameter \\#1 \\$strategy of method Glpi\\\\Http\\\\Firewall\\:\\:applyStrategy\\(\\) expects \'admin_access\'\\|\'authenticated\'\\|\'central_access\'\\|\'faq_access\'\\|\'helpdesk_access\'\\|\'no_check\', string given\\.$#',
1228812282
'identifier' => 'argument.type',
@@ -19562,7 +19556,7 @@
1956219556
'path' => __DIR__ . '/src/Ticket.php',
1956319557
];
1956419558
$ignoreErrors[] = [
19565-
'message' => '#^Parameter \\#1 \\$params of method CommonITILObject\\:\\:getEntitiesForRequesters\\(\\) expects array, array\\|null given\\.$#',
19559+
'message' => '#^Parameter \\#1 \\$params of method CommonITILObject\\:\\:getEntitiesForRequesters\\(\\) expects array, array\\<string, mixed\\>\\|null given\\.$#',
1956619560
'identifier' => 'argument.type',
1956719561
'count' => 1,
1956819562
'path' => __DIR__ . '/src/Ticket.php',

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ PLAYWRIGHT = docker run \
2323
--user=$(shell id -u):$(shell id -g) \
2424
-v .:/app \
2525
-w /app \
26-
-p 9323:9323 \
2726
-e E2E_BASE_URL=$(E2E_BASE_URL) \
2827
--network host \
2928
mcr.microsoft.com/playwright:v$(PLAYWRIGHT_VERSION)-noble \
@@ -41,7 +40,7 @@ _ERROR := "\033[31m[%s]\033[0m %s\n" # Red text
4140
## —— General ——————————————————————————————————————————————————————————————————
4241
.DEFAULT_GOAL := help
4342
help: ## Show this help message
44-
@grep -hE '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-25s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
43+
@grep -hE '(^[0-9a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-25s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
4544
.PHONY: help
4645

4746
install: init-override build up vendor db-install test-db-install ## Install the project

ajax/mailcollector.php

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -33,54 +33,24 @@
3333
* ---------------------------------------------------------------------
3434
*/
3535

36-
use Glpi\Exception\Http\AccessDeniedHttpException;
36+
use Glpi\Exception\Http\NotFoundHttpException;
3737

3838
// Send UTF8 Headers
3939
header("Content-Type: text/html; charset=UTF-8");
4040
Html::header_nocache();
4141

42-
Session::checkRight("config", READ);
42+
Session::checkRight("config", UPDATE);
4343

4444
$mailcollector = new MailCollector();
4545

46-
if (isset($_REQUEST['action'])) {
47-
switch ($_REQUEST['action']) {
48-
case "getFoldersList":
49-
// Load config if already exists
50-
// Necessary if password is not updated
51-
if (array_key_exists('id', $_REQUEST)) {
52-
$mailcollector->getFromDB($_REQUEST['id']);
53-
}
54-
55-
// Update fields with input values
56-
$input = $_REQUEST;
57-
58-
if (isset($input["passwd"])) {
59-
if (empty($input["passwd"])) {
60-
unset($input["passwd"]);
61-
} else {
62-
$input["passwd"] = (new GLPIKey())->encrypt($input["passwd"]);
63-
}
64-
}
65-
66-
if (!empty($input['mail_server'])) {
67-
$input["host"] = Toolbox::constructMailServerConfig($input);
68-
// In some case (like oauth imap) provide password is not possible
69-
// So, ask for password only if there is one stored in database and it's not an OAuth connection
70-
$is_oauth = !empty($input['server_type']) && str_contains($input['server_type'], 'oauth');
71-
if (!$is_oauth && !isset($input['passwd']) && !empty($mailcollector->fields['passwd'])) {
72-
$exception = new AccessDeniedHttpException();
73-
$exception->setMessageToDisplay(__('Password is required to list mail folders.'));
74-
throw $exception;
75-
}
76-
}
77-
78-
if (!isset($input['errors'])) {
79-
$input['errors'] = 0;
80-
}
81-
82-
$mailcollector->fields = array_merge($mailcollector->fields, $input);
83-
$mailcollector->displayFoldersList($_REQUEST['input_id']);
84-
break;
46+
if (isset($_REQUEST['action']) && $_REQUEST['action'] === 'getFoldersList') {
47+
// The collector must already exist in database.
48+
if (
49+
!array_key_exists('id', $_REQUEST)
50+
|| !$mailcollector->getFromDB($_REQUEST['id'])
51+
) {
52+
throw new NotFoundHttpException();
8553
}
54+
55+
$mailcollector->displayFoldersList($_REQUEST['input_id'] ?? '');
8656
}

composer.lock

Lines changed: 24 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)