Update oci.php

Error Fixed

combined the database errors

Merged Database Errors
This commit is contained in:
Manish Bisht 2016-03-14 21:30:59 +05:30 committed by Morris Jobke
parent b4ea527fb2
commit 07e7d4836e
2 changed files with 8 additions and 6 deletions

View File

@ -59,10 +59,11 @@ abstract class AbstractDatabase {
public function validate($config) {
$errors = array();
if(empty($config['dbuser'])) {
if(empty($config['dbuser']) && empty($config['dbname'])) {
$errors[] = $this->trans->t("%s enter the database username and name.", array($this->dbprettyname));
} else if(empty($config['dbuser'])) {
$errors[] = $this->trans->t("%s enter the database username.", array($this->dbprettyname));
}
if(empty($config['dbname'])) {
} else if(empty($config['dbname'])) {
$errors[] = $this->trans->t("%s enter the database name.", array($this->dbprettyname));
}
if(substr_count($config['dbname'], '.') >= 1) {

View File

@ -50,10 +50,11 @@ class OCI extends AbstractDatabase {
public function validate($config) {
$errors = array();
if(empty($config['dbuser'])) {
if(empty($config['dbuser']) && empty($config['dbname'])) {
$errors[] = $this->trans->t("%s enter the database username and name.", array($this->dbprettyname));
} else if(empty($config['dbuser'])) {
$errors[] = $this->trans->t("%s enter the database username.", array($this->dbprettyname));
}
if(empty($config['dbname'])) {
} else if(empty($config['dbname'])) {
$errors[] = $this->trans->t("%s enter the database name.", array($this->dbprettyname));
}
return $errors;