mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Do not use a new function for getting the configuration directory in our web wizard
This commit is contained in:
parent
839523a73f
commit
19387b24ab
@ -9,6 +9,7 @@ use Icinga\Web\Form;
|
|||||||
use Icinga\Web\Wizard;
|
use Icinga\Web\Wizard;
|
||||||
use Icinga\Web\Request;
|
use Icinga\Web\Request;
|
||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
|
use Icinga\Application\Icinga;
|
||||||
use Icinga\Application\Platform;
|
use Icinga\Application\Platform;
|
||||||
use Icinga\Module\Setup\Forms\ModulePage;
|
use Icinga\Module\Setup\Forms\ModulePage;
|
||||||
use Icinga\Module\Setup\Forms\WelcomePage;
|
use Icinga\Module\Setup\Forms\WelcomePage;
|
||||||
@ -343,7 +344,7 @@ class WebWizard extends Wizard implements SetupWizard
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$configDir = $this->getConfigDir();
|
$configDir = Icinga::app()->getConfigDir();
|
||||||
$setup->addStep(
|
$setup->addStep(
|
||||||
new MakeDirStep(
|
new MakeDirStep(
|
||||||
array(
|
array(
|
||||||
@ -528,7 +529,7 @@ class WebWizard extends Wizard implements SetupWizard
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$configDir = $this->getConfigDir();
|
$configDir = Icinga::app()->getConfigDir();
|
||||||
$requirements->addMandatory(
|
$requirements->addMandatory(
|
||||||
mt('setup', 'Writable Config Directory'),
|
mt('setup', 'Writable Config Directory'),
|
||||||
mt(
|
mt(
|
||||||
@ -551,21 +552,4 @@ class WebWizard extends Wizard implements SetupWizard
|
|||||||
|
|
||||||
return $requirements;
|
return $requirements;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the configuration directory of Icinga Web 2
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function getConfigDir()
|
|
||||||
{
|
|
||||||
if (array_key_exists('ICINGAWEB_CONFIGDIR', $_SERVER)) {
|
|
||||||
$configDir = $_SERVER['ICINGAWEB_CONFIGDIR'];
|
|
||||||
} else {
|
|
||||||
$configDir = '/etc/icingaweb';
|
|
||||||
}
|
|
||||||
|
|
||||||
$canonical = realpath($configDir);
|
|
||||||
return $canonical ? $canonical : $configDir;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user