Skip to content
Snippets Groups Projects
Commit bb690d44 authored by Florian Schaal's avatar Florian Schaal
Browse files

updated avoid the second use of query in install.php

parent 7eade0da
No related branches found
No related tags found
No related merge requests found
...@@ -171,21 +171,16 @@ $install_mode = $inst->simple_query('Installation mode', array('standard', 'expe ...@@ -171,21 +171,16 @@ $install_mode = $inst->simple_query('Installation mode', array('standard', 'expe
//** Get the hostname //** Get the hostname
$tmp_out = array(); $tmp_out = array();
exec('hostname -f', $tmp_out); exec('hostname -f', $tmp_out);
$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', @$tmp_out[0],'hostname'); $conf['hostname']=$tmp_out[0];
//** Prevent empty hostname
$conf['hostname']=trim(@$tmp_out[0]);
unset($tmp_out); unset($tmp_out);
//** Prevent empty hostname
if($conf['hostname'] === '') { $check = false;
$check = false; do {
do { $conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', $conf['hostname'], 'hostname');
swriteln('Hostname may not be empty.'); $conf['hostname']=trim($conf['hostname']);
$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', '', 'hostname'); $check = @($conf['hostname'] !== '')?true:false;
$conf['hostname']=trim($conf['hostname']); if(!$check) swriteln('Hostname may not be empty.');
$check = @($conf['hostname'] !== '')?true:false; } while (!$check);
} while (!$check);
}
// Check if the mysql functions are loaded in PHP // Check if the mysql functions are loaded in PHP
if(!function_exists('mysql_connect')) die('No PHP MySQL functions available. Please ensure that the PHP MySQL module is loaded.'); if(!function_exists('mysql_connect')) die('No PHP MySQL functions available. Please ensure that the PHP MySQL module is loaded.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment