From ec47f6bdb3de3b26d97ff22f61f65f2d0ee70097 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 30 Oct 2014 09:53:58 +0100 Subject: [PATCH] Create permissions.ini when defining the initial administrator refs #7163 --- .../Icinga/Installation/AuthenticationStep.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/library/Icinga/Installation/AuthenticationStep.php b/library/Icinga/Installation/AuthenticationStep.php index 98656cff9c..17826820b6 100644 --- a/library/Icinga/Installation/AuthenticationStep.php +++ b/library/Icinga/Installation/AuthenticationStep.php @@ -67,6 +67,24 @@ protected function createAuthenticationIni() protected function defineInitialAdmin() { + $config = array(); + $config['admins'] = array( + 'users' => $this->data['adminAccountData']['username'], + 'permission' => '*' + ); + + try { + $writer = new PreservingIniWriter(array( + 'config' => new Zend_Config($config), + 'filename' => Config::resolvePath('permissions.ini'), + 'filemode' => octdec($this->data['fileMode']) + )); + $writer->write(); + } catch (Exception $e) { + $this->permIniError = $e; + return false; + } + $this->permIniError = false; return true; }