mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
DbConnection: Make host optional for Oracle connections
This commit is contained in:
parent
63cb9d7283
commit
2df8132c46
@ -58,6 +58,12 @@ class DbResourceForm extends Form
|
|||||||
$offerMysql = true;
|
$offerMysql = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($dbChoice === 'oracle') {
|
||||||
|
$hostIsRequired = false;
|
||||||
|
} else {
|
||||||
|
$hostIsRequired = true;
|
||||||
|
}
|
||||||
|
|
||||||
$socketInfo = '';
|
$socketInfo = '';
|
||||||
if ($offerPostgres) {
|
if ($offerPostgres) {
|
||||||
$socketInfo = $this->translate(
|
$socketInfo = $this->translate(
|
||||||
@ -104,7 +110,7 @@ class DbResourceForm extends Form
|
|||||||
'text',
|
'text',
|
||||||
'host',
|
'host',
|
||||||
array (
|
array (
|
||||||
'required' => true,
|
'required' => $hostIsRequired,
|
||||||
'label' => $this->translate('Host'),
|
'label' => $this->translate('Host'),
|
||||||
'description' => $this->translate('The hostname of the database')
|
'description' => $this->translate('The hostname of the database')
|
||||||
. ($socketInfo ? '. ' . $socketInfo : ''),
|
. ($socketInfo ? '. ' . $socketInfo : ''),
|
||||||
|
@ -215,6 +215,11 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
|
|||||||
case 'oracle':
|
case 'oracle':
|
||||||
$adapter = 'Pdo_Oci';
|
$adapter = 'Pdo_Oci';
|
||||||
$defaultPort = 1521;
|
$defaultPort = 1521;
|
||||||
|
|
||||||
|
// remove host parameter when not configured
|
||||||
|
if (empty($this->config->host)) {
|
||||||
|
unset($adapterParamaters['host']);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'pgsql':
|
case 'pgsql':
|
||||||
$adapter = 'Pdo_Pgsql';
|
$adapter = 'Pdo_Pgsql';
|
||||||
@ -555,7 +560,7 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
|
|||||||
'Connection to %s as %s on %s:%s successful',
|
'Connection to %s as %s on %s:%s successful',
|
||||||
$config['dbname'],
|
$config['dbname'],
|
||||||
$config['username'],
|
$config['username'],
|
||||||
$config['host'],
|
array_key_exists('host', $config) ? $config['host'] : '(none)',
|
||||||
$config['port']
|
$config['port']
|
||||||
));
|
));
|
||||||
switch ($this->dbType) {
|
switch ($this->dbType) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user