From 4a982a382e40ea408a09129f33bb1c002483d815 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 12 Mar 2015 14:45:16 +0100 Subject: [PATCH 01/11] Show exception message when LDAP connection validation fails, if any --- .../forms/Config/Resource/LdapResourceForm.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/application/forms/Config/Resource/LdapResourceForm.php b/application/forms/Config/Resource/LdapResourceForm.php index 499d39941..15eea4187 100644 --- a/application/forms/Config/Resource/LdapResourceForm.php +++ b/application/forms/Config/Resource/LdapResourceForm.php @@ -119,12 +119,15 @@ class LdapResourceForm extends Form $form->getElement('bind_pw')->getValue() ) ) { - throw new Exception(); + throw new Exception(); // TODO: Get the exact error message } } catch (Exception $e) { - $form->addError( - $form->translate('Connectivity validation failed, connection to the given resource not possible.') - ); + $msg = $form->translate('Connectivity validation failed, connection to the given resource not possible.'); + if (($error = $e->getMessage())) { + $msg .= ' (' . $error . ')'; + } + + $form->addError($msg); return false; } From 1b440a4f1b18c5d340ab48404e2e4ee933a0a5ac Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 12 Mar 2015 15:17:19 +0100 Subject: [PATCH 02/11] Make SSL/TLS configurable for LDAP resources refs #7771 --- .../Config/Resource/LdapResourceForm.php | 35 +++++++++++++ library/Icinga/Protocol/Ldap/Connection.php | 52 +++++++++---------- 2 files changed, 59 insertions(+), 28 deletions(-) diff --git a/application/forms/Config/Resource/LdapResourceForm.php b/application/forms/Config/Resource/LdapResourceForm.php index 15eea4187..058f8462a 100644 --- a/application/forms/Config/Resource/LdapResourceForm.php +++ b/application/forms/Config/Resource/LdapResourceForm.php @@ -7,6 +7,7 @@ use Exception; use Icinga\Web\Form; use Icinga\Data\ConfigObject; use Icinga\Data\ResourceFactory; +use Icinga\Protocol\Ldap\Connection; /** * Form class for adding/modifying ldap resources @@ -57,6 +58,40 @@ class LdapResourceForm extends Form 'value' => 389 ) ); + $this->addElement( + 'select', + 'connection', + array( + 'required' => true, + 'autosubmit' => true, + 'label' => $this->translate('Connection'), + 'description' => $this->translate( + 'The type of connection to use. Unencrypted (Plaintext) or encrypted (SSL, TLS).' + ), + 'multiOptions' => array( + 'plaintext' => $this->translate('Plaintext'), + Connection::SSL => 'Secure Sockets Layer (SSL)', + Connection::STARTTLS => 'Transport Layer Security (TLS)' + ) + ) + ); + + if (isset($formData['connection']) && $formData['connection'] !== 'plaintext') { + // TODO(jom): Do not show this checkbox unless the connection is actually failing due to certificate errors + $this->addElement( + 'checkbox', + 'reqcert', + array( + 'required' => true, + 'label' => $this->translate('Require Certificate'), + 'description' => $this->translate( + 'When checked, the LDAP server must provide a valid and known (trusted) certificate.' + ), + 'value' => 1 + ) + ); + } + $this->addElement( 'text', 'root_dn', diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index 053c6c908..27e39be8c 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -3,7 +3,6 @@ namespace Icinga\Protocol\Ldap; -use Exception; use Icinga\Exception\ProgrammingError; use Icinga\Protocol\Ldap\Exception as LdapException; use Icinga\Application\Platform; @@ -35,6 +34,8 @@ class Connection const LDAP_SIZELIMIT_EXCEEDED = 4; const LDAP_ADMINLIMIT_EXCEEDED = 11; const PAGE_SIZE = 1000; + const STARTTLS = 'tls'; + const SSL = 'ssl'; protected $ds; protected $hostname; @@ -43,6 +44,8 @@ class Connection protected $bind_pw; protected $root_dn; protected $count; + protected $connectionType; + protected $reqCert = true; /** * Whether the bind on this connection was already performed @@ -66,8 +69,6 @@ class Connection /** * Constructor * - * TODO: Allow to pass port and SSL options - * * @param ConfigObject $config */ public function __construct(ConfigObject $config) @@ -77,6 +78,8 @@ class Connection $this->bind_pw = $config->bind_pw; $this->root_dn = $config->root_dn; $this->port = $config->get('port', $this->port); + $this->connectionType = $config->connection; + $this->reqCert = (bool) $config->get('reqcert', $this->reqCert); } public function getHostname() @@ -470,59 +473,53 @@ class Connection */ protected function prepareNewConnection() { - $use_tls = false; - $force_tls = false; - - if ($use_tls) { + if ($this->connectionType === static::STARTTLS || $this->connectionType === static::SSL) { $this->prepareTlsEnvironment(); } - $ds = ldap_connect($this->hostname, $this->port); + $hostname = $this->hostname; + if ($this->connectionType === static::SSL) { + $hostname = 'ldaps://' . $hostname; + } + + $ds = ldap_connect($hostname, $this->port); try { $this->capabilities = $this->discoverCapabilities($ds); $this->discoverySuccess = true; - } catch (LdapException $e) { - // create empty default capabilities Logger::warning('LADP discovery failed, assuming default LDAP settings.'); $this->capabilities = new Capability(); } - if ($use_tls) { + if ($this->connectionType === static::STARTTLS) { + $force_tls = false; if ($this->capabilities->hasStartTLS()) { if (@ldap_start_tls($ds)) { Logger::debug('LDAP STARTTLS succeeded'); } else { - Logger::debug('LDAP STARTTLS failed: %s', ldap_error($ds)); - throw new LdapException( - 'LDAP STARTTLS failed: %s', - ldap_error($ds) - ); + Logger::error('LDAP STARTTLS failed: %s', ldap_error($ds)); + throw new LdapException('LDAP STARTTLS failed: %s', ldap_error($ds)); } } elseif ($force_tls) { - throw new LdapException( - 'TLS is required but not announced by %s', - $this->hostname - ); + throw new LdapException('STARTTLS is required but not announced by %s', $this->hostname); } else { - Logger::warning('LDAP TLS enabled but not announced'); + Logger::warning('LDAP STARTTLS enabled but not announced'); } } + // ldap_rename requires LDAPv3: if ($this->capabilities->hasLdapV3()) { if (! ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) { throw new LdapException('LDAPv3 is required'); } } else { - // TODO: remove this -> FORCING v3 for now ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); Logger::warning('No LDAPv3 support detected'); } - // Not setting this results in "Operations error" on AD when using the - // whole domain as search base: + // Not setting this results in "Operations error" on AD when using the whole domain as search base ldap_set_option($ds, LDAP_OPT_REFERRALS, 0); // ldap_set_option($ds, LDAP_OPT_DEREF, LDAP_DEREF_NEVER); return $ds; @@ -530,17 +527,16 @@ class Connection protected function prepareTlsEnvironment() { - $strict_tls = true; // TODO: allow variable known CA location (system VS Icinga) if (Platform::isWindows()) { - // putenv('LDAP...') + putenv('LDAPTLS_REQCERT=never'); } else { - if ($strict_tls) { + if ($this->reqCert) { $ldap_conf = $this->getConfigDir('ldap_ca.conf'); } else { $ldap_conf = $this->getConfigDir('ldap_nocert.conf'); } - putenv('LDAPRC=' . $ldap_conf); + putenv('LDAPRC=' . $ldap_conf); // TODO: Does not have any effect if (getenv('LDAPRC') !== $ldap_conf) { throw new LdapException('putenv failed'); } From 5de5a65df03fb1f2716d458d2a3e9a1b57bed2aa Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 12 Mar 2015 15:18:00 +0100 Subject: [PATCH 03/11] Do not suppress errors when a LDAP capability query fails --- library/Icinga/Protocol/Ldap/Connection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index 27e39be8c..f36de1a5e 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -487,9 +487,9 @@ class Connection $this->capabilities = $this->discoverCapabilities($ds); $this->discoverySuccess = true; } catch (LdapException $e) { - // create empty default capabilities + Logger::debug($e); Logger::warning('LADP discovery failed, assuming default LDAP settings.'); - $this->capabilities = new Capability(); + $this->capabilities = new Capability(); // create empty default capabilities } if ($this->connectionType === static::STARTTLS) { From 8295d6d9b09a28aa0e3aca03133db9c553ff4a56 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 12 Mar 2015 15:36:52 +0100 Subject: [PATCH 04/11] Do not require the `connection' directive when creating a LDAP resource --- library/Icinga/Protocol/Ldap/Connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index f36de1a5e..3f79a063f 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -78,7 +78,7 @@ class Connection $this->bind_pw = $config->bind_pw; $this->root_dn = $config->root_dn; $this->port = $config->get('port', $this->port); - $this->connectionType = $config->connection; + $this->connectionType = $config->get('connection'); $this->reqCert = (bool) $config->get('reqcert', $this->reqCert); } From 90971f2caff13de2e1ddb06d90dbec89446a225b Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 12 Mar 2015 12:12:34 +0100 Subject: [PATCH 05/11] Revert "Merge branch 'feature/organize-headings-7976'" This reverts commit ea2a17a76c4c4b1a3df13c44016a009694026e00, reversing changes made to e72de8dfe1456cbb50852d8b7910e0013cab3aaa. refs #7976 fixes #8647 --- application/controllers/ConfigController.php | 1 - application/controllers/RolesController.php | 1 - .../config/authentication/reorder.phtml | 17 ++----- application/views/scripts/config/module.phtml | 3 -- .../views/scripts/config/modules.phtml | 1 - .../views/scripts/config/resource.phtml | 17 ++----- application/views/scripts/roles/index.phtml | 6 --- library/Icinga/Web/Widget/FilterEditor.php | 34 +++++--------- library/Icinga/Web/Widget/SortBox.php | 9 +--- library/Icinga/Web/Widget/Tabs.php | 47 +------------------ .../controllers/AlertsummaryController.php | 2 +- .../controllers/ListController.php | 1 - .../controllers/ProcessController.php | 2 +- .../views/scripts/alertsummary/index.phtml | 27 +++-------- .../application/views/scripts/host/show.phtml | 1 - .../views/scripts/list/comments.phtml | 15 +++--- .../views/scripts/list/contactgroups.phtml | 3 -- .../views/scripts/list/contacts.phtml | 14 +++--- .../views/scripts/list/downtimes.phtml | 20 +++++--- .../views/scripts/list/eventgrid.phtml | 15 +++--- .../views/scripts/list/eventhistory.phtml | 19 ++++---- .../views/scripts/list/hostgroups.phtml | 5 +- .../views/scripts/list/hosts.phtml | 5 +- .../views/scripts/list/notifications.phtml | 11 +++-- .../views/scripts/list/servicegrid.phtml | 5 +- .../views/scripts/list/servicegroups.phtml | 5 +- .../views/scripts/list/services.phtml | 5 +- .../partials/host/objects-header.phtml | 4 +- .../partials/service/objects-header.phtml | 4 +- .../views/scripts/process/info.phtml | 24 ++-------- .../views/scripts/tactical/index.phtml | 1 - .../views/scripts/timeline/index.phtml | 4 -- public/css/icinga/menu.less | 8 ++-- public/js/icinga/events.js | 30 +++++------- 34 files changed, 116 insertions(+), 250 deletions(-) diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php index f7543cc03..cdf41c8f7 100644 --- a/application/controllers/ConfigController.php +++ b/application/controllers/ConfigController.php @@ -72,7 +72,6 @@ class ConfigController extends ActionController $allowedActions[] = 'roles'; } $this->firstAllowedAction = array_shift($allowedActions); - $this->getTabs()->setTitle($this->translate('Config Navigation')); } public function devtoolsAction() diff --git a/application/controllers/RolesController.php b/application/controllers/RolesController.php index 2b7b520c5..bff5f70a1 100644 --- a/application/controllers/RolesController.php +++ b/application/controllers/RolesController.php @@ -51,7 +51,6 @@ class RolesController extends ActionController 'label' => $this->translate('Roles'), 'url' => 'roles' )); - $this->getTabs()->setTitle($this->translate('Role Configuration')); } /** diff --git a/application/views/scripts/config/authentication/reorder.phtml b/application/views/scripts/config/authentication/reorder.phtml index 0386cdd5e..e4b72d7e1 100644 --- a/application/views/scripts/config/authentication/reorder.phtml +++ b/application/views/scripts/config/authentication/reorder.phtml @@ -2,20 +2,9 @@
-

- translate('Authentication Configuration'); ?> -

-

- -

-

- - icon('plus'); ?>translate('Create A New Authentication Backend'); ?> - -

-

- -

+ + icon('plus'); ?>translate('Create A New Authentication Backend'); ?> +
diff --git a/application/views/scripts/config/module.phtml b/application/views/scripts/config/module.phtml index 9130bcc90..1d03f5d37 100644 --- a/application/views/scripts/config/module.phtml +++ b/application/views/scripts/config/module.phtml @@ -11,9 +11,6 @@ $permissions = $module->getProvidedPermissions(); $state = $moduleData->enabled ? ($moduleData->loaded ? 'enabled' : 'failed') : 'disabled' ?> -

- escape($module->getTitle()) ?> -

diff --git a/application/views/scripts/config/modules.phtml b/application/views/scripts/config/modules.phtml index feb7facad..9121de405 100644 --- a/application/views/scripts/config/modules.phtml +++ b/application/views/scripts/config/modules.phtml @@ -4,7 +4,6 @@
-

translate('Installed Modules') ?>

escape($this->translate('Name')) ?>
diff --git a/application/views/scripts/config/resource.phtml b/application/views/scripts/config/resource.phtml index a8275912b..d3d0e4d4f 100644 --- a/application/views/scripts/config/resource.phtml +++ b/application/views/scripts/config/resource.phtml @@ -2,20 +2,9 @@
diff --git a/application/views/scripts/roles/index.phtml b/application/views/scripts/roles/index.phtml index 25d3d1cdd..17e947249 100644 --- a/application/views/scripts/roles/index.phtml +++ b/application/views/scripts/roles/index.phtml @@ -2,9 +2,6 @@
-

- translate('Roles') ?> -

isEmpty()): ?> translate('No roles found.') ?> @@ -70,9 +67,6 @@
translate('Resource'); ?>
-

