'_InstallUser' => 'postgres',
);
- var $minimumVersion = '8.3';
- var $maxRoleSearchDepth = 5;
+ public $minimumVersion = '8.3';
+ public $maxRoleSearchDepth = 5;
protected $pgConns = array();
}
function getConnectForm() {
- return $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) .
+ return $this->getTextBox(
+ 'wgDBserver',
+ 'config-db-host',
+ array(),
+ $this->parent->getHelpBox( 'config-db-host-help' )
+ ) .
$this->getTextBox( 'wgDBport', 'config-db-port' ) .
Html::openElement( 'fieldset' ) .
Html::element( 'legend', array(), wfMessage( 'config-db-wiki-settings' )->text() ) .
- $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-db-name-help' ) ) .
- $this->getTextBox( 'wgDBmwschema', 'config-db-schema', array(), $this->parent->getHelpBox( 'config-db-schema-help' ) ) .
+ $this->getTextBox(
+ 'wgDBname',
+ 'config-db-name',
+ array(),
+ $this->parent->getHelpBox( 'config-db-name-help' )
+ ) .
+ $this->getTextBox(
+ 'wgDBmwschema',
+ 'config-db-schema',
+ array(),
+ $this->parent->getHelpBox( 'config-db-schema-help' )
+ ) .
Html::closeElement( 'fieldset' ) .
$this->getInstallUserBox();
}
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