Do not hardcode the php username dummy in Icinga\Application\Platform

refs #7163
This commit is contained in:
Johannes Meyer 2014-11-07 14:40:28 +01:00
parent eadc7d8415
commit f85ddeb215
2 changed files with 3 additions and 5 deletions

View File

@ -65,13 +65,13 @@ $setupTokenPath = rtrim(Icinga::app()->getConfigDir(), '/') . '/setup.token';
); ?></p>
<p><?= t('If you\'ve got the IcingaCLI installed you can do the following:'); ?></p>
<div class="code">
<span>sudo icingacli setup createConfigDirectory <?= Platform::getPhpUser(); ?>;</span>
<span>sudo icingacli setup createConfigDirectory <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?>;</span>
<span>sudo icingacli setup generateToken;</span>
</div>
<p><?= t('In case the IcingaCLI is missing you can create the token manually:'); ?></p>
<div class="code">
<span>sudo mkdir -m 2775 <?= dirname($setupTokenPath); ?> && sudo chgrp <?= Platform::getPhpUser(); ?> <?= dirname($setupTokenPath); ?>;</span>
<span>head -c 12 /dev/urandom | base64 | sudo -u '<?= Platform::getPhpUser(); ?>' tee <?= $setupTokenPath; ?>;</span>
<span>sudo mkdir -m 2775 <?= dirname($setupTokenPath); ?> && sudo chgrp <?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?> <?= dirname($setupTokenPath); ?>;</span>
<span>head -c 12 /dev/urandom | base64 | sudo -u '<?= ($user = Platform::getPhpUser()) !== null ? $user : 'your_webserver_group'; ?>' tee <?= $setupTokenPath; ?>;</span>
<span>sudo chmod 0660 <?= $setupTokenPath; ?>;</span>
</div>
<p style="font-size: 85%;"><?= sprintf(

View File

@ -156,8 +156,6 @@ class Platform
$userInfo = posix_getpwuid(posix_geteuid());
return $userInfo['name'];
}
return 'php_username';
}
/**