Commit Graph

4361 Commits

Author SHA1 Message Date
Johannes Meyer 36d4e6db29 Response: Fix backwards compatibilty for `__CLOSE__`
If the redirect target changes, `__CLOSE__` has no effect

fixes #5081
2023-09-07 13:51:55 +02:00
Eric Lippmann b693369412 Fix class in `Platform::hasOracleSupport()` 2023-09-07 08:51:22 +02:00
Johannes Meyer d8e313af6c JsonResponse: Fix documentation of `sendResponse` 2023-09-05 16:19:41 +02:00
Johannes Meyer c027282d8c Test: Load a module's composer autoloader 2023-08-31 10:18:37 +02:00
Sukhwinder Dhillon f283c81ed2 ActionController: Always read icingaweb config for csp
Method `$this->Config()` returns config based of current module.
2023-08-30 10:04:46 +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
raviks789 282b4d564a Add `style` element to SVGs
The ruleset returned by `Styleable::getStyle()` is added to the SVG.
2023-08-28 16:56:51 +02:00
raviks789 97a14d7b18 Modify `Styleable` to avoid using static inline styles
To prevent CSP violation the following changes has been made in `Styleable::class`:
1) `Styleable::getStyle()` method is modified to return `ipl\Web\Style::class`
2) `Styleable::additionalStyle` property type is changed to array
3) `Styleable::setAdditionalStyle()` parameter type is changed to array
2023-08-28 16:56:49 +02:00
raviks789 33a5f765b9 Use `style` element to create css class for dynamic inline style
The `style` element with `nonce` attribute is used to create css classes for
inline styles that are not static. This prevents Content-Security-Policy violations.
2023-08-28 16:40:33 +02:00
raviks789 459f4198c3 Replace static inline styles with css class
The static inline styles are replaced with css class to avoid Content-Security-Policy violations.
2023-08-28 16:30:12 +02:00
Johannes Meyer e3ebe109eb Enable strict CSP if configured 2023-08-28 12:42:32 +02:00
Eric Lippmann 1cd1b500b3 Add helper to enable strict CSP 2023-08-28 12:42:32 +02:00
Sukhwinder Dhillon 3f3f0a1f67 GlobFilter::__construct(): Add possible param type hint 2023-08-23 11:37:00 +02:00
Yonas Habteab a82e3b2320 Stylable: Fix `strokeWidth` type hint declaration 2023-08-23 10:53:15 +02:00
Yonas Habteab a965b5c44b Fix argument type hints 2023-08-23 10:53:15 +02:00
raviks789 19151763af `UrlParams`: Fix parameter types of `addValues()` method 2023-08-23 10:53:15 +02:00
raviks789 eed1b0a680 `Url`: Fix type of parameter `$values` of `with()` method 2023-08-23 10:53:15 +02:00
Sukhwinder Dhillon fd984c5798 Loader: Fix `Variable '$obj' is probably undefined` 2023-08-23 10:53:15 +02:00
Sukhwinder Dhillon 907486ccac NavigationItemRenderer::setOptions(): Add missing return statement 2023-08-23 10:53:15 +02:00
Sukhwinder Dhillon 66c4fc404e LocalFileStorage::create(): Add missing return statement 2023-08-23 10:53:15 +02:00
Sukhwinder Dhillon ee9d139a3a PhpDoc: Fix incorrect `@param` and `@return` type hints 2023-08-23 10:53:15 +02:00
Sukhwinder Dhillon 5e671e02af Wizard: Fix throw exception 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 302bf3ef54 Tabs: Add `$tab_class` explicitly as non-dynamic property 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 30b91b9cd2 Tabs: Method `render()` does not expect any param and import missing Exception class 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 29b2ed22b9 AbstractWidget: Method `render()` does not expect any param 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon e2e582b095 Navigation/-Item: Fix `Variable '$classPath' is probably undefined` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon eeff32d4ce AuthBackendController: Fix `Variable '$backend' is probably undefined` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon d8fe09f368 DirectoryIterator: Fix `Variable '$path' is probably undefined` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon bdddb88164 DbRepository: Function `type()` does not exist, it should be called `gettype()` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon d24cd0bf09 Root: Fix `Variable '$child' is probably undefined` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon be241d5b4e LdapQuery: Remove obsolete code 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon a7a94d5307 FileReader: Method `count()` require no param 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon bdd50bd97d IniWriter: Variable $dangling is always set, but can be empty 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 80b76c6f7d IcingaException: Fix `Variable '$index' is probably undefined` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 6baf3bc80a DateFormatter: Fix `Variable '$formatted' is probably undefined` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon dbc8579747 Loader: Define variable $first in method scope 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 53b9774874 Documentation: Add `$app, $loader` explicitly as non-dynamic property 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon d13f52c1b2 Documentation: Fix `Variable '$obj' is probably undefined` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon a4744833bc Command: Add PhpDoc 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 1c06aad72f StaticAxis: Fix incorrect return type of methods 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 1271aa8480 (Calender|Logarithmic)Unit: Define return type of overridden methods from `Iterator` interface 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 2e7d6b43e5 Rect: Fix incorrect name case of class import 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 9c77da0894 LineGraph: Add and explicitly as non-dynamic property 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon b68eb40103 (Bar/Line)Graph: Fix `Variable '$ts' is probably undefined` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon e3b89184ae UserGroupBackend: Fix `Variable '$backend' is probably undefined` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 61b827a43c DbUserGroupBackend: Remove unnecessary (! $groupName) check 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 54b3539896 UserBackend: Fix `Variable '$backend' is probably undefined` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 2626d42c54 LdapUserBackend: Import missing `Exception` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon a88d0fe348 Web: Method `hasAccessToSharedNavigationItem()` requires param #2 of type Config 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon e3036c41a2 Web: Add `$accessibleMenuItems` explicitly as non-dynamic property 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 391eede52f StderrWriter::log(): Fix `Variable '$color' is probably undefined` 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon 8358dc1c5e Hook::has(): Method expects only one parameter 2023-08-23 10:53:14 +02:00
Sukhwinder Dhillon a0ed272cb8 ApplicationBootstrap: Fix method name case 2023-08-23 10:53:14 +02:00
raviks789 c4a3cee94a `UrlParams`: Fix type for parameter `$default` of method `get()`
The parameter `default` can be null, string, int or bool.
2023-08-23 10:53:14 +02:00
raviks789 d6fd3a97ca `DbRepository`: Import exception `QueryException` 2023-08-23 10:53:14 +02:00
raviks789 c46446e17f `Url`: Fix type for parameter `$value` of method `setParam()` 2023-08-23 10:53:14 +02:00
raviks789 2a4f448c3e `Url`: Use `Icinga\Web\Request` instead of `Zend_Request` or `Zend_Abstract_Request` 2023-08-23 10:53:14 +02:00
raviks789 a317c5981f `Discovery`: Fix return type of the static method `discover()` 2023-08-23 10:53:14 +02:00
raviks789 4acee8ab06 `Inspection`: Fix return type of method `error()` 2023-08-23 10:53:14 +02:00
raviks789 e946ed1f0e `UrlParams`: Fix type for parameter `$default` of method `getValues()` 2023-08-23 10:53:14 +02:00
raviks789 d5e93a9d68 `UrlParams`: Fix type for parameter `$value` of method `add()`
The parameter `$value` can be null, string or bool.
2023-08-23 10:53:14 +02:00
raviks789 58938f6636 `Config`: Import exception `NotWritableError` 2023-08-23 10:53:13 +02:00
raviks789 1b9d977da4 `Config`: Fix parameter type for `$fromDisk` of method `module()` 2023-08-23 10:53:13 +02:00
raviks789 b585ed25df `LdapUserGroupBackend`: Update PHPDoc for method `retrieveUserName()` 2023-08-23 10:53:13 +02:00
raviks789 11c7f913c8 `Benchmark`: Define parameter `$what` as nullable 2023-08-23 10:53:13 +02:00
raviks789 dd8875f99f `ConfigFormEventsHook`: Use `self` to access static property `$lastErrors` 2023-08-23 10:53:13 +02:00
raviks789 2265b9d27b `LegacyWeb`: Import `Exception` class 2023-08-23 10:53:13 +02:00
raviks789 1c0480d484 `Module`: Use correct name case for `Web::getFrontController()` method 2023-08-23 10:53:13 +02:00
raviks789 381aee94d1 `LdapUserBackend`: Import exception `QueryException`
Method `LdapUserBackend::requireQueryColumn()` throws exception `QueryException`
2023-08-23 10:53:13 +02:00
raviks789 2b60a86731 `Animation`: Use correct name case for `DOMElement::setAttribute()` 2023-08-23 10:53:13 +02:00
raviks789 e1fd5c8500 `PieSlice`: Use correct name case for `RenderContext::yToRelative()` 2023-08-23 10:53:13 +02:00
raviks789 fb92c9b70a `DbQuery`: Import required class `Zend_Db_Adapter_Abstract` 2023-08-23 10:53:13 +02:00
raviks789 08e57939f2 `TreeNodeIterator`: Fix type for property `$children` 2023-08-23 10:53:13 +02:00
raviks789 e2ac5c9b08 `Section`: Fix type for property `$commentPost` 2023-08-23 10:53:13 +02:00
raviks789 ceead3dee2 LdapCapabilities: Use correct name case for generic class `stdClass` 2023-08-23 10:53:13 +02:00
raviks789 677a32545b `DbRepository`: Use correct name case for `RepositoryQuery` in `joinColumn()` method 2023-08-23 10:53:13 +02:00
raviks789 201706614d `Repository`: Return null if conversion rules is empty in `getConverter()`
In case the conversion rules to apply on the repository query is not defined
return null in `Repository::getConverter()`.
2023-08-23 10:53:13 +02:00
raviks789 aa5db51e77 `Repository`: Use correct name case for `DateTime::getTimestamp()` in `retrieveGeneralizedTime()` method 2023-08-23 10:53:13 +02:00
raviks789 22c790ea48 `ActionControlle`: Avoid void return in `__call()` magic method 2023-08-23 10:53:13 +02:00
raviks789 6b0244f247 `ActionController`: Declare property `$view` 2023-08-23 10:53:13 +02:00
raviks789 2db4e35b78 `Button`: Import class `Zend_Config`
The parameters for the constructor can be of type `Zend_Config`. Hence the class has been imported.
2023-08-23 10:53:13 +02:00
raviks789 f05d76e05e `FormElement`: Fix the return type of `loadDefaultDecorators()` 2023-08-23 10:53:13 +02:00
raviks789 4108b6b4cc `Navigation`: Cast string to int to perform addition
In `library/Icinga/Web/Navigation/Navigation::merge()` the result of `preg_match`
must be cast to int before adding 1 to it.
2023-08-23 10:53:13 +02:00
raviks789 fdddc21bc8 `View`: Define parameter `$var` for `escape()` as nullable 2023-08-23 10:53:13 +02:00
raviks789 bf5aa41d63 `Widget`: Imported class `AbstractWidget`
The return type of static method `Widget::create()` is `AbstractWidget` instance.
Hence it is imported in `Widget::class`.
2023-08-23 10:53:13 +02:00
raviks789 1d8ce55262 `AbstractWidget`: Import class `Zend_View_Abstract`
Since static property `AbstractWidget::view` is of type `Zend_View_Abstract` instance. The
class needs to be imported.
2023-08-23 10:53:13 +02:00
raviks789 daddfe11b5 `Tab`: Fix type of property `$url`
`$url` can either be a string or `Icinga\Web\Url` instance.
2023-08-23 10:53:13 +02:00
raviks789 3b707fb6ab `Wizard`: Fix return type for method `getPage()`
The method `Wizard::getPage()` could also return `ModulePage` instance. Hence it is included as one of the
return type of this method.
2023-08-23 10:53:13 +02:00
raviks789 bd0fb8c154 Remove the use of unavailable property `$this->lessc->importDisabled`
The functionality to set import to disabled is removed in `lessc`. Hence the code where this
property is used has been removed from `LessCompiler`.
2023-08-23 10:53:13 +02:00
raviks789 8e3c456327 Fix parameter name mismatch in `View::escape` method
The mismatch arises after migration from ZF1 to ZF-future.
2023-08-23 10:53:13 +02:00
raviks789 695fe25891 Remove dead code from `Visitor.php`
The method `Visitor::visitColor` seems like a dead code and contains dynamic property
allocation. Hence, this method has been removed.
2023-08-23 10:53:13 +02:00
raviks789 825f3a9b7f Avoid use of dynamic properties deprecated in PHP 8.2 2023-08-23 10:53:13 +02:00
Alexander A. Klimov 6de4bd6e7e Explicitly add Module#configdir as (non-dynamic) property
W/o this the login page, if on PHP 8.2, says:

