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'])) 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;