AuthenticationStep: Adjust usage of a DbUserBackend's insert capability
refs #8826
This commit is contained in:
parent
44bbd93cbc
commit
399bbf0795
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue