Commit ee405d84 authored by Florian Schaal's avatar Florian Schaal

Prevent empty hostname during install

parent b2f827b0
......@@ -174,6 +174,18 @@ 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');
unset($tmp_out);
//** Prevent empty hostname
$conf['hostname']=trim($conf['hostname']);
if($conf['hostname'] === '') {
$check = false;
do {
swriteln('Hostname may not be empty.');
$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', '', 'hostname');
$conf['hostname']=trim($conf['hostname']);
$check = @($conf['hostname'] !== '')?true:false;
} while (!$check);
}
// 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.');
......@@ -861,4 +873,4 @@ chmod($md5_filename,0700);
echo "Installation completed.\n";
?>
\ No newline at end of file
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment