Florian Schaal
2015-05-06 ee405d849b027618eec69425ed845afdc076b562
install/install.php
@@ -174,6 +174,18 @@
$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.');
@@ -454,6 +466,17 @@
   //** Customize the port ISPConfig runs on
   $ispconfig_vhost_port = $inst->free_query('ISPConfig Port', '8080','ispconfig_port');
   $conf['interface_password'] = $inst->free_query('Admin password', 'admin');
   if($conf['interface_password'] != 'admin') {
      $check = false;
      do {
         unset($temp_password);
         $temp_password = $inst->free_query('Re-enter admin password', '');
         $check = @($temp_password == $conf['interface_password'])?true:false;
         if(!$check) swriteln('Passwords do not match.');
      } while (!$check);
   }
   unset($check);
   unset($temp_password);
   if($conf['apache']['installed'] == true) $conf['apache']['vhost_port']  = $ispconfig_vhost_port;
   if($conf['nginx']['installed'] == true) $conf['nginx']['vhost_port']  = $ispconfig_vhost_port;
   unset($ispconfig_vhost_port);
@@ -794,6 +817,17 @@
      //** Customise the port ISPConfig runs on
      $ispconfig_vhost_port = $inst->free_query('ISPConfig Port', '8080','ispconfig_port');
      $conf['interface_password'] = $inst->free_query('Admin password', 'admin');
      if($conf['interface_password'] != 'admin') {
         $check = false;
         do {
            unset($temp_password);
            $temp_password = $inst->free_query('Re-enter admin password', '');
            $check = @($temp_password == $conf['interface_password'])?true:false;
            if(!$check) swriteln('Passwords do not match.');
         } while (!$check);
      }
      unset($check);
      unset($temp_password);
      if($conf['apache']['installed'] == true) $conf['apache']['vhost_port']  = $ispconfig_vhost_port;
      if($conf['nginx']['installed'] == true) $conf['nginx']['vhost_port']  = $ispconfig_vhost_port;
      unset($ispconfig_vhost_port);