Commit graph

885 commits

Author SHA1 Message Date
Alexander A. Klimov
844af8c17a Deprecate Module#provideHook() and Hook methods in favor of Hook\Essentials ones 2026-04-13 11:35:04 +02:00
Alexander A. Klimov
8533c5eea2 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-04-13 11:35:04 +02:00
Alexander A. Klimov
9fa78a1154 Use \Icinga\Application\Hook\Essentials in existing hooks 2026-04-13 11:34:47 +02:00
Alexander A. Klimov
ebc92b058c Introduce \Icinga\Application\Hook\Essentials 2026-04-13 11:34:47 +02:00
Eric Lippmann
b474b4347d Raise version to 2.13 2026-03-26 21:31:28 +01:00
Eric Lippmann
662de28f85 License source files as GPL-3.0-or-later
Add SPDX license headers and mark source files as GPL-3.0-or-later to
preserve the option to relicense under later GPL versions.
2026-03-26 17:49:26 +01:00
Eric Lippmann
eb378ca0dc
Replace incubator module with icinga-php-legacy library (#5484)
The `icinga-php-legacy` library is the successor to the standalone
`icingaweb2-module-incubator` module. Modules such as director and
vspheredb that still declare `incubator` as a dependency should load
without a separate incubator installation once `icinga-php-legacy` is
present.

`Module::getRequiredLibraries` now maps an `incubator` module
requirement to an `icinga-php-legacy` library requirement when that
library is available, and `getRequiredModules` drops `incubator` from
the list so the dependency check does not fail. `Manager::loadModule`
skips calling `register()` for the incubator module under the same
condition, folding that guard into the existing `ipl`/`reactbundle`
exclusion to avoid a double-registration.

https://github.com/Icinga/icinga-php-legacy replaces
https://github.com/Icinga/icingaweb2-module-incubator.
2026-03-26 17:23:38 +01:00
jrauh01
6ae99807b1
Add RequestHook (#5433) 2026-03-26 14:25:31 +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
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
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
Johannes Meyer
94561159a4 Raise version to 2.12.6 2025-11-18 17:35:08 +01:00
Alexander Aleksandrovič Klimov
2e164a75d4
Fix typo in code comment (#5327)
Co-authored-by: Johannes Meyer <johannes.meyer@icinga.com>
2025-08-22 12:01:01 +02:00
Jan Schuppik
ee3f3135b8 Fix: PHP built-in server detection for PHP 8.3 SERVER_SOFTWARE format 2025-08-20 09:30:54 +02:00
Johannes Meyer
5f602113ee Raise version to v2.12.5 2025-07-14 13:35:37 +02:00
Alexander Aleksandrovič Klimov
5333f2deb7
Disable deprecation warnings unless ICINGAWEB_ENVIRONMENT is set to "dev" (#5359)
in ApplicationBootstrap#setupErrorHandling(). In webrouter.php disable
them unconditionally (until ApplicationBootstrap#setupErrorHandling())
not to duplicate the check. ApplicationBootstrap#setupErrorHandling())
is called pretty early, so we won't miss much.

fixes #5117

* In addition, this provides #5269 and mitigates #5152 in production
where ICINGAWEB_ENVIRONMENT isn't set.
2025-05-05 17:58:28 +02:00
Johannes Meyer
e98a776509 Raise version to 2.12.4 2025-03-26 16:41:23 +01:00
Johannes Meyer
01fb35dd4a Raise version to 2.12.3 2025-03-26 10:31:04 +01:00
Johannes Meyer
b403918cc1 Raise version to 2.12.2 2024-11-13 09:59:05 +01:00
Johannes Meyer
b23cbd796f Raise version to 2.12.1 2023-11-15 12:22:46 +01:00
Yonas Habteab
bcdad8c9b3 MigrationManager: Enhance how pgsql privileges are checked
For mysql it's just enough to check whether the privileges are granted
at database or table label, but for PostgreSQL it's necessary that the
privileges are granted at database and at table level.
2023-10-26 17:07:17 +02:00
Yonas Habteab
a99f685d15 Add missing pgsql USAGE privilege 2023-10-26 17:07:17 +02:00
Johannes Meyer
21d631ad7e Raise version to 2.12.0 2023-09-21 16:35:31 +02:00
Yonas Habteab
c3eef5f607 DbMigrationHook: Pad matching groups to the desired length before using them 2023-09-20 15:35:39 +02:00
Johannes Meyer
9c6d930e17 MigrationManager: Also check table privileges 2023-09-19 14:37:55 +02:00
Yonas Habteab
167ff54947 Enhance logging 2023-09-19 14:37:55 +02:00
Yonas Habteab
47b214ee1b Use PDO::fetchColumn() where applicable 2023-09-19 14:37:55 +02:00
Yonas Habteab
2505e79a2d DbMigration: Check for mysql collation name whether to check 2.11 is migrated 2023-09-19 14:37:55 +02:00
Yonas Habteab
dc738ec4ce DbMigrationHook: Adjust regex pattern & add missing argument docs 2023-09-19 14:37:55 +02:00
Yonas Habteab
96a6321569 DbMigration: Adjust usage of Database::getDb() 2023-09-19 14:37:55 +02:00
Yonas Habteab
fac3855a86 DbMigrationStep: Don't cache sql statements unnecessarily 2023-09-19 14:37:55 +02:00
Yonas Habteab
26cae8b882 Rename MigrationHook -> DbMigrationHook 2023-09-19 14:37:55 +02:00
Yonas Habteab
ce89d4a7cb Rename Common\DbMigration -> DbMigrationStep 2023-09-19 14:37:55 +02:00
Yonas Habteab
2657f032dc Allow to automatically fix missing grants & elevalte database users
Co-authored-by: Johannes Meyer
2023-09-19 14:37:55 +02:00
Yonas Habteab
ac24c6d34b Don't traverse schema query if the last successfully migrated version is found 2023-09-19 14:37:55 +02:00
Yonas Habteab
73b1041816 Fix phpstan claims & php code sniffer errors 2023-09-19 14:37:55 +02:00
Yonas Habteab
13569a34b7 Check explicitly for false before raising an unknown error 2023-09-19 14:37:55 +02:00
Yonas Habteab
4b2784f85e Use Icinga Web as a component name 2023-09-19 14:37:55 +02:00
Yonas Habteab
2944ceaa52 Rename getSchemaQueryFor() & drop $version param 2023-09-19 14:37:55 +02:00
Yonas Habteab
ce012dcdb2 Hook: Don't abort loading remaining hooks due to one broken hook
`Hook::all()` shouldn't abort loading the remaining hooks when one of
the provided hook is broken.
2023-09-19 14:37:55 +02:00
Yonas Habteab
15792fb59a Provide DbMigration hook & register when bootstrapping 2023-09-19 14:37:55 +02:00
Yonas Habteab
81c9e5cfc5 Introduce MigrationManager class 2023-09-19 14:37:55 +02:00
Yonas Habteab
babc59437f Introduce base MigrationHook class & helpers 2023-09-19 14:37:54 +02:00
Eric Lippmann
b693369412 Fix class in Platform::hasOracleSupport() 2023-09-07 08:51:22 +02:00
Johannes Meyer
c027282d8c Test: Load a module's composer autoloader 2023-08-31 10:18:37 +02:00
raviks789
33b6c01fe2 Create fake session to write csp nonces to it
`Csp::createnonces()` writes to a window aware session and hence a fake base session
is created in `BaseTestCase::setUp()` method
2023-08-28 16:56:51 +02:00
Sukhwinder Dhillon
ee9d139a3a PhpDoc: Fix incorrect @param and @return type hints 2023-08-23 10:53:15 +02:00
Sukhwinder Dhillon
a88d0fe348 Web: Method hasAccessToSharedNavigationItem() requires param #2 of type Config 2023-08-23 10:53:14 +02:00