From 8ca6cc32b2c789a3149861159ad258f2cb9491e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:39:39 +0200 Subject: Adding upstream version 2.11.4. Signed-off-by: Daniel Baumann --- .../views/scripts/form/setup-modules.phtml | 33 ++++++ .../views/scripts/form/setup-requirements.phtml | 48 +++++++++ .../views/scripts/form/setup-summary.phtml | 40 +++++++ .../views/scripts/form/setup-welcome.phtml | 120 +++++++++++++++++++++ 4 files changed, 241 insertions(+) create mode 100644 modules/setup/application/views/scripts/form/setup-modules.phtml create mode 100644 modules/setup/application/views/scripts/form/setup-requirements.phtml create mode 100644 modules/setup/application/views/scripts/form/setup-summary.phtml create mode 100644 modules/setup/application/views/scripts/form/setup-welcome.phtml (limited to 'modules/setup/application/views/scripts/form') diff --git a/modules/setup/application/views/scripts/form/setup-modules.phtml b/modules/setup/application/views/scripts/form/setup-modules.phtml new file mode 100644 index 0000000..e57c7dc --- /dev/null +++ b/modules/setup/application/views/scripts/form/setup-modules.phtml @@ -0,0 +1,33 @@ + +
+

translate('Modules', 'setup.page.title'); ?>

+

translate('The following modules were found in your Icinga Web 2 installation. To enable and configure a module, just tick it and click "Next".'); ?>

+getElements() as $element): ?> + getName(), array(Wizard::BTN_PREV, Wizard::BTN_NEXT, Wizard::PROGRESS_ELEMENT, $form->getTokenElementName(), $form->getUidElementName()))): ?> +
+
+

+
+ +
+
+ +
+ + + getElement($form->getTokenElementName()); ?> + getElement($form->getUidElementName()); ?> + getDisplayGroup('buttons'); ?> +
diff --git a/modules/setup/application/views/scripts/form/setup-requirements.phtml b/modules/setup/application/views/scripts/form/setup-requirements.phtml new file mode 100644 index 0000000..544f284 --- /dev/null +++ b/modules/setup/application/views/scripts/form/setup-requirements.phtml @@ -0,0 +1,48 @@ +getWizard()->getRequirements()->fulfilled()) { + $form->getElement(Wizard::BTN_NEXT)->setAttrib('disabled', 1); +} + +?> +

Icinga Web 2

+getWizard()->getRequirements(true); ?> +getWizard()->getPage('setup_modules')->getModuleWizards() as $moduleName => $wizard): ?> +

translate('Module'); ?>

+getRequirements(); ?> + +
+ getElement($form->getTokenElementName()); ?> + getElement($form->getUidElementName()); ?> +
+ getElement(Wizard::BTN_NEXT); + echo $double->setAttrib('class', 'double'); + ?> + getElement(Wizard::BTN_PREV); ?> + getElement(Wizard::BTN_NEXT); ?> + getElement(Wizard::PROGRESS_ELEMENT); ?> +
+ translate('You may also need to restart the web-server for the changes to take effect!'); ?> + qlink( + $this->translate('Refresh'), + null, + null, + array( + 'class' => 'button-link', + 'title' => $title, + 'aria-label' => sprintf($this->translate('Refresh the page; %s'), $title) + ) + ); ?> +
+
+
\ No newline at end of file diff --git a/modules/setup/application/views/scripts/form/setup-summary.phtml b/modules/setup/application/views/scripts/form/setup-summary.phtml new file mode 100644 index 0000000..3ad0265 --- /dev/null +++ b/modules/setup/application/views/scripts/form/setup-summary.phtml @@ -0,0 +1,40 @@ +getElement(Wizard::BTN_NEXT)->setAttrib( + 'class', + $form->getElement(Wizard::BTN_NEXT)->getAttrib('class') . ' finish' +); + +?> +

translate( + 'You\'ve configured %1$s successfully. You can review the changes supposed to be made before setting it up.' + . ' Make sure that everything is correct (Feel free to navigate back to make any corrections!) so' + . ' that you can start using %1$s right after it has successfully been set up.' + ), + $form->getSubjectTitle() +); ?>

