Commit Graph

147 Commits

Author SHA1 Message Date
Jannis Moßhammer be29b8ff8f Make ConfigController and PreferenceController extensible by convention
- Rename ConfigurationController to ConfigController
- ConfigController and PreferenceController are now subclasses of
  BaseConfigController and BasePreferenceController
- Module and Application Config/Preference Tabs are detected via
  the ControllerTabCollector
- Moved Controller classes to Icinga/Web/Controller (this is why
  so many files are modified)

refs #4530
2013-08-14 16:08:15 +02:00
Matthias Jentsch eecbc233b9 Fix behavior of PreservingIniWriter that caused comments at the line end to be deleted
Implement a function to fetch comments at line end and use it to preserve
comments. Change the regular expressions used to parse lines to be more aware
of whitespaces between terms. Add automatic value and comment indentation
to produce cleaner output.
2013-08-14 15:05:10 +02:00
Eric Lippmann bd140f2828 CC: Fix phpcs errors of files changed in feature/datetime-element-4440
refs #4440
2013-08-12 16:43:10 +02:00
Eric Lippmann 2c217d1d06 Framework/DateTime: No longer use the Unix timestamp format since this ignores the time zone
refs #4440
2013-08-12 16:43:10 +02:00
Eric Lippmann 9f22905837 Framework/DateTimePicker: Set element's value to Unix timestamp after the input is considered valid
refs #4440
2013-08-12 16:43:09 +02:00
Eric Lippmann 3d104474d9 Tests: Fix UserTest as getTimeZone now returns a DateTimeZone object
refs #4440
2013-08-12 16:43:09 +02:00
Eric Lippmann ba00fd39df Framework: Get DateTimePicker's value as timestamp and add input validation
refs #4440
2013-08-12 16:43:09 +02:00
Eric Lippmann da7f619804 Framework: Implement DateFormat view helper
Support date, time and datetime formatting based on format strings
set either by the user or via config.ini. The view helper
FormDateTime uses the new helper already

refs #4440
refs #4424
2013-08-12 16:43:09 +02:00
Eric Lippmann 8af901e9ed Framework/User: Implement getTimezone to retrieve the user's Timezone
refs #4440
2013-08-12 16:42:50 +02:00
Eric Lippmann 93ae6d6811 Framework: mv Icinga\Config\Config to Icinga\Application\Config
refs #4543
2013-08-12 15:02:25 +02:00
Jannis Moßhammer ec17efe328 Add test for Dimension
refs #4192
2013-08-07 17:44:40 +02:00
Jannis Moßhammer b3e0d5e8ce Remove AbstractWidget and make Widget an interface
As Widget's already denote an abstract concept, the name
'AbstractWidget' is redundant. Also this class didn't do anything except
fetching a view via a singleton (which is now injected into the render method)
and bypassing the PHP class properties by creating a 'properties' array which is
filled with magic getters and setters (which now are simply php class properties)

Further changes:
- toString is removed, as this incorporated a lot of
   application logic which would cause unrecoverable
   errors when throwing exceptions
