Skip to content

Commit

Permalink
Create permissions.ini when defining the initial administrator
Browse files Browse the repository at this point in the history
refs #7163
  • Loading branch information
Johannes Meyer committed Oct 30, 2014
1 parent 3fc0749 commit ec47f6b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions library/Icinga/Installation/AuthenticationStep.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit ec47f6b

Please sign in to comment.