X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FPostgresInstaller.php;h=9e25f47e8e51a4a2997aaad869bbb3377dd445bb;hb=7b7f4bad9706fc1cbc2ce3497378ac41a8d68626;hp=2cf41564f0de45425c3b974ad4b480c768911ba2;hpb=8cabb5f7778574aa723e5615b27a3f5ac104c48d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/PostgresInstaller.php b/includes/installer/PostgresInstaller.php index 2cf41564f0..9e25f47e8e 100644 --- a/includes/installer/PostgresInstaller.php +++ b/includes/installer/PostgresInstaller.php @@ -83,8 +83,10 @@ class PostgresInstaller extends DatabaseInstaller { function submitConnectForm() { // Get variables from the request - $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBport', - 'wgDBname', 'wgDBmwschema' ) ); + $newValues = $this->setVarsFromRequest( array( + 'wgDBserver', 'wgDBport','wgDBname', 'wgDBmwschema', + '_InstallUser', '_InstallPassword' + ) ); // Validate them $status = Status::newGood(); @@ -96,6 +98,12 @@ 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() ) { @@ -210,8 +218,7 @@ class PostgresInstaller extends DatabaseInstaller { * - create-tables: A connection with a role suitable for creating tables. * * @throws MWException - * @return Status object. On success, a connection object will be in the - * value member. + * @return Status On success, a connection object will be in the value member. */ protected function openPgConnection( $type ) { switch ( $type ) { @@ -406,7 +413,7 @@ class PostgresInstaller extends DatabaseInstaller { /** * Recursive helper for canCreateObjectsForWebUser(). - * @param $conn DatabaseBase object + * @param DatabaseBase $conn * @param int $targetMember Role ID of the member to look for * @param int $group Role ID of the group to look for * @param int $maxDepth Maximum recursive search depth