From 399bbf0795cc502c75ab94538d920ba97300cb45 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 11 May 2015 16:01:20 +0200 Subject: [PATCH] AuthenticationStep: Adjust usage of a DbUserBackend's insert capability refs #8826 --- .../setup/library/Setup/Steps/AuthenticationStep.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/setup/library/Setup/Steps/AuthenticationStep.php b/modules/setup/library/Setup/Steps/AuthenticationStep.php index 913f83066..58d9d68d7 100644 --- a/modules/setup/library/Setup/Steps/AuthenticationStep.php +++ b/modules/setup/library/Setup/Steps/AuthenticationStep.php @@ -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;