- translate('Create New Role'); ?> -

translate('Create a New Role') ?> diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php index 8bcb9aa60..2575ce264 100644 --- a/library/Icinga/Web/Widget/FilterEditor.php +++ b/library/Icinga/Web/Widget/FilterEditor.php @@ -678,28 +678,20 @@ class FilterEditor extends AbstractWidget public function render() { if (! $this->preservedUrl()->getParam('modifyFilter')) { - $filterEditor = $this->renderSearch() . $this->shorten($this->filter, 50); - } else { - $filterEditor = $this->renderSearch() - . '
' - . '
  • ' - . $this->renderFilter($this->filter) - . '
' - . '
' - . '' - . '' - . '
' - . '
'; + return $this->renderSearch() . $this->shorten($this->filter, 50); } - - return sprintf( - '
' - . '

%s

%s
', - t('Filters'), - $filterEditor - ); + return $this->renderSearch() + . '
' + . '
  • ' + . $this->renderFilter($this->filter) + . '
' + . '
' + . '' + . '' + . '
' + . '
'; } protected function shorten($string, $length) diff --git a/library/Icinga/Web/Widget/SortBox.php b/library/Icinga/Web/Widget/SortBox.php index a1728db4f..18ed95b86 100644 --- a/library/Icinga/Web/Widget/SortBox.php +++ b/library/Icinga/Web/Widget/SortBox.php @@ -133,13 +133,6 @@ class SortBox extends AbstractWidget if ($this->request) { $form->populate($this->request->getParams()); } - - return sprintf( - '
' - . '

%s

%s%s
', - t('Sort Criteria'), - t('Sort by'), - (string) $form - ); + return $form; } } diff --git a/library/Icinga/Web/Widget/Tabs.php b/library/Icinga/Web/Widget/Tabs.php index 4952d29b1..70f0bd529 100644 --- a/library/Icinga/Web/Widget/Tabs.php +++ b/library/Icinga/Web/Widget/Tabs.php @@ -20,7 +20,6 @@ class Tabs extends AbstractWidget implements Countable * @var string */ private $baseTpl = <<< 'EOT' -{HEADER}
    {TABS} {DROPDOWN} @@ -29,13 +28,6 @@ class Tabs extends AbstractWidget implements Countable
EOT; - /** - * Template used for the header - * - * @type string - */ - private $headerTpl = '

{TITLE}

'; - /** * Template used for the tabs dropdown * @@ -109,13 +101,6 @@ EOT; */ private $closeTab = true; - /** - * Title of the tab navigation - * - * @type string - */ - private $title; - /** * Set whether the current tab is closable */ @@ -381,15 +366,13 @@ EOT; '{TABS}', '{DROPDOWN}', '{REFRESH}', - '{CLOSE}', - '{HEADER}' + '{CLOSE}' ), array( $tabs, $drop, $close, - $refresh, - $this->renderHeader() + $refresh ), $this->baseTpl ); @@ -451,30 +434,4 @@ EOT; $tabextension->apply($this); return $this; } - - /** - * Set the title of the tab navigation - * - * @param string $title - * @return self - */ - public function setTitle($title) - { - $this->title = $title; - return $this; - } - - /** - * Render the title into the header template - * - * @return string - */ - public function renderHeader() - { - if (! $this->title) { - return ''; - } - - return str_replace('{TITLE}', $this->title, $this->headerTpl); - } } diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index cc1d75193..449967fcb 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -44,7 +44,7 @@ class Monitoring_AlertsummaryController extends Controller 'label' => $this->translate('Alert Summary'), 'url' => Url::fromRequest() ) - )->activate('alertsummary')->setTitle($this->translate('Alertsummary Navigation')); + )->activate('alertsummary'); $this->view->title = $this->translate('Alert Summary'); $this->view->intervalBox = $this->createIntervalBox(); diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index b1b96b477..5d9abcfd9 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -727,7 +727,6 @@ class Monitoring_ListController extends Controller private function createTabs() { $tabs = $this->getTabs(); - $tabs->setTitle($this->translate('Monitoring Navigation')); if (in_array($this->_request->getActionName(), array( 'hosts', 'services', diff --git a/modules/monitoring/application/controllers/ProcessController.php b/modules/monitoring/application/controllers/ProcessController.php index efca3d520..b20bd7576 100644 --- a/modules/monitoring/application/controllers/ProcessController.php +++ b/modules/monitoring/application/controllers/ProcessController.php @@ -29,7 +29,7 @@ class Monitoring_ProcessController extends Controller 'label' => $this->translate('Monitoring Health'), 'url' =>'monitoring/process/info' ) - )->setTitle($this->translate('Process Information')); + ); } /** diff --git a/modules/monitoring/application/views/scripts/alertsummary/index.phtml b/modules/monitoring/application/views/scripts/alertsummary/index.phtml index 3281f3ec8..dbfff6433 100644 --- a/modules/monitoring/application/views/scripts/alertsummary/index.phtml +++ b/modules/monitoring/application/views/scripts/alertsummary/index.phtml @@ -1,9 +1,6 @@
tabs ?>
-

- translate('Filters'); ?> -

widget('limiter') ?> @@ -11,33 +8,25 @@
-

- translate('Alert summary'); ?> -

+
-

- translate('Notifications and Problems'); ?> -

+

translate('Notifications and Problems'); ?>

render(); ?>
-

- translate('Time to Reaction (Ack, Recover)'); ?> -

+

translate('Time to Reaction (Ack, Recover)'); ?>

render(); ?>
-

- translate('Trend'); ?> -

+

translate('Trend'); ?>

@@ -64,9 +53,7 @@
recentAlerts): ?> -

- translate('Top 5 Recent Alerts'); ?> -

+

translate('Top 5 Recent Alerts'); ?>

@@ -79,9 +66,7 @@
-

- translate('History'); ?> -

+

translate('History'); ?>

partial('list/notifications.phtml', array( diff --git a/modules/monitoring/application/views/scripts/host/show.phtml b/modules/monitoring/application/views/scripts/host/show.phtml index f490c25f9..867692301 100644 --- a/modules/monitoring/application/views/scripts/host/show.phtml +++ b/modules/monitoring/application/views/scripts/host/show.phtml @@ -3,7 +3,6 @@ render('partials/host/servicesummary.phtml') ?>
-

translate('Host Detail Information') ?>

render('show/components/output.phtml') ?> render('show/components/grapher.phtml') ?> diff --git a/modules/monitoring/application/views/scripts/list/comments.phtml b/modules/monitoring/application/views/scripts/list/comments.phtml index d41399984..6f49bf4a8 100644 --- a/modules/monitoring/application/views/scripts/list/comments.phtml +++ b/modules/monitoring/application/views/scripts/list/comments.phtml @@ -1,14 +1,15 @@ compact): ?> -
- tabs ?> - sortControl ?> - widget('limiter', array('url' => $this->url, 'max' => $comments->count())); ?> - paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?> -
+
+ tabs->render($this); ?> +
+ translate('Sort by'); ?> sortControl->render($this); ?> +
+ widget('limiter', array('url' => $this->url, 'max' => $comments->count())); ?> + paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?> +
-

translate('Comments') ?>

translate('No comments matching the filter'); ?>
diff --git a/modules/monitoring/application/views/scripts/list/contactgroups.phtml b/modules/monitoring/application/views/scripts/list/contactgroups.phtml index b00e78031..a44b388b7 100644 --- a/modules/monitoring/application/views/scripts/list/contactgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/contactgroups.phtml @@ -4,9 +4,6 @@
-

- translate('Contact Groups'); ?> -

compact): ?> -
- tabs ?> - sortControl ?> - widget('limiter', array('url' => $this->url, 'max' => $contacts->count())); ?> - paginationControl($contacts, null, null, array('preserve' => $this->preserve)); ?> +
+ tabs ?> +
+ sortControl->render($this); ?>
- + paginationControl($contacts, null, null, array('preserve' => $this->preserve)); ?> +
-

translate('Contacts') ?>

translate('No contacts matching the filter'); diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 5ad554f99..1fbaa713f 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -4,17 +4,23 @@ use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Service; ?> + compact): ?> -
- tabs ?> - sortControl ?> - widget('limiter', array('url' => $this->url, 'max' => $downtimes->count())); ?> - paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?> -
+
+ tabs->render($this); ?> +
+ translate('Sort by'); ?> sortControl->render($this); ?> + filterEditor): ?> + filterPreview ?> + +
+ widget('limiter', array('url' => $this->url, 'max' => $downtimes->count())); ?> + paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?> +
+
filterEditor ?> -

