From d02c078e4ae269d1c984bf0eab5b90f2f6c80a53 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 15 Apr 2015 09:26:39 +0200 Subject: [PATCH] Wizard: Ensure that privileges are checked only once Another entry in the "The provided credentials cannot be used to create the database and/or the user" story... --- modules/setup/library/Setup/WebWizard.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/setup/library/Setup/WebWizard.php b/modules/setup/library/Setup/WebWizard.php index 1180379bb2..96d39e63f8 100644 --- a/modules/setup/library/Setup/WebWizard.php +++ b/modules/setup/library/Setup/WebWizard.php @@ -158,7 +158,7 @@ public function setupPage(Form $page, Request $request) } } elseif ($page->getName() === 'setup_database_creation') { $page->setDatabaseSetupPrivileges( - array_merge($this->databaseCreationPrivileges, $this->databaseSetupPrivileges) + array_unique(array_merge($this->databaseCreationPrivileges, $this->databaseSetupPrivileges)) ); $page->setDatabaseUsagePrivileges($this->databaseUsagePrivileges); $page->setResourceConfig($this->getPageData('setup_db_resource')); @@ -236,7 +236,9 @@ protected function getNewPage($requestedPage, Form $originPage) // It is not possible to reliably determine whether a database exists or not if a user can't // log in to the database, so we just require the user to be able to create the database $skip = $db->checkPrivileges( - array_merge($this->databaseCreationPrivileges, $this->databaseSetupPrivileges), + array_unique( + array_merge($this->databaseCreationPrivileges, $this->databaseSetupPrivileges) + ), $this->databaseTables ); } catch (PDOException $_) {