From 31560c9249dddd5863839aa448a700b01b5ca8bc Mon Sep 17 00:00:00 2001
From: Johannes Meyer
Date: Thu, 5 Mar 2015 10:30:06 +0100
Subject: [PATCH] Wizard: Explain that the webserver user must be in the group
"icingaweb2"
resolves #8491
---
.../views/scripts/form/setup-welcome.phtml | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/modules/setup/application/views/scripts/form/setup-welcome.phtml b/modules/setup/application/views/scripts/form/setup-welcome.phtml
index d4bc1c3d7..1b37f60f0 100644
--- a/modules/setup/application/views/scripts/form/setup-welcome.phtml
+++ b/modules/setup/application/views/scripts/form/setup-welcome.phtml
@@ -5,6 +5,7 @@ use Icinga\Application\Config;
use Icinga\Application\Platform;
use Icinga\Web\Wizard;
+$phpUser = Platform::getPhpUser();
$configDir = Icinga::app()->getConfigDir();
$setupTokenPath = rtrim($configDir, '/') . '/setup.token';
$cliPath = realpath(Icinga::app()->getApplicationDir() . '/../bin/icingacli');
@@ -41,10 +42,15 @@ $cliPath = realpath(Icinga::app()->getApplicationDir() . '/../bin/icingacli');
'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.'
); ?>
- = $this->translate('In any case, make sure that a group called "icingaweb2" exists:'); ?>
-
- groupadd icingaweb2;
-
+ = $this->translate('In any case, make sure that all of the following applies to your environment:'); ?>
+
+ - = $this->translate('A system group called "icingaweb2" exists'); ?>
+
+ - = sprintf($this->translate('The user "%s" is a member of the system group "icingaweb2"'), $phpUser); ?>
+
+ - = $this->translate('Your webserver\'s user is a member of the system group "icingaweb2"'); ?>
+
+
= $this->translate('If you\'ve got the IcingaCLI installed you can do the following:'); ?>
= $cliPath ? $cliPath : 'icingacli'; ?> setup config directory --group icingaweb2= $configDir !== '/etc/icingaweb2' ? ' --config ' . $configDir : ''; ?>;
@@ -52,7 +58,7 @@ $cliPath = realpath(Icinga::app()->getApplicationDir() . '/../bin/icingacli');
= $this->translate('In case the IcingaCLI is missing you can create the token manually:'); ?>
- su = ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_user'; ?> -c "mkdir -m 2770 = dirname($setupTokenPath); ?>; chgrp icingaweb2 = dirname($setupTokenPath); ?>; head -c 12 /dev/urandom | base64 | tee = $setupTokenPath; ?>; chmod 0660 = $setupTokenPath; ?>;";
+ su = $phpUser ?: $this->translate(''); ?> -c "mkdir -m 2770 = dirname($setupTokenPath); ?>; chgrp icingaweb2 = dirname($setupTokenPath); ?>; head -c 12 /dev/urandom | base64 | tee = $setupTokenPath; ?>; chmod 0660 = $setupTokenPath; ?>;";
= sprintf(
$this->translate('Please see the %s for an extensive description on how to access and use this wizard.'),