translate('Downtimes'); ?>

translate('No active downtimes'); ?>
diff --git a/modules/monitoring/application/views/scripts/list/eventgrid.phtml b/modules/monitoring/application/views/scripts/list/eventgrid.phtml index 6bf0b800b..1af75caf9 100644 --- a/modules/monitoring/application/views/scripts/list/eventgrid.phtml +++ b/modules/monitoring/application/views/scripts/list/eventgrid.phtml @@ -2,21 +2,18 @@ use Icinga\Data\Filter\Filter; use Icinga\Web\Widget\Chart\HistoryColorGrid; ?> - + + +
tabs->render($this); ?>
-

- translate('Filters'); ?> -

-
-

translate('Event Grid'); ?>

- -
- + + +
+ compact): ?>
tabs ?> - sortControl ?> +
+
+ translate('Sort by') ?> sortControl ?> +
+
+ widget('limiter', array('url' => $this->url, 'max' => $this->history->count())); ?> paginationControl($history, null, null, array('preserve' => $this->preserve)); ?> +
+ +
- filterEditor ?> -

translate('Event History') ?>

- -
- - - +filterEditor ?> translate('No history events matching the filter') ?>
diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml index c8f5b2de2..c702197b2 100644 --- a/modules/monitoring/application/views/scripts/list/hostgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml @@ -3,13 +3,14 @@
tabs ?> - sortControl->render($this); ?> +
+ translate('Sort by'); ?> sortControl->render($this); ?> +
widget('limiter')->setMaxLimit(count($hostgroups)); ?> paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?>
filterEditor; ?> -

