Commit Graph

4273 Commits

Author SHA1 Message Date
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
Johannes Meyer 597cb5c94d tests: Use a real app for bootstrapping
Makes the tests less isolated, but streamlines
the autoloading and other stuff in a way that's
more maintainable than before.
2023-07-05 09:24:49 +02:00
Johannes Meyer 82d39be642 BaseTestCase: Refactor request and response mocking 2023-07-04 17:05:06 +02:00
Johannes Meyer 08bfc4f596 BaseTestCase: Drop timezone setup, the app will do it 2023-07-04 17:05:06 +02:00
Johannes Meyer 531479a92e BaseTestCase: Deprecate directory properties 2023-07-04 17:05:06 +02:00
Johannes Meyer 3f447cb954 BaseTestCase: Remove `t` and `mt` function declarations 2023-07-04 17:05:06 +02:00
Johannes Meyer e7adc06497 ApplicationBootstrap: Process `ICINGAWEB_MODULES_DIR` by default 2023-07-04 16:08:41 +02:00
Sukhwinder Dhillon 5000d3117b IcingaException: Only use `vsprintf()` if `$args` given
If the passed message contains a `%`, but no `$args`, `vsprintf()` throws an error.
2023-06-22 15:03:14 +02:00
raviks789 f74041e00a Javascript: Add `copy-to-clipboard` behavior
Utilizes `CopyToClipboard.js` from ipl-web
2023-06-20 12:06:27 +02:00
Johannes Meyer 693bed1710 Raise version to 2.11.4 2023-01-26 09:42:18 +01:00
Johannes Meyer 0803a1bbdc test: Support multiple paths in `ICINGAWEB_MODULES_DIR` 2023-01-18 12:07:11 +01:00
Yonas Habteab 6d2a585de9 TemporaryLocalFileStorage: Fix unexpected crash in destructor 2023-01-16 14:15:43 +01:00
Johannes Meyer 8837fea7a4 Libraries: Only attempt a partial match if the library name contains a slash
fixes #4971
2023-01-12 09:54:42 +01:00
Valentina Da Rold 963c3168b1 Check if url is external in validation function
refs: #4970
2023-01-11 14:09:43 +01:00
Johannes Meyer d0a83a646c Release version 2.11.3 2022-12-14 13:21:01 +01:00
Johannes Meyer f67499c74d Pdf: Use dompdf's new autoloader 2022-12-07 15:03:58 +01:00
Johannes Meyer b89da2f865 Visitor: Force light mode when printing pages 2022-12-07 11:57:48 +01:00
Johannes Meyer b1574e4bee ConfigMenu: Fix incorrect shared navigation url
fixes #4953
2022-12-07 11:57:23 +01:00
Johannes Meyer 3187a4e549 InternalUrlValidator: Also check the scheme 2022-12-07 11:56:43 +01:00
mrzo2s45 bdb9fd299b Fix missing escape of double quotes in CSV output.
refs #4910
2022-11-07 12:59:28 +01:00
Johannes Meyer 6ef968bb96 Raise version to v2.11.2 2022-11-04 12:14:40 +01:00
Yonas Habteab 8cb0976c5b CommentParser: Wrap descriptions after the available screen columns
Well, what should I say, the PHP code sniffer allows us up to 120 characters
line length and when you code/format based on these rules, e.g the description
of a cli command, it will mess everything up when you run `icingacli module --help`.
So, we can just wrap the output after the available screen columns.
2022-10-25 08:47:38 +02:00
Johannes Meyer 314545f3a7 PrivilegeAudit: Expand defined privileges when exporting to PDF
refs #4862
2022-10-10 10:42:45 +02:00
Johannes Meyer 503f9b7316 PrivilegeAudit: Use the `<details>` tag 2022-10-10 10:42:45 +02:00
Johannes Meyer 78f5fd4648 Dashlet: Drop `view` parameter from title urls
refs https://github.com/Icinga/icingadb-web/issues/463
2022-10-10 10:39:47 +02:00
Eric Lippmann c133cbe4f8
Fix LDAP pagination for PHP7.3+ (#4901)
* Ldap: Read and update cookie values for paged requests also with PHP 7.3+

* Ldap: Provide server-side sort control directly with the request with PHP 7.3+
2022-10-10 09:55:47 +02:00
Johannes Meyer 225d43b45f Release version 2.11.1 2022-07-06 14:48:48 +02:00
Sukhwinder Dhillon 21e4c68a58 Format.php: Handle null values 2022-07-06 14:43:16 +02:00
Sukhwinder Dhillon f0f2835708 Module: Don't pass null as param to `class_exists()` 2022-07-05 15:42:15 +02:00
Johannes Meyer 947aa91c48 DbQuery: Don't call `timestampForSql()` in `valueToTimestamp()`
We can't call it implicitly, not all filter columns support
date time strings, especially in postgresql..
2022-07-05 09:55:32 +02:00
Johannes Meyer dcf194bc4c Raise version to 2.11.0 2022-06-30 13:47:07 +02:00
Yonas Habteab c29ac9842d Call: Don't precompile arg values when it's not an array
The CSS/LESS callable argument values may not always be an array, but also an object or whateever,
in this case we don't need to precompile the values as they could never be a variable.
2022-06-30 12:15:01 +02:00
Yonas Habteab 9ac1a00e94 Remove some unused codes & adjust the license headers 2022-06-30 12:15:01 +02:00
Yonas Habteab 5a04480245 Check for deferred color prop when defining variable variable & some fixlets for naming issue 2022-06-30 12:15:01 +02:00
Yonas Habteab a2932bd5ce Visitor: Transform less tree calls & variable definitions into our own classes 2022-06-30 12:15:00 +02:00
Yonas Habteab 7ac2dccbd1 Introduce `DeferredColorProp` class 2022-06-30 12:15:00 +02:00
Yonas Habteab b10261b444 Introduce own `Call` class for less tree calls 2022-06-30 12:15:00 +02:00
Johannes Meyer 95ea071a89 DbQuery: Accept any type in method `valueToTimestamp()` 2022-06-30 08:37:14 +02:00
Sukhwinder Dhillon 3482ef9e65
Fix that navbar forgets active state after refresh (#4831) 2022-06-29 14:58:02 +02:00
Johannes Meyer db2c30d418 ConfigMenu: Use absolute URLs in nav items 2022-06-15 08:39:55 +02:00
Johannes Meyer 457eb52e2c ConfigMenu: Add missing application_log entry
fixes #4824
2022-06-15 08:39:09 +02:00
Johannes Meyer c65ba3c2fc Stylesheet: Don't parse library CSS as LESS 2022-06-14 15:12:26 +02:00
Johannes Meyer 0490a2dfe4 Drop class `Icinga\Web\Hook\GrapherHook` 2022-06-14 14:24:30 +02:00
Johannes Meyer d25854ebce Drop class `Icinga\Web\Hook\TicketHook` 2022-06-14 14:24:30 +02:00
Johannes Meyer 9ef344d3b2 Really mark class `Icinga\Web\Hook` deprecated -.-
I would have removed it, but the deprecation notice wasn't
defined properly and so not visible for more than six years.
Now even our own projects make still use of it thoroughly..
2022-06-14 14:24:30 +02:00
Johannes Meyer f8e1137060 Remove restriction macro `user:local_name` 2022-06-14 14:24:30 +02:00
Johannes Meyer 46a21d9709 Drop method `DbQuery::whereToSql()`
It's been used by `DbQuery::renderFilter()` rather
exclusively. So if removing one, both need to go.
2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon 846a90301d DbQuery: Replace deprecated method `renderFilter()` and remove it 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon bba77b52e7 LdapConnection: Remove deprecated method `connect()` 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon b47298fffe SimpleQuery: Remove deprecated method `paginate()` 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon 8f0ac0492d Replace deprecated method `DbConnection::getConnection()` with `DbConnection::getDbAdapter()` 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon aded6a055e DbConnection: Remove deprecated method `getConnection()` 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon eb768b4fce Remove deprecated method `ApplicationBootstrap::setupZendAutoloader()` and its uses 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon 58ac2a97c2 InlinPie: Remove deprecated method `disableNoScript()` 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon a9af8f2e1a Url: Remove deprecated methods `setBaseUrl()` and `getBaseUrl()` 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon 55d23a531f Module: Remove deprecated method `registerHook()` 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon 479bec6fb4 ApplicationBootstrap: Remove deprecated method `listLocales()` 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon b1f723318f Web: Remove deprecated method `getMenu()` 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon 8fc50645c4 AesCrypt: Remove deprecated methods `encryptToBase64()` and `decryptFromBase64()` 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon 3113dc06ac Remove deprecated class `Icinga/Util/Translator` 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon 423c58d710 Remove deprecated class `Icinga/Util/String` 2022-06-14 14:24:30 +02:00
Johannes Meyer 60938b58c6 Remove jQuery
It's now part of icinga-php-thirdparty
2022-06-14 14:07:20 +02:00
Sukhwinder Dhillon a38d5ccac6 Revert "Form: Process request parameter _frameUpload"
This reverts commit fc481e527b.
2022-06-13 15:50:52 +02:00
Sukhwinder Dhillon e4450e7368 Revert "js: Don't serve scripts utilizing ECMA2016+ features"
This reverts commit 4d4f5b3a69.
2022-06-13 15:50:52 +02:00
Sukhwinder Dhillon f1e8280c3e Revert "Don't support dark/light mode for IE"
This reverts commit baeca33789.
2022-06-13 15:50:52 +02:00
Johannes Meyer d663fe84c3 DbConnection: Fix that unequal is handled as equal...
refs #4814
2022-06-13 15:05:24 +02:00
Johannes Meyer 1bee2db583 DbConnection: Only ignore the `*` for equal/unequal conditions
fixes #4813
2022-06-13 14:38:51 +02:00
Sukhwinder Dhillon c0d247613d Manager: Ensure enableModule dir has correct permission when created 2022-06-13 11:44:40 +02:00
Yonas Habteab 8e6d4a6b46 LinearUnit: Make Iterator methods compatible with the parent methods 2022-06-02 16:19:42 +02:00
Yonas Habteab 4782df4fee Form: Fix don't pass null values to strtolower() error 2022-05-30 14:00:01 +02:00
Yonas Habteab 2279502265 SingleValueSearchControl: Add default class to the search suggestions 2022-05-27 14:26:16 +02:00
Sukhwinder Dhillon 26f3fa0dc1 PdfExport: Show decoded url in pdf footer 2022-05-27 14:20:15 +02:00
Sukhwinder Dhillon aad2419545 Remove obsolete `config_backend` option and not required code
The user preferences backend is now always a `db`.
2022-05-27 14:02:11 +02:00
Sukhwinder Dhillon e7c368b09d PreferencesStore: Fix syntax 2022-05-27 14:02:11 +02:00
Sukhwinder Dhillon 0eb3b27e68 PreferencesStore: Remove not required method `setTable()` 2022-05-27 13:55:48 +02:00
Sukhwinder Dhillon fa7f100c03 PreferencesStore: Add new syntax 2022-05-27 13:55:48 +02:00
Sukhwinder Dhillon 566f5db8cf Add all `DbStore.php` class code to `PreferencesStore.php`
Remove `DbStore.php`

Since all user preferences must be stored in the database, it is
not necessary to have a child class.
2022-05-27 13:55:48 +02:00
Sukhwinder Dhillon 8ff1a22df7 Set preferences store type to `Db` and make it non-configurable 2022-05-27 13:55:48 +02:00
Sukhwinder Dhillon 9c6fda7b33 Remove `IniStore.php` 2022-05-27 13:55:48 +02:00
Yonas Habteab 340364ee9c Json: Fix trying to decode null data deprecation error 2022-05-24 14:49:07 +02:00
Johannes Meyer 74022ae4e0
Merge pull request #4697 from Icinga/feature/redesigned-user-menu-new
Feature/redesigned user menu
2022-05-16 09:04:26 +02:00
Johannes Meyer 644d5eaba7 DbConnection: Ensure compat with PHP 8.1 in `renderFilterExpression` 2022-05-13 16:54:19 +02:00
Johannes Meyer 03e7041ccb DbConnection: Support wildcards in arrays in `renderFilterExpression` 2022-05-13 16:54:19 +02:00
raviks789 8898ed85ab Change FilterMatch to FilterEqual class for single object filter on object name.
Correspondingly the DbConnection::renderFilter() (as DbQuery::renderFilter() is deprecated and will be removed, hence no modifications here)
is also modified to render accordingly.
This correctly selects the host, service or contact in case the object name contains wild card characters like "\*".
2022-05-12 16:28:35 +02:00
Florian Strohmaier df788ac0ef BadgeNavigationItemRenderer: Add `$cssClass` on autorefresh 2022-05-12 15:13:16 +02:00
Florian Strohmaier c68fbb662e Menu.php: Add classes for nav-items to only be shown on mobile 2022-05-12 15:13:16 +02:00
Florian Strohmaier eeeca5a204 ConfigMenu: create Configmenu class 2022-05-12 11:10:59 +02:00
Florian Strohmaier 29ef96349c Stylesheet: load configmenu.less 2022-05-12 11:10:59 +02:00
Johannes Meyer 2a80e8bca6 Introduce new hook `ThemeLoader` 2022-05-11 14:37:07 +02:00
Johannes Meyer 0b9eecbabc ActionController: Don't override reload rules in `redirectXhr()`
`postDispatchXhr()` also only overrides them if enabled.
2022-05-11 14:26:09 +02:00
Sukhwinder Dhillon 1b1eb3436f sql: Change charset to `utf8mb4`
fixes https://github.com/Icinga/icingaweb2/issues/4680
2022-05-02 15:36:31 +02:00
raviks789 199ea6f965 Prevent use of empty filters in FilterChain::toQueryString()
Due to instantiation of filters using Filter::matchAll() in ObjectList::getFilter(), we get an empty FilterAnd instance when
$this->filter is null. This prepends unnecessary separator '&' to the query string during conversion of filter to querystring.
This breaks the state badge links for host and service lists.
2022-04-29 10:38:26 +02:00
Johannes Meyer bc6b17b850 Revert "ActionController: Don't override `X-Icinga-Title` when it's already set"
This reverts commit 4cff1feb8f.

It's broken and obsolete since https://github.com/Icinga/ipl-web/pull/72.
2022-04-12 14:56:28 +02:00
Alexander Aleksandrovič Klimov 2fcee6a073 ConfigObject#get(): reduce code complexity
and save a few CPU cycles.
2022-04-11 13:31:16 +02:00
Alexander Aleksandrovič Klimov 874af33d81 Correct Auth#getUser() type spec
Doc says it may be null.
2022-04-11 13:30:24 +02:00
Alexander Aleksandrovič Klimov 32e958e4da Fix typo 2022-04-11 13:29:41 +02:00
Yonas Habteab 4cff1feb8f ActionController: Don't override `X-Icinga-Title` when it's already set 2022-04-11 13:26:08 +02:00
Johannes Meyer 9225462262 Fix that false values in dropdowns get ignored
plus some more fixes in the same area
2022-04-06 16:34:34 +02:00