From 183bd8309a6fea7046837aa9e8f9409e5eb46c88 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 17 Jul 2015 08:42:37 -0500 Subject: [PATCH] Don't break installation when the local db root user has no password Reverts broken patch 0cf4e92d; it seems to have been intended to validate the *to be created* db username/pass, but instead it validates the *installation username/pass*. This made it impossible to install if your db user had no password, as on many default dev installations. Bug: T85281 Change-Id: I0caaf8b9a244d6f4dad0cba32c566ea557f77fcc --- includes/installer/MysqlInstaller.php | 10 +--------- includes/installer/PostgresInstaller.php | 11 +---------- includes/installer/i18n/en.json | 2 -- includes/installer/i18n/qqq.json | 4 +--- 4 files changed, 3 insertions(+), 24 deletions(-) diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 3af08d60e4..e5c1a1db06 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -93,9 +93,7 @@ class MysqlInstaller extends DatabaseInstaller { public function submitConnectForm() { // Get variables from the request. - $newValues = $this->setVarsFromRequest( array( - 'wgDBserver', 'wgDBname', 'wgDBprefix', '_InstallUser', '_InstallPassword' - ) ); + $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBname', 'wgDBprefix' ) ); // Validate them. $status = Status::newGood(); @@ -110,12 +108,6 @@ class MysqlInstaller extends DatabaseInstaller { if ( !preg_match( '/^[a-z0-9_-]*$/i', $newValues['wgDBprefix'] ) ) { $status->fatal( 'config-invalid-db-prefix', $newValues['wgDBprefix'] ); } - if ( !strlen( $newValues['_InstallUser'] ) ) { - $status->fatal( 'config-db-username-empty' ); - } - if ( !strlen( $newValues['_InstallPassword'] ) ) { - $status->fatal( 'config-db-password-empty', $newValues['_InstallUser'] ); - } if ( !$status->isOK() ) { return $status; } diff --git a/includes/installer/PostgresInstaller.php b/includes/installer/PostgresInstaller.php index b18fe94487..cb40f884f1 100644 --- a/includes/installer/PostgresInstaller.php +++ b/includes/installer/PostgresInstaller.php @@ -83,10 +83,7 @@ class PostgresInstaller extends DatabaseInstaller { function submitConnectForm() { // Get variables from the request - $newValues = $this->setVarsFromRequest( array( - 'wgDBserver', 'wgDBport', 'wgDBname', 'wgDBmwschema', - '_InstallUser', '_InstallPassword' - ) ); + $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBport', 'wgDBname', 'wgDBmwschema' ) ); // Validate them $status = Status::newGood(); @@ -98,12 +95,6 @@ class PostgresInstaller extends DatabaseInstaller { if ( !preg_match( '/^[a-zA-Z0-9_]*$/', $newValues['wgDBmwschema'] ) ) { $status->fatal( 'config-invalid-schema', $newValues['wgDBmwschema'] ); } - if ( !strlen( $newValues['_InstallUser'] ) ) { - $status->fatal( 'config-db-username-empty' ); - } - if ( !strlen( $newValues['_InstallPassword'] ) ) { - $status->fatal( 'config-db-password-empty', $newValues['_InstallUser'] ); - } // Submit user box if ( $status->isOK() ) { diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json index c19e3ee676..1eb8e033d8 100644 --- a/includes/installer/i18n/en.json +++ b/includes/installer/i18n/en.json @@ -97,8 +97,6 @@ "config-db-install-account": "User account for installation", "config-db-username": "Database username:", "config-db-password": "Database password:", - "config-db-password-empty": "Please enter a password for the new database user: $1.\nWhile it may be possible to create users with no passwords, it is not secure.", - "config-db-username-empty": "You must enter a value for \"{{int:config-db-username}}\".", "config-db-install-username": "Enter the username that will be used to connect to the database during the installation process.\nThis is not the username of the MediaWiki account; this is the username for your database.", "config-db-install-password": "Enter the password that will be used to connect to the database during the installation process.\nThis is not the password for the MediaWiki account; this is the password for your database.", "config-db-install-help": "Enter the username and password that will be used to connect to the database during the installation process.", diff --git a/includes/installer/i18n/qqq.json b/includes/installer/i18n/qqq.json index fba5165c24..89f2dd99c2 100644 --- a/includes/installer/i18n/qqq.json +++ b/includes/installer/i18n/qqq.json @@ -113,10 +113,8 @@ "config-db-name-oracle": "Field label in the MediaWiki installer where an Oracle database schema can be specified.", "config-db-account-oracle-warn": "A \"[[:wikipedia:Front and back ends|backend]]\" is a system or component that ordinary users don't interact with directly and don't need to know about, and that is responsible for a distinct task or service - for example, a storage back-end is a generic system for storing data which other applications can use. Possible alternatives for back-end are \"system\" or \"service\", or (depending on context and language) even leave it untranslated.", "config-db-install-account": "Legend in the MediaWiki installer for the section where database username and password have to be provided.", - "config-db-username": "Used as label.\n\nAlso used in {{msg-mw|Config-db-username-empty}}.", + "config-db-username": "Used as label.", "config-db-password": "Field label in the MediaWiki installer where database password has to be provided.", - "config-db-password-empty": "Used as error message. Parameters:\n* $1 - database username", - "config-db-username-empty": "Used as error message. Shown when the database username is not entered by the user.\n\nRefers to {{msg-mw|Config-db-username}}.", "config-db-install-username": "Help box text in the MediaWiki installer clarifying the requirement for database username.", "config-db-install-password": "Help box text in the MediaWiki installer clarifying the requirement for database password.", "config-db-install-help": "Help text in MediaWiki installer.", -- 2.20.1