translate('Host Groups') ?>

compact): ?>
render('list/components/selectioninfo.phtml') ?> render('list/components/hostssummary.phtml') ?> + translate('Sort by') ?> sortControl->render($this) ?>
-sortControl->render($this) ?> + widget('limiter')->setMaxLimit($this->hosts->count()) ?> paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?> selectionToolbar('multi', $this->href('monitoring/hosts/show?' . $this->filter->toQueryString())) ?> @@ -18,7 +19,6 @@ if ($this->compact): ?>
filterEditor ?> -

translate('Hosts') ?>

count() === 0) { return; } ?> + + compact): ?>
tabs ?> - sortControl->render($this) ?> +
+ translate('Sort by') ?> sortControl->render($this) ?> +
widget('limiter') ?> paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?>
-
-

translate('Notifications'); ?>

- -
+ +
translate('No notifications matching the filter') ?> diff --git a/modules/monitoring/application/views/scripts/list/servicegrid.phtml b/modules/monitoring/application/views/scripts/list/servicegrid.phtml index d4b5a4074..a102c36eb 100644 --- a/modules/monitoring/application/views/scripts/list/servicegrid.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegrid.phtml @@ -6,11 +6,12 @@ use Icinga\Module\Monitoring\Object\Service; compact): ?>
tabs; ?> - sortControl; ?> +
+ translate('Sort by'); ?> sortControl; ?> +
-

translate('Service Grid') ?>

tabs ?> - sortControl->render($this); ?> +
+ translate('Sort by'); ?> sortControl->render($this); ?> +
widget('limiter')->setMaxLimit(count($servicegroups)); ?> paginationControl($servicegroups, null, null, array('preserve' => $this->preserve)); ?>
filterEditor; ?> -

translate('Service Groups') ?>

compact): ?>
render('list/components/selectioninfo.phtml') ?> render('list/components/servicesummary.phtml') ?> +
+translate('Sort by') ?> sortControl ?> +
-sortControl ?> limit === 0): ?> widget('limiter') ?> @@ -22,7 +24,6 @@ if (!$this->compact): ?>
filterEditor ?> -

translate('Services') ?>

diff --git a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml index f892df6f4..f5edd0213 100644 --- a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml @@ -3,9 +3,7 @@ 0): ?>
-

- translatePlural('Host (%u)', 'Hosts (%u)', $hostCount), $hostCount); ?> -

+ translatePlural('Host (%u)', 'Hosts (%u)', $hostCount), $hostCount); ?>
  diff --git a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml index 6389d992f..1ac27b934 100644 --- a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml @@ -4,9 +4,7 @@ 0): ?>
-

- translatePlural('Service (%u)', 'Services (%u)', $serviceCount), $serviceCount); ?> -

+ translatePlural('Service (%u)', 'Services (%u)', $serviceCount), $serviceCount); ?>
  diff --git a/modules/monitoring/application/views/scripts/process/info.phtml b/modules/monitoring/application/views/scripts/process/info.phtml index b881641e6..835228814 100644 --- a/modules/monitoring/application/views/scripts/process/info.phtml +++ b/modules/monitoring/application/views/scripts/process/info.phtml @@ -9,10 +9,6 @@ $cp = $this->checkPerformance()->create($this->checkperformance);
-

- translate('Monitoring Health'); ?> -

-
@@ -20,9 +16,7 @@ $cp = $this->checkPerformance()->create($this->checkperformance);
-

- translate('Process Info') ?> -

+

translate('Process Info') ?>

@@ -73,13 +67,9 @@ $cp = $this->checkPerformance()->create($this->checkperformance);
-

- translate('Performance Info') ?> -

+

translate('Performance Info') ?>

-

- translate('Object summaries') ?> -

+

translate('Object summaries') ?>

@@ -127,9 +117,7 @@ $cp = $this->checkPerformance()->create($this->checkperformance);
-

- translate('Active checks') ?> -

+

translate('Active checks') ?>

@@ -159,9 +147,7 @@ $cp = $this->checkPerformance()->create($this->checkperformance);
-

- translate('Passive checks') ?> -

+

translate('Passive checks') ?>

diff --git a/modules/monitoring/application/views/scripts/tactical/index.phtml b/modules/monitoring/application/views/scripts/tactical/index.phtml index 897ef9776..3882b27b3 100644 --- a/modules/monitoring/application/views/scripts/tactical/index.phtml +++ b/modules/monitoring/application/views/scripts/tactical/index.phtml @@ -4,7 +4,6 @@
-

translate('Tactical Overview') ?>

statusSummary->hosts_down || $this->statusSummary->hosts_unreachable): ?> render('tactical/components/problem_hosts.phtml'); ?> diff --git a/modules/monitoring/application/views/scripts/timeline/index.phtml b/modules/monitoring/application/views/scripts/timeline/index.phtml index a9b5666f6..6557b4a28 100644 --- a/modules/monitoring/application/views/scripts/timeline/index.phtml +++ b/modules/monitoring/application/views/scripts/timeline/index.phtml @@ -10,9 +10,6 @@ $firstRow = !$beingExtended;
tabs ?>
-

- translate('Filters') ?> -

@@ -25,7 +22,6 @@ $firstRow = !$beingExtended;
-

translate('Timeline'); ?>