Deprecated: Creation of dynamic property Icinga\Application\Modules\Module::$configdir is deprecated in /usr/share/icingaweb2/library/Icinga/Application/Modules/Module.php on line 264

This breaks modules (if any) which use the property and not the getter.
2023-08-23 10:53:13 +02:00
Sukhwinder Dhillon 847ba4f395 PdfExport: Fix false positive `! empty($this->content)` 2023-08-22 12:44:46 +02:00
raviks789 8b99852fc2
Remove unused `FilterWidget::class` (#5061) 2023-08-21 15:35:17 +02:00
Johannes Meyer 4a52a653e4 js: Always load redirects to their designated target
The server applies the redirection magic now, but only
for compatibility reasons.

resolves #4881
2023-08-11 16:08:00 +02:00
Johannes Meyer 65b3006adf Check if `\Throwable` instead of `\Exception`..
..everywhere else...

fixes #5079
2023-08-10 14:12:06 +02:00
Johannes Meyer 0a6db983f3 IcingaException: Expect `\Throwable` instead `\Exception` 2023-08-09 15:53:49 +02:00
raviks789 8a17c56345 Remove requiring vendor dependencies
Also avoid autoloading vendor.
2023-08-09 15:16:16 +02:00
raviks789 50bd5cfdc9 Remove `librarary/vendor` directory
The vendor dependencies will be moved to `composer.json` in `icinga-php-thirdparty`.
2023-08-09 15:16:16 +02:00