Commit graph

14255 commits

Author SHA1 Message Date
Alexander A. Klimov
d955987960 Deprecate Module#provideHook() and Hook methods in favor of Hook\Essentials ones 2026-03-26 15:25:04 +01:00
Alexander A. Klimov
1f5749a88b Use Hook\Essentials::all(), not Hook::all()
to ease finding usages and to be a good example for future hooks.

Same with `register()`, `first()` and `has()`.
2026-03-26 15:24:02 +01:00
Alexander A. Klimov
213a8f4afa Use \Icinga\Application\Hook\Essentials in existing hooks 2026-03-26 15:22:41 +01:00
Alexander A. Klimov
e0e9101f5e Introduce \Icinga\Application\Hook\Essentials 2026-03-26 15:13:50 +01:00
jrauh01
6ae99807b1
Add RequestHook (#5433) 2026-03-26 14:25:31 +01:00
Alexander Rieß
fce34897ac
Add disabled style to textareas (#5476)
Some checks are pending
L10n Update / update (push) Waiting to run
CI / PHP (push) Waiting to run
Use the same style for disabled textareas as other text input elements.
2026-03-25 15:28:06 +01:00
jrauh01
9f93d01d39
Improve title and label of user menu item in collapsed mode (#5412)
Remove `text-overflow: ellipsis` for user-nav-item link if sidebar is collapsed.
2026-03-25 15:24:09 +01:00
jrauh01
e83434d079
Tactical Overview: Add opacity on hover (#5400)
Add opacity on the big donut label if hovered.
2026-03-25 15:21:56 +01:00
jrauh01
158428fcae
Log user roles (#5311)
Log the roles assigned to a user during login in the debug log.
2026-03-25 15:19:54 +01:00
Eric Lippmann
ad8155431b
Support PHP 8.5 (#5454)
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
PHP 8.4:

- Change implicit nullable type declaration to explicit
- Only set `session.sid_bits_per_character` for PHP < 8.4 

PHP 8.5:

- Remove no-op `ReflectionProperty::setAccessible()` calls
- Replace backtick operator with `shell_exec()`
- Avoid passing `null` as key in `array_key_exists()`
- Avoid passing `null` to non-nullable parameters in built-in functions
- Use `Pdo\Mysql` driver-specific constants   

Other compatibility fixes:

- Avoid passing `null` as `ipl\Html` form element `$name`
- Use latest PHPUnit version
2026-03-20 15:21:44 +01:00
Bastian Lederer
9bd53accac Clean up and merge PHPStan baselines
Remove errors no longer reported. Since PHP 7.x is no longer supported, remove
the 7.x baseline. It is now no longer necessary to have multiple baseline
files.
2026-03-20 14:52:40 +01:00
Eric Lippmann
298f52456f Use Pdo\Mysql driver-specific constants
Replace deprecated `PDO::MYSQL_*` constant usage with the driver-specific
`Pdo\Mysql::ATTR_*` constants introduced in PHP 8.4.

This prepares the code for PHP 8.5, where accessing MySQL driver constants
through the generic `PDO` class is deprecated.

This change requires a compatibility shim on older PHP versions to provide
`Pdo\Mysql` for runtimes that do not expose the driver-specific class yet.  The
shim is provided in `ipl-sql`. As a consequence, the required version of the
Icinga PHP library has been raised.
2026-03-19 22:27:45 +01:00
Bastian Lederer
007abed960 Avoid passing null to non-nullable parameters in built-in functions
PHP 8.1 deprecated passing `null` to non-nullable parameters in built-in
functions (deprecated in 8.1, will become a `TypeError` in 9.0).
2026-03-19 22:27:45 +01:00
Eric Lippmann
1c4460c67a tests: Use latest PHPUnit version 2026-03-19 22:27:45 +01:00
Bastian Lederer
21b50939e5 Avoid passing null as ipl\Html form element $name
Forward compatibility fix: `ipl\Html` will introduce strict types, which
declares `$name` as string. Passing `null` will result in a `TypeError` once
strict types are enforced.
2026-03-19 22:27:41 +01:00
Bastian Lederer
5b2747e9cd Only set session.sid_bits_per_character for PHP < 8.4
PHP 8.4 has deprecated `session.sid_bits_per_character` along with
`session.sid_length`, as part of a broader effort to standardize session ID
generation for improved security and interoperability.
2026-03-10 16:40:27 +01:00
Bastian Lederer
f868f4d9d6 Avoid passing null as key in array_key_exists()
Calling `array_key_exists()` with a `null` key is deprecated as of PHP 8.5.
2026-03-10 16:40:27 +01:00
Bastian Lederer
d6f6afbe45 Replace backtick operator with shell_exec()
The backtick operator is deprecated as of PHP 8.5.
2026-03-10 16:40:27 +01:00
Bastian Lederer
e9f6c7721d Remove no-op ReflectionProperty::setAccessible() calls
`ReflectionProperty::setAccessible()` has had no effect since PHP 8.1, as all
properties are accessible via reflection by default. The method is deprecated
as of PHP 8.5.
2026-03-10 16:40:27 +01:00
Bastian Lederer
ea0ce32bc9 Change implicit nullable type declaration to explicit
Since PHP 8.4 implicitly nullable parameter types are deprecated.

Normalize scoped PHPDoc for nullable-parameter updates: use `?Type` instead of
`Type|null`, remove column alignment, and indent continuation lines with 2
spaces.

Co-authored-by: "Eric Lippmann <eric.lippmann@icinga.com>"
2026-03-10 16:40:27 +01:00
Alexander Aleksandrovič Klimov
bc2d4a51c7
Shorten AuthenticationHook#onLogin() doc to avoid confusion (#5465)
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
"even if already authenticated in Icinga Web" already made one colleague
thinking `onLogin()` is called even during authentication from session.
Latter is not true and not desired by hook providers, e.g.
`icinga-notifications-web`.

Currently, as authenticated user, I can't even use
`/authentication/login`. It redirects me to the dashboard.
2026-03-10 15:51:33 +01:00
Alexander Aleksandrovič Klimov
4037eb51b1
LoginButtonHook: Support additional buttons below the login form (#5442)
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
Introduces `LoginButtonHook`, a new hook for rendering additional buttons
below the login form. Extend this class to display custom buttons on the
Icinga Web login page — useful for alternative authentication flows such
as SSO. Register your implementation by calling
`YourLoginButtons::register()` during module initialization.
2026-03-04 15:32:06 +01:00
Johannes Meyer
bfbab2120e modules: Remove test module
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
Just run `phpunit` in the repo's base, please
2026-02-26 16:14:10 +01:00
jrauh01
33f0c4eba3
Use NotWritableError for ini config (#5404)
Replaced the unused `Zend_Config_Exception` with a more appropriate
`NotWritableError` in `IniWriter::write()`.

- The old `Zend_Config_Exception` was never caught anywhere in the
codebase.
- Changed to `NotWritableError` to better reflect file permission and
write issues.
- Added `@` suppression to the `file_put_contents()` call so that the
method can throw `NotWritableError` instead of crashing on PHP warnings.
2026-02-26 12:33:54 +01:00
Eric Lippmann
ae4e7bfe14 GitHub Actions: Automatically close stale issues per schedule
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
2026-02-20 14:28:48 +01:00
Eric Lippmann
a73cd1c758
Introduce AuthenticationHook#onAuthFromSession() (#5467)
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
Especially useful for code not for ApplicationStateHook due to the fact
that a user can block requests to /application-state.
2026-01-28 09:59:08 +01:00
Alexander A. Klimov
352c79faf4 Introduce AuthenticationHook#onAuthFromSession()
Especially useful for code not suitable for ApplicationStateHook due to the fact that a user can block requests to /application-state.
2026-01-13 15:21:09 +01:00
Eric Lippmann
cda8fc28a0
Require PHP 8.2 (#5444)
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
2026-01-07 13:37:54 +01:00
Eric Lippmann
2597297442
Remove monitoring module (#5458)
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled
Will be moved to https://github.com/Icinga/icingaweb2-module-monitoring.
2025-12-12 11:36:08 +01:00
Eric Lippmann
ca76cc5f86
GitHub Actions: Use new PHP workflows (#5431)
This PR switches to the new PHP workflow, which combines linting, static
analysis, and unit testing.
2025-12-12 11:04:49 +01:00
Eric Lippmann
8d3258735b GitHub Actions: Use new PHP workflows 2025-12-11 11:43:30 +01:00
Sukhwinder Dhillon
9603ca507b Remove monitoring module
- It has been moved to https://github.com/Icinga/icingaweb2-module-monitoring
2025-12-08 14:40:49 +01:00
Eric Lippmann
3b732c3ff9
Replace outdated test setup code with composer.json (#5445)
Some checks failed
L10n Update / update (push) Has been cancelled
PHP Tests / Static analysis for php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.4 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.4 on ubuntu-latest (push) Has been cancelled
This is preparation for a GitHub action to streamline tests, which
* expects the `phpunit.xml` configuration at the root level, and
* installs dependencies via `composer`.

Proof that the same number of tests are run after moving the
configuration file:
*
[main](https://github.com/Icinga/icingaweb2/actions/runs/18972121136/job/54182208796#step:6:243)
* [this
PR](https://github.com/Icinga/icingaweb2/actions/runs/19137281980/job/54692472598#step:6:243)

Rationale for introducing `composer`:

GitHub Actions for this repository and any other module that requires
Mockery must specify this dependency themselves. Module tests require
Icinga Web anyway, so all (development) dependencies and any changes to
them should be automatically applied instead of having to adjust each
individual module affected. If we eventually upload our library bundles
to Packagist as well, we could also specify them in `composer.json` once
instead of having to require them in every action.
2025-12-05 15:17:37 +01:00
Johannes Meyer
70f29827f9
Release v2.12.6 (#5452)
Some checks failed
L10n Update / update (push) Has been cancelled
PHP Tests / Static analysis for php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.4 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.4 on ubuntu-latest (push) Has been cancelled
2025-11-18 18:00:01 +01:00
Johannes Meyer
c6cdb5bb0b Update CHANGELOG.md 2025-11-18 17:52:52 +01:00
Johannes Meyer
94561159a4 Raise version to 2.12.6 2025-11-18 17:35:08 +01:00
Johannes Meyer
8b1db402f1 Update AUTHORS and .mailmap 2025-11-18 17:32:57 +01:00
Gianluca Piccolo
eae7222ac7 Fix: add login hook to ext backends
Some checks failed
L10n Update / update (push) Has been cancelled
PHP Tests / Static analysis for php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.4 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.4 on ubuntu-latest (push) Has been cancelled
2025-11-13 09:20:43 +01:00
Johannes Meyer
a5452793f4
Fix mobile/minimal layout layout (#5381)
fix #5386, fix #5023
2025-11-13 09:13:25 +01:00
Sukhwinder Dhillon
f7558d9606 responsive.less: Show expanded sidebar in full height in .minimal-layout 2025-11-12 12:50:53 +01:00
Sukhwinder Dhillon
c03df0a0f8 responsive.less: Don't show scrollbar in .minimal-layout when sidebar is collapsed 2025-11-12 12:50:53 +01:00
Eric Lippmann
17e191a298 Add Dependabot for composer 2025-11-06 14:56:26 +01:00
Eric Lippmann
eabb806f54 Remove obsolete method BaseTestCase::assertMatchesRegularExpression()
Else, tests with current PHPUnit versions fail with `Cannot override final
method PHPUnit\Framework\Assert::assertMatchesRegularExpression()`.
2025-11-06 14:35:55 +01:00
Eric Lippmann
40afb26b61 Replace outdated test setup code with composer.json
Also, we could require our PHP libraries as soon as we have uploaded them to
Packagist.
2025-11-06 14:35:55 +01:00
Eric Lippmann
4fb99c2f77 Move phpunit.xml
This is preparation for a GitHub action to streamline tests, which expects the
`phpunit.xml` configuration at the root level.
2025-11-06 13:55:19 +01:00
Alexander A. Klimov
23288ce749 Require PHP 8.2 2025-11-06 10:28:51 +01:00
Johannes Meyer
9b63928573 js: Do not fail while trying to detect autosubmit element
Some checks failed
L10n Update / update (push) Has been cancelled
PHP Tests / Static analysis for php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.4 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.4 on ubuntu-latest (push) Has been cancelled
fixes #5439
2025-10-31 13:10:48 +01:00
Eric Lippmann
326616c965
Rename rule: ignore NotPascalCase in views/helpers (#5432)
Some checks failed
L10n Update / update (push) Has been cancelled
PHP Tests / Static analysis for php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.4 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.4 on ubuntu-latest (push) Has been cancelled
PHP_CodeSniffer 4.0 renamed the class name NotCamelCaps to
NotPascalCase.
Reference:
https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Version-4.0-User-Upgrade-Guide#upgrading-5

Because of this change, our current configuration was no longer
compatible.
I tested the update inside a Docker container: after switching to the
new class name `NotPascalCase`, the error message disappeared and the
rules are applied as expected.
2025-10-09 10:39:31 +02:00
Jolien Trog
d45d61dacd Rename rule: ignore NotPascalCase in views/helpers
PHP_CodeSniffer 4.0 renamed the class name NotCamelCaps to
NotPascalCase.
2025-10-08 16:09:22 +02:00
Markus Opolka
d658c73c73 doc: Add vSphere CSP support release 2025-09-09 10:09:59 +02:00