diff --git a/public/css/icinga/menu.less b/public/css/icinga/menu.less index 3c733db6e..c33c6670c 100644 --- a/public/css/icinga/menu.less +++ b/public/css/icinga/menu.less @@ -270,7 +270,7 @@ a:focus { /* Accessibility Skip Links */ .skip-links { - position: relative; + position: absolute; opacity: 1; ul { list-style-type: none; @@ -286,6 +286,7 @@ a:focus { left: -999em; box-sizing: content-box; width: 10.4em !important; + top: 0em; text-align: left !important; padding: 0.8em; background-color: white; @@ -300,8 +301,5 @@ a:focus { } } .skip-links-inline { - ul > li > a { - width: 14em !important; - top: -3em; - } + margin-top: -3.5em; } diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index d29f39aa2..3edd306b9 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -359,29 +359,21 @@ handleAnchor: function(query) { var $element = $(query); if ($element.length > 0) { - // TODO(mh): Some elements are missing to place the right focus - // This is a fixed workarround until all header took place - - var $item = $element.find(':header:first').nextUntil(':header:first').next(); - if ($item.length > 0) { - $element = $item; - } - - /* - var focusQueries = ['h1:first', ':header:first', ':input:first']; - $.each(focusQueries, function(index,q) { - var $item = $element.find(q); - if ($item.length > 0) { - $element = $item; - return false; + // Try to find the first header. It is more pleasant to users + // to select the header instead a container + var $header = $element.find(':header:first'); + if ($header.length > 0) { + $element = $header; + } else { + var $input = $element.find(':header:first'); + if ($input.length > 0) { + $element = $input } - }); - */ - + } // If we want to focus an element which has no tabindex // add one that we can focus is if ($element.prop('tabindex') < 0) { - $element.prop('tabindex', '-1'); + $element.prop('tabindex', 0); } $element.focus(); } From 6dc48fe9d31eecf14f49a0df5aabb885f3c147f1 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 12 Mar 2015 12:13:37 +0100 Subject: [PATCH 06/11] CSS: Remove .skip-links-inline ... ... because we don't use it. --- public/css/icinga/menu.less | 3 --- 1 file changed, 3 deletions(-) diff --git a/public/css/icinga/menu.less b/public/css/icinga/menu.less index c33c6670c..c486251b0 100644 --- a/public/css/icinga/menu.less +++ b/public/css/icinga/menu.less @@ -300,6 +300,3 @@ a:focus { } } } -.skip-links-inline { - margin-top: -3.5em; -} From 8563d5ed3fe6ada562d246c1e0717a4ba18f5906 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 12 Mar 2015 13:39:17 +0100 Subject: [PATCH 07/11] PHPDoc: Use @var instead of @type Becasue of too many kittens PSR-5 backed off of deprecating @var. So that's the way we go too. --- application/controllers/ConfigController.php | 2 +- application/forms/Security/RoleForm.php | 8 ++++---- .../Icinga/Application/ApplicationBootstrap.php | 2 +- library/Icinga/Cli/Command.php | 2 +- library/Icinga/Data/Tree/SimpleTree.php | 4 ++-- library/Icinga/Data/Tree/TreeNode.php | 4 ++-- library/Icinga/Data/Tree/TreeNodeIterator.php | 2 +- .../Icinga/File/FileExtensionFilterIterator.php | 4 ++-- library/Icinga/File/NonEmptyFileIterator.php | 2 +- .../Icinga/Web/Controller/ActionController.php | 2 +- library/Icinga/Web/Dom/DomNodeIterator.php | 2 +- library/Icinga/Web/Form.php | 2 +- library/Icinga/Web/Menu.php | 16 ++++++++-------- library/Icinga/Web/View.php | 2 +- .../doc/application/views/scripts/chapter.phtml | 4 ++-- .../application/views/scripts/index/index.phtml | 4 ++-- .../application/views/scripts/module/index.phtml | 4 ++-- modules/doc/application/views/scripts/pdf.phtml | 6 +++--- .../application/views/scripts/search/index.phtml | 2 +- modules/doc/application/views/scripts/toc.phtml | 6 +++--- modules/doc/configuration.php | 2 +- modules/doc/library/Doc/DocIterator.php | 2 +- modules/doc/library/Doc/DocParser.php | 8 ++++---- modules/doc/library/Doc/DocSection.php | 10 +++++----- .../doc/library/Doc/DocSectionFilterIterator.php | 4 ++-- modules/doc/library/Doc/Renderer/DocRenderer.php | 6 +++--- .../library/Doc/Renderer/DocSearchRenderer.php | 4 ++-- .../library/Doc/Renderer/DocSectionRenderer.php | 16 ++++++++-------- .../doc/library/Doc/Renderer/DocTocRenderer.php | 4 ++-- modules/doc/library/Doc/Search/DocSearch.php | 4 ++-- .../doc/library/Doc/Search/DocSearchIterator.php | 6 +++--- .../doc/library/Doc/Search/DocSearchMatch.php | 16 ++++++++-------- .../forms/Config/BackendConfigForm.php | 2 +- .../show/components/checkstatistics.phtml | 2 +- .../views/scripts/show/components/comments.phtml | 2 +- .../views/scripts/show/components/downtime.phtml | 2 +- modules/monitoring/configuration.php | 2 +- .../Monitoring/Object/MonitoredObject.php | 2 +- 38 files changed, 87 insertions(+), 87 deletions(-) diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php index cdf41c8f7..148cbaa05 100644 --- a/application/controllers/ConfigController.php +++ b/application/controllers/ConfigController.php @@ -23,7 +23,7 @@ class ConfigController extends ActionController /** * The first allowed config action according to the user's permissions * - * @type string + * @var string */ protected $firstAllowedAction; diff --git a/application/forms/Security/RoleForm.php b/application/forms/Security/RoleForm.php index 85691de24..4b42cd88c 100644 --- a/application/forms/Security/RoleForm.php +++ b/application/forms/Security/RoleForm.php @@ -18,7 +18,7 @@ class RoleForm extends ConfigForm /** * Provided permissions by currently loaded modules * - * @type array + * @var array */ protected $providedPermissions = array( '*' => '*', @@ -33,7 +33,7 @@ class RoleForm extends ConfigForm /** * Provided restrictions by currently loaded modules * - * @type array + * @var array */ protected $providedRestrictions = array(); @@ -46,11 +46,11 @@ class RoleForm extends ConfigForm $helper = new Zend_Form_Element('bogus'); foreach (Icinga::app()->getModuleManager()->getLoadedModules() as $module) { foreach ($module->getProvidedPermissions() as $permission) { - /** @type object $permission */ + /** @var object $permission */ $this->providedPermissions[$permission->name] = $permission->name . ': ' . $permission->description; } foreach ($module->getProvidedRestrictions() as $restriction) { - /** @type object $restriction */ + /** @var object $restriction */ $name = $helper->filterName($restriction->name); // Zend only permits alphanumerics, the underscore, // the circumflex and any ASCII character in range // \x7f to \xff (127 to 255) diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index 41df56d85..76efd4386 100644 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -115,7 +115,7 @@ abstract class ApplicationBootstrap /** * Whether Icinga Web 2 requires setup * - * @type bool + * @var bool */ protected $requiresSetup = false; diff --git a/library/Icinga/Cli/Command.php b/library/Icinga/Cli/Command.php index 73f0f8752..340c28945 100644 --- a/library/Icinga/Cli/Command.php +++ b/library/Icinga/Cli/Command.php @@ -17,7 +17,7 @@ abstract class Command protected $docs; /** - * @type Params + * @var Params */ protected $params; protected $screen; diff --git a/library/Icinga/Data/Tree/SimpleTree.php b/library/Icinga/Data/Tree/SimpleTree.php index 46a91135d..5b11e5200 100644 --- a/library/Icinga/Data/Tree/SimpleTree.php +++ b/library/Icinga/Data/Tree/SimpleTree.php @@ -14,14 +14,14 @@ class SimpleTree implements IteratorAggregate /** * Root node * - * @type TreeNode + * @var TreeNode */ protected $sentinel; /** * Nodes * - * @type array + * @var array */ protected $nodes = array(); diff --git a/library/Icinga/Data/Tree/TreeNode.php b/library/Icinga/Data/Tree/TreeNode.php index 200b3b9a6..975a33e76 100644 --- a/library/Icinga/Data/Tree/TreeNode.php +++ b/library/Icinga/Data/Tree/TreeNode.php @@ -10,7 +10,7 @@ class TreeNode implements Identifiable /** * The node's ID * - * @type mixed + * @var mixed */ protected $id; @@ -24,7 +24,7 @@ class TreeNode implements Identifiable /** * The node's children * - * @type array + * @var array */ protected $children = array(); diff --git a/library/Icinga/Data/Tree/TreeNodeIterator.php b/library/Icinga/Data/Tree/TreeNodeIterator.php index 753b338f6..76590398b 100644 --- a/library/Icinga/Data/Tree/TreeNodeIterator.php +++ b/library/Icinga/Data/Tree/TreeNodeIterator.php @@ -14,7 +14,7 @@ class TreeNodeIterator implements RecursiveIterator /** * The node's children * - * @type array + * @var array */ protected $children; diff --git a/library/Icinga/File/FileExtensionFilterIterator.php b/library/Icinga/File/FileExtensionFilterIterator.php index fd1d657b4..41efce0ad 100644 --- a/library/Icinga/File/FileExtensionFilterIterator.php +++ b/library/Icinga/File/FileExtensionFilterIterator.php @@ -33,7 +33,7 @@ class FileExtensionFilterIterator extends FilterIterator /** * The extension to filter for * - * @type string + * @var string */ protected $extension; @@ -58,7 +58,7 @@ class FileExtensionFilterIterator extends FilterIterator public function accept() { $current = $this->current(); - /** @type $current \SplFileInfo */ + /** @var $current \SplFileInfo */ if (! $current->isFile()) { return false; } diff --git a/library/Icinga/File/NonEmptyFileIterator.php b/library/Icinga/File/NonEmptyFileIterator.php index a57de3e23..03756ccd2 100644 --- a/library/Icinga/File/NonEmptyFileIterator.php +++ b/library/Icinga/File/NonEmptyFileIterator.php @@ -37,7 +37,7 @@ class NonEmptyFileIterator extends FilterIterator public function accept() { $current = $this->current(); - /** @type $current \SplFileInfo */ + /** @var $current \SplFileInfo */ if (! $current->isFile() || $current->getSize() === 0 ) { diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index 0a1fe8ae4..03c5ba1b8 100644 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -51,7 +51,7 @@ class ActionController extends Zend_Controller_Action /** * Authentication manager * - * @type Manager|null + * @var Manager|null */ private $auth; diff --git a/library/Icinga/Web/Dom/DomNodeIterator.php b/library/Icinga/Web/Dom/DomNodeIterator.php index 143c9c506..5c1542d5e 100644 --- a/library/Icinga/Web/Dom/DomNodeIterator.php +++ b/library/Icinga/Web/Dom/DomNodeIterator.php @@ -33,7 +33,7 @@ class DomNodeIterator implements RecursiveIterator /** * The node's children * - * @type IteratorIterator + * @var IteratorIterator */ protected $children; diff --git a/library/Icinga/Web/Form.php b/library/Icinga/Web/Form.php index 265da8420..3ff995028 100644 --- a/library/Icinga/Web/Form.php +++ b/library/Icinga/Web/Form.php @@ -145,7 +145,7 @@ class Form extends Zend_Form /** * Authentication manager * - * @type Manager|null + * @var Manager|null */ private $auth; diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index 8d62563be..92ec20607 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -18,7 +18,7 @@ class Menu implements RecursiveIterator /** * The id of this menu * - * @type string + * @var string */ protected $id; @@ -27,7 +27,7 @@ class Menu implements RecursiveIterator * * Used for sorting when priority is unset or equal to other items * - * @type string + * @var string */ protected $title; @@ -36,42 +36,42 @@ class Menu implements RecursiveIterator * * Used for sorting * - * @type int + * @var int */ protected $priority = 100; /** * The url of this menu * - * @type string + * @var string */ protected $url; /** * The path to the icon of this menu * - * @type string + * @var string */ protected $icon; /** * The sub menus of this menu * - * @type array + * @var array */ protected $subMenus = array(); /** * A custom item renderer used instead of the default rendering logic * - * @type MenuItemRenderer + * @var MenuItemRenderer */ protected $itemRenderer = null; /* * Parent menu * - * @type Menu + * @var Menu */ protected $parent; diff --git a/library/Icinga/Web/View.php b/library/Icinga/Web/View.php index 5201e9550..1265c7d21 100644 --- a/library/Icinga/Web/View.php +++ b/library/Icinga/Web/View.php @@ -39,7 +39,7 @@ class View extends Zend_View_Abstract /** * Authentication manager * - * @type \Icinga\Authentication\Manager|null + * @var \Icinga\Authentication\Manager|null */ private $auth; diff --git a/modules/doc/application/views/scripts/chapter.phtml b/modules/doc/application/views/scripts/chapter.phtml index eefe6f65f..fc5b3073b 100644 --- a/modules/doc/application/views/scripts/chapter.phtml +++ b/modules/doc/application/views/scripts/chapter.phtml @@ -1,6 +1,6 @@
- showOnlyCloseButton() ?> + showOnlyCloseButton() ?>
- +
diff --git a/modules/doc/application/views/scripts/index/index.phtml b/modules/doc/application/views/scripts/index/index.phtml index 65fa0b9d2..0b98623ac 100644 --- a/modules/doc/application/views/scripts/index/index.phtml +++ b/modules/doc/application/views/scripts/index/index.phtml @@ -1,5 +1,5 @@
- showOnlyCloseButton(); ?> + showOnlyCloseButton(); ?>

translate('Available documentations'); ?>

    @@ -16,4 +16,4 @@ array('title' => $this->translate('List all modifications for which documentation is available')) ); ?>
-
\ No newline at end of file +
diff --git a/modules/doc/application/views/scripts/module/index.phtml b/modules/doc/application/views/scripts/module/index.phtml index e0c57ae79..a4d9276cc 100644 --- a/modules/doc/application/views/scripts/module/index.phtml +++ b/modules/doc/application/views/scripts/module/index.phtml @@ -1,5 +1,5 @@
- showOnlyCloseButton(); ?> + showOnlyCloseButton(); ?>

translate('Module documentations'); ?>

@@ -16,4 +16,4 @@ ); ?> -
\ No newline at end of file +
diff --git a/modules/doc/application/views/scripts/pdf.phtml b/modules/doc/application/views/scripts/pdf.phtml index e76ded957..2666efb1c 100644 --- a/modules/doc/application/views/scripts/pdf.phtml +++ b/modules/doc/application/views/scripts/pdf.phtml @@ -1,5 +1,5 @@
-

- - +

+ +
diff --git a/modules/doc/application/views/scripts/search/index.phtml b/modules/doc/application/views/scripts/search/index.phtml index 272ab3a79..3311c47a1 100644 --- a/modules/doc/application/views/scripts/search/index.phtml +++ b/modules/doc/application/views/scripts/search/index.phtml @@ -1,5 +1,5 @@
- $search): ?> + $search): ?> isEmpty()): ?>