+
+getSummary() as $pageHtml): ?> + +
+ +
+ + +
+
+ getElement($form->getTokenElementName()); ?> + getElement($form->getUidElementName()); ?> + getDisplayGroup('buttons'); ?> +
\ No newline at end of file diff --git a/modules/setup/application/views/scripts/form/setup-welcome.phtml b/modules/setup/application/views/scripts/form/setup-welcome.phtml new file mode 100644 index 0000000..1be68f3 --- /dev/null +++ b/modules/setup/application/views/scripts/form/setup-welcome.phtml @@ -0,0 +1,120 @@ +getConfigDir(); +$setupTokenPath = rtrim($configDir, '/') . '/setup.token'; +$cliPath = realpath(Icinga::app()->getApplicationDir() . '/../bin/icingacli'); + +$groupadd = null; +$docker = getenv('ICINGAWEB_OFFICIAL_DOCKER_IMAGE'); + +if (! (false === ($distro = Platform::getLinuxDistro(1)) || $distro === 'linux')) { + foreach (array( + 'groupadd -r icingaweb2' => array( + 'redhat', 'rhel', 'centos', 'fedora', + 'suse', 'sles', 'sled', 'opensuse' + ), + 'addgroup --system icingaweb2' => array('debian', 'ubuntu') + ) as $groupadd_ => $distros) { + if (in_array($distro, $distros)) { + $groupadd = $groupadd_; + break; + } + } + + switch ($distro) { + case 'redhat': + case 'rhel': + case 'centos': + case 'fedora': + $usermod = 'usermod -a -G icingaweb2 %s'; + $webSrvUser = 'apache'; + break; + case 'suse': + case 'sles': + case 'sled': + case 'opensuse': + $usermod = 'usermod -A icingaweb2 %s'; + $webSrvUser = 'wwwrun'; + break; + case 'debian': + case 'ubuntu': + $usermod = 'usermod -a -G icingaweb2 %s'; + $webSrvUser = 'www-data'; + break; + default: + $usermod = $webSrvUser = null; + } +} +?> +
+

translate('Welcome to the configuration of Icinga Web 2!') ?>

+ +

translate( + 'You\'ve already completed the configuration of Icinga Web 2. Note that most of your configuration' + . ' files will be overwritten in case you\'ll re-configure Icinga Web 2 using this wizard!' + ); ?>

+ +

translate( + 'This wizard will guide you through the configuration of Icinga Web 2. Once completed and successfully' + . ' finished you are able to log in and to explore all the new and stunning features!' + ); ?>

+ +
+ getElement('token'); ?> + getElement($form->getTokenElementName()); ?> + getElement($form->getUidElementName()); ?> +
+ getElement(Wizard::BTN_NEXT); ?> +
+
+
+

translate('Generating a New Setup Token'); ?>

+
+

translate( + 'To run this wizard a user needs to authenticate using a token which is usually' + . ' provided to him by an administrator who\'d followed the instructions below.' + ); ?>

+ +

translate('In any case, make sure that all of the following applies to your environment:'); ?>

+
    +
  • translate('A system group called "icingaweb2" exists'); ?>
  • + +
  • translate('The user "%s" is a member of the system group "icingaweb2"'), $phpUser); ?>
  • + +
  • translate('Your webserver\'s user is a member of the system group "icingaweb2"'); ?>
  • + +
+ +
+ escape($groupadd . ';') ?> + escape(sprintf($usermod, $phpUser ?: $webSrvUser) . ';') ?> +
+ +

translate('If you\'ve got the IcingaCLI installed you can do the following:'); ?>

+ +
+ + setup config directory --group icingaweb2; + + setup token create; +
+ +

translate('In case the IcingaCLI is missing you can create the token manually:'); ?>

+
+ su translate(''); ?> -s /bin/sh -c "mkdir -m 2770 ; chgrp icingaweb2 ; head -c 12 /dev/urandom | base64 | tee ; chmod 0660 ;"; +
+ +

translate('Please see the %s for an extensive description on how to access and use this wizard.'), + '' . $this->translate('Icinga Web 2 documentation') . '' // TODO: Add link to iw2 docs which points to the installation topic + ); ?>

+
+
+
-- cgit v1.2.3