- renderToHtml is now just render and the view dependency must be
   passed, as a widget shouldn't be responsible for getting
   view instance (this means that <?= $this->tabs ?> is now
   <?= $this->tabs->render($this); ?> in the templates
- Controllers don't have $this->widget anymore as Widgets are
   directly instanciated with their class, allowing better code completion
   and avoiding hidden dependencies, also Widget::create is now removed
   in favor of direct instanciation.

refs #4192
2013-08-07 17:41:43 +02:00
Matthias Jentsch c1338898a6 Fix errors in function comments and move IniEditor into single class file
refs #4352
2013-08-07 15:58:51 +02:00
Matthias Jentsch 56e47fd084 Add an ini writer for configuration files
Add an ini writer that respects the file structure and the comments that may be
already present in the config file. Move Application/Config.php into
Config/Config.php.

refs #4352
2013-08-07 15:58:42 +02:00
Johannes Meyer 4befc9be94 Merge branch 'feature/preferences-backend-4069'
resolves #4069
2013-08-06 12:04:16 +02:00
Johannes Meyer 3ad4a4281d Add missing form tests and update documentation
refs #4439
2013-08-06 11:11:29 +02:00
Johannes Meyer 98e7ab02db Implement dynamic form elements
Rename "isPostAndValid" to "isSubmittedAndValid" and refactor it.
Add possibility for specific form elements to auto-submit their form.

refs #4439
2013-08-06 11:09:42 +02:00
Jannis Moßhammer 4f1e6ec720 Code style and comment fixes
refs #4441
2013-08-06 09:27:37 +02:00
Jannis Moßhammer b44de95caa Call commandhandler from commandcontroller actions
The CommandController now implements the calls to the specific
command methods and sends commands to the icinga process

refs #4441
2013-08-06 09:27:37 +02:00
Jannis Moßhammer d6bbed3a54 Extract the transport functions from the CommandPipe
- The CommandPipe class now delegates submission of commands to
  the Transport classes (LocalPipe or SecureShell)
- Added SSH options for non-interactive mode
- Refactored tests

refs #4441
2013-08-06 09:27:37 +02:00
Marius Hein 6112189b0c User preferences: Add database store
refs #4069
2013-08-05 16:56:03 +02:00
Marius Hein 6d1f349616 User preferences: Implement interfaces and ini store
refs #4069
2013-08-05 16:56:02 +02:00
Jannis Moßhammer 5a82c37ed1 Fix session test save path not being writable for vagrant user
The tests now try to write to /tmp and are skipped if this folder
is not writable. Also the test has been refactored a bit (comments,
assertion messages)

regs #4461
2013-08-02 15:35:05 +02:00
Jannis Moßhammer 5c3eb1d796 Style fixes and addParam test
refs #4381
2013-08-02 13:14:56 +02:00
Jannis Moßhammer 50ca1aec1a Refactor URL class and test
The constructor of the class is now private, instantiation happens
with Url::fromRequest and Url::fromPath. Also updated all occurences
of Url and fixed the Qlink helper to not overwrite the baseUrl with null
values

refs #4381
2013-08-02 13:14:55 +02:00
Marius Hein a1a8d4c157 Code compliance change and rename refs to User
refs #4066
2013-07-30 14:06:46 +02:00
Marius Hein 8510d57cf8 Prepare user settings api
Rework application bootstrap, move user object to its new location, implement web
request class to handle the user object.

refs #4066
2013-07-30 14:06:46 +02:00
Matthias Jentsch d5d0da6b1b Add missing property comments in DbUserBackendTest
refs #3769
2013-07-29 12:47:15 +02:00
Matthias Jentsch e51737f42a Fix the installation manual, comments and give the unit-test functions a more
verbose name

refs #3769
2013-07-29 11:42:31 +02:00
Matthias Jentsch 94e9ffc7b3 Fix comments
refs #3769
2013-07-26 15:57:37 +02:00
Jannis Moßhammer 306a51271b Change 'user' table to 'account', error handling and docs
Fix installation instructions for postgresql, the user table is now
'account', as user is a keyword in some rdbms, now catching exceptions
and returning auth failed while logging errors

refs #3769
2013-07-26 15:01:52 +02:00
Matthias Jentsch fd4cbf1c5b Add default login to the authentication database
refs #3772
2013-07-26 13:10:00 +02:00
Matthias Jentsch b013966464 Fix unit tests and add documentation
Add functionality to check if a certain database type like psql or mysql is
available and skip the tests accordingly.

Add documentation for backend authentication.

refs #3769
2013-07-26 13:09:59 +02:00
Matthias Jentsch 2807982f72 Remove crypto-module and use libraries instead
Remove the crypto-module to reduce amount of dependencies and use hash_hmac
with SHA256 instead.

refs #3769
2013-07-26 13:09:59 +02:00
Matthias Jentsch 3ff0c0f02a Adds DbUserBackend to handle the authentication against a sql db.
Users should be able to authenticate against an internal DB without setting up
additional authentication domains.

refs #3769
2013-07-26 13:09:59 +02:00
Jannis Moßhammer e2b98a4138 Fix broken login form
The login form was broken, as it used the old form api (disableCSRFToken
instead of setTokenDisabled and isValid instead of isPostAndValid)

refs #4459
2013-07-26 10:34:45 +02:00
Jannis Moßhammer 6900507ebc Merge branch 'feature/command-masks-4355' of ssh://git.icinga.org/icinga2-web 2013-07-24 12:49:43 +02:00
Jannis Mosshammer e8204f4755 Merge branch 'feature/service-detail-view-4181' of ssh://git.icinga.org/icinga2-web
Conflicts:
	library/Icinga/Application/Logger.php
	library/Icinga/Application/Web.php
	library/Icinga/Authentication/Backend/LdapUserBackend.php
	library/Icinga/Authentication/Credentials.php
	library/Icinga/Authentication/Manager.php
	library/Icinga/Authentication/PhpSession.php
	library/Icinga/Authentication/Session.php
	library/Icinga/Authentication/User.php
	library/Icinga/Authentication/UserBackend.php
	library/Icinga/Backend/AbstractBackend.php
	library/Icinga/Backend/DataView/ObjectRemappingView.php
	library/Icinga/Backend/Query.php
	library/Icinga/Backend/Statusdat/DataView/StatusdatHostView.php
	library/Icinga/Backend/Statusdat/HostgroupsummaryQuery.php
	library/Icinga/Backend/Statusdat/HostlistQuery.php
	library/Icinga/Backend/Statusdat/ServicegroupsummaryQuery.php
	library/Icinga/Backend/Statusdat/ServicelistQuery.php
	library/Icinga/Exception/ConfigurationError.php
	library/Icinga/Exception/MissingParameterException.php
	library/Icinga/Exception/NotImplementedError.php
	library/Icinga/Exception/ProgrammingError.php
	library/Icinga/Exception/SystemPermissionException.php
	library/Icinga/Protocol/AbstractQuery.php
	library/Icinga/Protocol/Commandpipe/Acknowledgement.php
	library/Icinga/Protocol/Commandpipe/CommandPipe.php
	library/Icinga/Protocol/Commandpipe/Comment.php
	library/Icinga/Protocol/Commandpipe/Downtime.php
	library/Icinga/Protocol/Commandpipe/Exception/InvalidCommandException.php
	library/Icinga/Protocol/Commandpipe/IComment.php
	library/Icinga/Protocol/Commandpipe/PropertyModifier.php
	library/Icinga/Protocol/Ldap/Connection.php
	library/Icinga/Protocol/Ldap/Exception.php
	library/Icinga/Protocol/Ldap/LdapUtils.php
	library/Icinga/Protocol/Ldap/Node.php
	library/Icinga/Protocol/Ldap/Query.php
	library/Icinga/Protocol/Ldap/Root.php
	library/Icinga/Protocol/Statusdat/Exception/ParsingException.php
	library/Icinga/Protocol/Statusdat/IReader.php
	library/Icinga/Protocol/Statusdat/ObjectContainer.php
	library/Icinga/Protocol/Statusdat/Parser.php
	library/Icinga/Protocol/Statusdat/Query.php
	library/Icinga/Protocol/Statusdat/Query/Expression.php
	library/Icinga/Protocol/Statusdat/Query/Group.php
	library/Icinga/Protocol/Statusdat/Query/IQueryPart.php
	library/Icinga/Protocol/Statusdat/Reader.php
	library/Icinga/Protocol/Statusdat/RuntimeStateContainer.php
	library/Icinga/Protocol/Statusdat/View/AccessorStrategy.php
	library/Icinga/Web/ActionController.php
	library/Icinga/Web/Form.php
	library/Icinga/Web/Hook/Configuration/ConfigurationTab.php
	library/Icinga/Web/Hook/Configuration/ConfigurationTabBuilder.php
	library/Icinga/Web/Hook/Configuration/ConfigurationTabInterface.php
	library/Icinga/Web/Hook/Grapher.php
	library/Icinga/Web/Hook/Toptray.php
	library/Icinga/Web/ModuleActionController.php
	library/Icinga/Web/Notification.php
	library/Icinga/Web/Paginator/Adapter/QueryAdapter.php
	library/Icinga/Web/Paginator/ScrollingStyle/SlidingWithBorder.php
	library/Icinga/Web/Widget.php
	modules/monitoring/application/views/helpers/MonitoringCommands.php
	modules/monitoring/application/views/helpers/MonitoringFlags.php
	modules/monitoring/application/views/helpers/MonitoringProperties.php
	modules/monitoring/application/views/scripts/show/components/comments.phtml
	modules/monitoring/application/views/scripts/show/components/downtime.phtml
	modules/monitoring/application/views/scripts/show/components/flags.phtml
	modules/monitoring/application/views/scripts/show/components/properties.phtml
	modules/monitoring/application/views/scripts/show/header.phtml
	modules/monitoring/application/views/scripts/show/host.phtml
	modules/monitoring/application/views/scripts/show/service.phtml
	modules/monitoring/library/Monitoring/Backend/AbstractBackend.php
	modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php
	modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php
	modules/monitoring/library/Monitoring/Backend/Statusdat.php
	modules/monitoring/library/Monitoring/Backend/Statusdat/Criteria/Order.php
	modules/monitoring/library/Monitoring/Backend/Statusdat/DataView/StatusdatServiceView.php
	modules/monitoring/library/Monitoring/Backend/Statusdat/Query/GroupsummaryQuery.php
	modules/monitoring/library/Monitoring/Backend/Statusdat/Query/Query.php
	modules/monitoring/library/Monitoring/Command/Meta.php
	modules/monitoring/library/Monitoring/View/DowntimeView.php
	modules/monitoring/test/php/application/views/helpers/MonitoringCommandsTest.php
	modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php
	modules/monitoring/test/php/library/Command/MetaTest.php
2013-07-23 16:33:07 +02:00
Marius Hein 51615766b3 Command masks: Fix test runner 2013-07-23 14:48:17 +02:00
Marius Hein 6e3e3c358b Command masks: Add test
refs #4355
2013-07-23 14:47:40 +02:00
Marius Hein 8d3ff94696 Remove php strict errors
refs #4448
2013-07-23 12:18:27 +02:00
Jannis Moßhammer 07f7e7ef23 Fix interface changes of statusdat in tests
The StatusDat tests didn't run as they were outdated, now a
newer version is added

refs #4178
refs #4179
2013-07-22 13:47:09 +02:00
Jannis Moßhammer dac9b7be4b Fix mixedPagination property typo, Statusloader libraries missing and getter for Abstractquery
refs #4178
2013-07-19 17:48:24 +02:00
Jannis Moßhammer 76a3ef86c1 Fix QueryAdapter and SlidingWithBorderTest, remove --strict
QueryAdapter and SlidingWithBorder used the statusdat backend and
must therefore be modified.
The --strict parameter stores controller tests because of the 1s timeout
and offers now advantages for us at this time.

refs #4417
2013-07-19 11:36:11 +02:00
Jannis Moßhammer 5827cb37cb Fix statusdat tests and implementation
After moving StatusDat to monitoring/Backends and changing the
inheritance to Library/Icinga/Data, a few changes must be reflected in the tests:
- Move tests to monitoring module
- Change $this->backend references in StatusDat Queries to $this->ds
- Added LibraryLoader to ease requiring of libaries (to be discussed)

refs #4417
refs #4179
2013-07-19 11:36:05 +02:00
Jannis Moßhammer c1860e7d5d Merge branch 'master' of ssh://git.icinga.org/icinga2-web into feature/host-overview--4179
Conflicts:
	modules/monitoring/application/controllers/ListController.php
	modules/monitoring/application/controllers/ShowController.php
	modules/monitoring/library/Monitoring/Backend/AbstractBackend.php
2013-07-15 13:52:26 +02:00
Jannis Moßhammer 2609c8765b Merge branch 'feature/autoload-application-code-4407' of ssh://git.icinga.org/icinga2-web 2013-07-15 13:42:16 +02:00
Jannis Moßhammer e0f0e1fc13 Fix history api URI encoding
The history API encoded components multiple times, e.g. causing a [ to
be converted to %5B in the first link, then to %255B on the second link,
%25255B on the third, etc.

refs #4408
2013-07-15 13:03:12 +02:00
Jannis Moßhammer bec7049785 Merge branch 'bugfix/history-api-encoding-4408' into feature/host-overview--4179 2013-07-15 12:41:07 +02:00
Marius Hein e049d8f3c4 Autoload: Fix test before rename namespaces
Drop builder test, it is not needed anymore. Skip all notification
tests. Test includes bootstrapping and throw errors with ldap auth.

refs #4407
2013-07-15 11:20:12 +02:00