escape($title) ?>

diff --git a/modules/doc/application/views/scripts/toc.phtml b/modules/doc/application/views/scripts/toc.phtml index daec9b177..5a57e5bda 100644 --- a/modules/doc/application/views/scripts/toc.phtml +++ b/modules/doc/application/views/scripts/toc.phtml @@ -1,7 +1,7 @@
- showOnlyCloseButton() ?> -

+ showOnlyCloseButton() ?> +

- +
diff --git a/modules/doc/configuration.php b/modules/doc/configuration.php index fdbada7af..8ae28763f 100644 --- a/modules/doc/configuration.php +++ b/modules/doc/configuration.php @@ -1,7 +1,7 @@ menuSection($this->translate('Documentation'), array( 'title' => 'Documentation', diff --git a/modules/doc/library/Doc/DocIterator.php b/modules/doc/library/Doc/DocIterator.php index cbea037d6..430d25445 100644 --- a/modules/doc/library/Doc/DocIterator.php +++ b/modules/doc/library/Doc/DocIterator.php @@ -19,7 +19,7 @@ class DocIterator implements Countable, IteratorAggregate /** * Ordered files * - * @type array + * @var array */ protected $fileInfo; diff --git a/modules/doc/library/Doc/DocParser.php b/modules/doc/library/Doc/DocParser.php index 9077d3ef9..a35ebc05b 100644 --- a/modules/doc/library/Doc/DocParser.php +++ b/modules/doc/library/Doc/DocParser.php @@ -18,14 +18,14 @@ class DocParser /** * Path to the documentation * - * @type string + * @var string */ protected $path; /** * Iterator over documentation files * - * @type DocIterator + * @var DocIterator */ protected $docIterator; @@ -130,7 +130,7 @@ class DocParser $tree = new SimpleTree(); $stack = new SplStack(); foreach ($this->docIterator as $fileInfo) { - /** @type $fileInfo \SplFileInfo */ + /** @var $fileInfo \SplFileInfo */ $file = $fileInfo->openFile(); $lastLine = null; foreach ($file as $line) { @@ -143,7 +143,7 @@ class DocParser if ($id === null) { $path = array(); foreach ($stack as $section) { - /** @type $section DocSection */ + /** @var $section DocSection */ $path[] = $section->getTitle(); } $path[] = $title; diff --git a/modules/doc/library/Doc/DocSection.php b/modules/doc/library/Doc/DocSection.php index 4b97db282..4121fd69e 100644 --- a/modules/doc/library/Doc/DocSection.php +++ b/modules/doc/library/Doc/DocSection.php @@ -13,35 +13,35 @@ class DocSection extends TreeNode /** * Chapter the section belongs to * - * @type DocSection + * @var DocSection */ protected $chapter; /** * Content of the section * - * @type array + * @var array */ protected $content = array(); /** * Header level * - * @type int + * @var int */ protected $level; /** * Whether to instruct search engines to not index the link to the section * - * @type bool + * @var bool */ protected $noFollow; /** * Title of the section * - * @type string + * @var string */ protected $title; diff --git a/modules/doc/library/Doc/DocSectionFilterIterator.php b/modules/doc/library/Doc/DocSectionFilterIterator.php index 1087d1584..fa92583ca 100644 --- a/modules/doc/library/Doc/DocSectionFilterIterator.php +++ b/modules/doc/library/Doc/DocSectionFilterIterator.php @@ -19,7 +19,7 @@ class DocSectionFilterIterator extends RecursiveFilterIterator implements Counta /** * Chapter to filter for * - * @type string + * @var string */ protected $chapter; @@ -44,7 +44,7 @@ class DocSectionFilterIterator extends RecursiveFilterIterator implements Counta public function accept() { $section = $this->current(); - /** @type \Icinga\Module\Doc\DocSection $section */ + /** @var \Icinga\Module\Doc\DocSection $section */ if ($section->getChapter()->getId() === $this->chapter) { return true; } diff --git a/modules/doc/library/Doc/Renderer/DocRenderer.php b/modules/doc/library/Doc/Renderer/DocRenderer.php index 4d7ddd0ed..3574f24b0 100644 --- a/modules/doc/library/Doc/Renderer/DocRenderer.php +++ b/modules/doc/library/Doc/Renderer/DocRenderer.php @@ -16,21 +16,21 @@ abstract class DocRenderer extends RecursiveIteratorIterator /** * URL to replace links with * - * @type string + * @var string */ protected $url; /** * Additional URL parameters * - * @type array + * @var array */ protected $urlParams = array(); /** * View * - * @type View|null + * @var View|null */ protected $view; diff --git a/modules/doc/library/Doc/Renderer/DocSearchRenderer.php b/modules/doc/library/Doc/Renderer/DocSearchRenderer.php index 31445dfc8..a89e49333 100644 --- a/modules/doc/library/Doc/Renderer/DocSearchRenderer.php +++ b/modules/doc/library/Doc/Renderer/DocSearchRenderer.php @@ -19,7 +19,7 @@ class DocSearchRenderer extends DocRenderer /** * The content to render * - * @type array + * @var array */ protected $content = array(); @@ -105,7 +105,7 @@ class DocSearchRenderer extends DocRenderer $path, array('highlight-search' => $this->getInnerIterator()->getSearch()->getInput()) ); - /** @type \Icinga\Web\Url $url */ + /** @var \Icinga\Web\Url $url */ $url->setAnchor($this->encodeAnchor($section->getId())); $urlAttributes = array( 'data-base-target' => '_next', diff --git a/modules/doc/library/Doc/Renderer/DocSectionRenderer.php b/modules/doc/library/Doc/Renderer/DocSectionRenderer.php index e6f0ea186..088c5d617 100644 --- a/modules/doc/library/Doc/Renderer/DocSectionRenderer.php +++ b/modules/doc/library/Doc/Renderer/DocSectionRenderer.php @@ -26,28 +26,28 @@ class DocSectionRenderer extends DocRenderer /** * Content to render * - * @type array + * @var array */ protected $content = array(); /** * Search criteria to highlight * - * @type string + * @var string */ protected $highlightSearch; /** * Parsedown instance * - * @type Parsedown + * @var Parsedown */ protected $parsedown; /** * Documentation tree * - * @type SimpleTree + * @var SimpleTree */ protected $tree; @@ -169,7 +169,7 @@ class DocSectionRenderer extends DocRenderer $doc->loadHTML($match[0]); $xpath = new DOMXPath($doc); $blockquote = $xpath->query('//blockquote[1]')->item(0); - /** @type \DOMElement $blockquote */ + /** @var \DOMElement $blockquote */ if (strtolower(substr(trim($blockquote->nodeValue), 0, 5)) === 'note:') { $blockquote->setAttribute('class', 'note'); } @@ -189,7 +189,7 @@ class DocSectionRenderer extends DocRenderer $doc->loadHTML($match[0]); $xpath = new DOMXPath($doc); $img = $xpath->query('//img[1]')->item(0); - /** @type \DOMElement $img */ + /** @var \DOMElement $img */ $img->setAttribute('src', Url::fromPath($img->getAttribute('src'))->getAbsoluteUrl()); return substr_replace($doc->saveXML($img), '', -2, 1); // Replace '/>' with '>' } @@ -206,7 +206,7 @@ class DocSectionRenderer extends DocRenderer if (($section = $this->tree->getNode($this->decodeAnchor($match['fragment']))) === null) { return $match[0]; } - /** @type \Icinga\Module\Doc\DocSection $section */ + /** @var \Icinga\Module\Doc\DocSection $section */ $path = $this->getView()->getHelper('Url')->url( array_merge( $this->urlParams, @@ -219,7 +219,7 @@ class DocSectionRenderer extends DocRenderer false ); $url = $this->getView()->url($path); - /** @type \Icinga\Web\Url $url */ + /** @var \Icinga\Web\Url $url */ $url->setAnchor($this->encodeAnchor($section->getId())); return sprintf( 'url($path); - /** @type \Icinga\Web\Url $url */ + /** @var \Icinga\Web\Url $url */ $url->setAnchor($this->encodeAnchor($section->getId())); $urlAttributes = array( 'data-base-target' => '_next', diff --git a/modules/doc/library/Doc/Search/DocSearch.php b/modules/doc/library/Doc/Search/DocSearch.php index 36f249ed6..459cef208 100644 --- a/modules/doc/library/Doc/Search/DocSearch.php +++ b/modules/doc/library/Doc/Search/DocSearch.php @@ -11,14 +11,14 @@ class DocSearch /** * Search string * - * @type string + * @var string */ protected $input; /** * Search criteria * - * @type array + * @var array */ protected $search; diff --git a/modules/doc/library/Doc/Search/DocSearchIterator.php b/modules/doc/library/Doc/Search/DocSearchIterator.php index 66ccc8c37..b239254aa 100644 --- a/modules/doc/library/Doc/Search/DocSearchIterator.php +++ b/modules/doc/library/Doc/Search/DocSearchIterator.php @@ -19,14 +19,14 @@ class DocSearchIterator extends RecursiveFilterIterator /** * Search criteria * - * @type DocSearch + * @var DocSearch */ protected $search; /** * Current search matches * - * @type DocSearchMatch[]|null + * @var DocSearchMatch[]|null */ protected $matches; @@ -51,7 +51,7 @@ class DocSearchIterator extends RecursiveFilterIterator public function accept() { $section = $this->current(); - /** @type $section \Icinga\Module\Doc\DocSection */ + /** @var $section \Icinga\Module\Doc\DocSection */ $matches = array(); if (($match = $this->search->search($section->getTitle())) !== null) { $matches[] = $match->setMatchType(DocSearchMatch::MATCH_HEADER); diff --git a/modules/doc/library/Doc/Search/DocSearchMatch.php b/modules/doc/library/Doc/Search/DocSearchMatch.php index 4f067d43b..52bd528c9 100644 --- a/modules/doc/library/Doc/Search/DocSearchMatch.php +++ b/modules/doc/library/Doc/Search/DocSearchMatch.php @@ -15,56 +15,56 @@ class DocSearchMatch /** * CSS class for highlighting matches * - * @type string + * @var string */ const HIGHLIGHT_CSS_CLASS = 'search-highlight'; /** * Header match * - * @type int + * @var int */ const MATCH_HEADER = 1; /** * Content match * - * @type int + * @var int */ const MATCH_CONTENT = 2; /** * Line * - * @type string + * @var string */ protected $line; /** * Line number * - * @type int + * @var int */ protected $lineno; /** * Type of the match * - * @type int + * @var int */ protected $matchType; /** * Matches * - * @type array + * @var array */ protected $matches = array(); /** * View * - * @type View|null + * @var View|null */ protected $view; diff --git a/modules/monitoring/application/forms/Config/BackendConfigForm.php b/modules/monitoring/application/forms/Config/BackendConfigForm.php index 62e3858a9..d89c6623f 100644 --- a/modules/monitoring/application/forms/Config/BackendConfigForm.php +++ b/modules/monitoring/application/forms/Config/BackendConfigForm.php @@ -17,7 +17,7 @@ class BackendConfigForm extends ConfigForm /** * The available monitoring backend resources split by type * - * @type array + * @var array */ protected $resources; diff --git a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml index 639437a03..2a4e4b033 100644 --- a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml +++ b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml @@ -1,6 +1,6 @@ getType() === $object::TYPE_HOST) { $isService = false; diff --git a/modules/monitoring/application/views/scripts/show/components/comments.phtml b/modules/monitoring/application/views/scripts/show/components/comments.phtml index fa7d4606a..6a5ed4581 100644 --- a/modules/monitoring/application/views/scripts/show/components/comments.phtml +++ b/modules/monitoring/application/views/scripts/show/components/comments.phtml @@ -2,7 +2,7 @@
translate('Comments'); ?> hasPermission('monitoring/command/comment/add')) { - /** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */ + /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */ if ($object->getType() === $object::TYPE_HOST) { echo $this->qlink( $this->translate('Add comment'), diff --git a/modules/monitoring/application/views/scripts/show/components/downtime.phtml b/modules/monitoring/application/views/scripts/show/components/downtime.phtml index 76a4be005..5a8da065d 100644 --- a/modules/monitoring/application/views/scripts/show/components/downtime.phtml +++ b/modules/monitoring/application/views/scripts/show/components/downtime.phtml @@ -2,7 +2,7 @@ translate('Downtimes'); ?> hasPermission('monitoring/command/downtime/schedule')) { - /** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */ + /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */ if ($object->getType() === $object::TYPE_HOST) { echo $this->qlink( $this->translate('Schedule downtime'), diff --git a/modules/monitoring/configuration.php b/modules/monitoring/configuration.php index fa7732e10..797f1663e 100644 --- a/modules/monitoring/configuration.php +++ b/modules/monitoring/configuration.php @@ -1,7 +1,7 @@ providePermission( 'monitoring/command/*', diff --git a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php index 4baa7aa9b..aa354d85e 100644 --- a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -120,7 +120,7 @@ abstract class MonitoredObject implements Filterable /** * Filter * - * @type Filter + * @var Filter */ protected $filter; From b74ef2527a6d7d5922cbcfb2a67d854b35c725fa Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 12 Mar 2015 15:48:21 +0100 Subject: [PATCH 08/11] CSS: Remove .sort-box ... ... because we don't use it --- modules/monitoring/public/css/module.less | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/monitoring/public/css/module.less b/modules/monitoring/public/css/module.less index 6c205cd04..050a8fb5b 100644 --- a/modules/monitoring/public/css/module.less +++ b/modules/monitoring/public/css/module.less @@ -212,8 +212,3 @@ hr.command-separator { border: none; border-bottom: 2px solid @colorPetrol; } - -.sort-box { - float: right; - margin-right: 1em; -} From 77b99552a49181838db66ffe2fb9e1fae7210b77 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 12 Mar 2015 15:51:22 +0100 Subject: [PATCH 09/11] Add JSDoc to Icinga.Events.prototype.handleAnchor() --- public/js/icinga/events.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 3edd306b9..33bc945bb 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -356,6 +356,11 @@ return false; }, + /** + * Handle anchor, i.e. focus the element which is referenced by the anchor + * + * @param {string} query jQuery selector + */ handleAnchor: function(query) { var $element = $(query); if ($element.length > 0) { From 8b7250bfa6fb05a2bae6e5863772b7ec465a47bf Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 12 Mar 2015 16:02:39 +0100 Subject: [PATCH 10/11] JS: Focus the element referenced by the anchor on anchor navigation ... ... instead of looking for any heading. --- public/js/icinga/events.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 33bc945bb..54b2aaa00 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -364,21 +364,8 @@ handleAnchor: function(query) { var $element = $(query); if ($element.length > 0) { - // Try to find the first header. It is more pleasant to users - // to select the header instead a container - var $header = $element.find(':header:first'); - if ($header.length > 0) { - $element = $header; - } else { - var $input = $element.find(':header:first'); - if ($input.length > 0) { - $element = $input - } - } - // If we want to focus an element which has no tabindex - // add one that we can focus is - if ($element.prop('tabindex') < 0) { - $element.prop('tabindex', 0); + if (typeof $element.attr('tabindex') === 'undefined') { + $element.attr('tabindex', -1); } $element.focus(); } From b37757ca6e096f510b54da46bad9de7c1a91c74b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 12 Mar 2015 16:14:50 +0100 Subject: [PATCH 11/11] Disable the LdapDiscoveryConfirmPage As long as the discovery code does not report multiple results, as it should, actually, it's useless to demand the user to confirm the result. resolves #8602 refs #8725 refs #8708 --- modules/setup/library/Setup/WebWizard.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/setup/library/Setup/WebWizard.php b/modules/setup/library/Setup/WebWizard.php index d16b614f5..afe791732 100644 --- a/modules/setup/library/Setup/WebWizard.php +++ b/modules/setup/library/Setup/WebWizard.php @@ -93,7 +93,7 @@ class WebWizard extends Wizard implements SetupWizard $this->addPage(new PreferencesPage()); $this->addPage(new DbResourcePage()); $this->addPage(new LdapDiscoveryPage()); - $this->addPage(new LdapDiscoveryConfirmPage()); + //$this->addPage(new LdapDiscoveryConfirmPage()); $this->addPage(new LdapResourcePage()); $this->addPage(new AuthBackendPage()); $this->addPage(new AdminAccountPage()); @@ -132,13 +132,13 @@ class WebWizard extends Wizard implements SetupWizard } elseif ($authData['type'] === 'ldap') { $page->setResourceConfig($this->getPageData('setup_ldap_resource')); - $suggestions = $this->getPageData('setup_ldap_discovery_confirm'); + $suggestions = $this->getPageData('setup_ldap_discovery'); if (isset($suggestions['backend'])) { $page->populate($suggestions['backend']); } } - } elseif ($page->getName() === 'setup_ldap_discovery_confirm') { - $page->setResourceConfig($this->getPageData('setup_ldap_discovery')); + /*} elseif ($page->getName() === 'setup_ldap_discovery_confirm') { + $page->setResourceConfig($this->getPageData('setup_ldap_discovery'));*/ } elseif ($page->getName() === 'setup_admin_account') { $page->setBackendConfig($this->getPageData('setup_authentication_backend')); $authData = $this->getPageData('setup_authentication_type'); @@ -169,7 +169,7 @@ class WebWizard extends Wizard implements SetupWizard ); } - $suggestion = $this->getPageData('setup_ldap_discovery_confirm'); + $suggestion = $this->getPageData('setup_ldap_discovery'); if (isset($suggestion['resource'])) { $page->populate($suggestion['resource']); } @@ -199,8 +199,8 @@ class WebWizard extends Wizard implements SetupWizard } elseif ($newPage->getname() === 'setup_ldap_discovery') { $authData = $this->getPageData('setup_authentication_type'); $skip = $authData['type'] !== 'ldap'; - } elseif ($newPage->getName() === 'setup_ldap_discovery_confirm') { - $skip = false === $this->hasPageData('setup_ldap_discovery'); + /*} elseif ($newPage->getName() === 'setup_ldap_discovery_confirm') { + $skip = false === $this->hasPageData('setup_ldap_discovery');*/ } elseif ($newPage->getName() === 'setup_ldap_resource') { $authData = $this->getPageData('setup_authentication_type'); $skip = $authData['type'] !== 'ldap';