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();
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() ) {
* - 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 ) {
/**
* 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