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']))
|
ResourceFactory::createResource(new ConfigObject($this->data['adminAccountData']['resourceConfig']))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (array_search($this->data['adminAccountData']['username'], $backend->listUsers()) === false) {
|
if ($backend->select()->where('user_name', $this->data['adminAccountData']['username'])->count() === 0) {
|
||||||
$backend->addUser(
|
$backend->insert('user', array(
|
||||||
$this->data['adminAccountData']['username'],
|
'user_name' => $this->data['adminAccountData']['username'],
|
||||||
$this->data['adminAccountData']['password']
|
'password' => $this->data['adminAccountData']['password'],
|
||||||
);
|
'is_active' => true
|
||||||
|
));
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->dbError = $e;
|
$this->dbError = $e;
|
||||||
|
|
Loading…
Reference in New Issue