AuthenticationStep: Adjust usage of a DbUserBackend's insert capability

refs #8826
This commit is contained in:
Johannes Meyer 2015-05-11 16:01:20 +02:00
parent 44bbd93cbc
commit 399bbf0795
1 changed files with 6 additions and 5 deletions

View File

@ -88,11 +88,12 @@ class AuthenticationStep extends Step
ResourceFactory::createResource(new ConfigObject($this->data['adminAccountData']['resourceConfig']))
);
if (array_search($this->data['adminAccountData']['username'], $backend->listUsers()) === false) {
$backend->addUser(
$this->data['adminAccountData']['username'],
$this->data['adminAccountData']['password']
);
if ($backend->select()->where('user_name', $this->data['adminAccountData']['username'])->count() === 0) {
$backend->insert('user', array(
'user_name' => $this->data['adminAccountData']['username'],
'password' => $this->data['adminAccountData']['password'],
'is_active' => true
));
}
} catch (Exception $e) {
$this->dbError = $e;