From ac4a37d4f813f5965a576975bca14e81349def13 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Sun, 29 Jun 2008 11:10:43 +0000
Subject: [PATCH] - Fixes in the installer.

---
 install/install.php                | 24 +++++++++++++++---------
 install/lib/installer_base.lib.php | 15 ++++++++++++---
 2 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/install/install.php b/install/install.php
index 2c000e6ab4..680a1b4d03 100644
--- a/install/install.php
+++ b/install/install.php
@@ -278,7 +278,7 @@ if($install_mode == 'Standard') {
 	}
 	
 	//** Configure ISPConfig :-)
-	if(strtolower($inst->simple_query('Install ISPConfig',array('y','n'),'y')) == 'y') {
+	if(strtolower($inst->simple_query('Install ISPConfig Web-Interface',array('y','n'),'y')) == 'y') {
 		swriteln('Installing ISPConfig');
 		
 		//** We want to check if the server is a module or cgi based php enabled server
@@ -296,17 +296,23 @@ if($install_mode == 'Standard') {
 		*/
 
 		//** Customise the port ISPConfig runs on
-		$inst->conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080');
+		$conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080');
 		
-		
-		$inst->install_ispconfig();
-		
-		//* Configure ISPConfig
-		swriteln('Installing Crontab');
-		$inst->install_crontab();
-		system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart');	
+		$inst->install_ispconfig_interface = true;
+			
+	} else {
+		$inst->install_ispconfig_interface = false;
 	}
 	
+	$inst->install_ispconfig();
+		
+	//* Configure ISPConfig
+	swriteln('Installing Crontab');
+	$inst->install_crontab();
+	system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart');
+	
+	
+	
 } //* << $install_mode / 'Standard' or Genius
 
 
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 279e444e6e..3c718a91b8 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -34,6 +34,7 @@ class installer_base {
 	var $language = 'en';
 	var $db;
 	public $conf;
+	public install_ispconfig_interface = true;
 
 
     public function __construct()
@@ -148,9 +149,15 @@ class installer_base {
 		global $conf;
 		$cf = $conf['mysql']; // make $conf['mysql'] more accessible
 		
+		if($cf['host'] == 'localhost') {
+			$from_host = 'localhost';
+		} else {
+			$from_host = $inst->conf['hostname'];
+		}
+		
 		//* Create the ISPConfig database user
         $query = 'GRANT SELECT, INSERT, UPDATE, DELETE ON '.$cf['database'].".* "
-                ."TO '".$cf['ispconfig_user']."'@'".$cf['host']."' "
+                ."TO '".$cf['ispconfig_user']."'@'".$from_host."' "
                 ."IDENTIFIED BY '".$cf['ispconfig_password']."';";
 		if(!$this->db->query($query)) {
 			$this->error('Unable to create database user: '.$cf['ispconfig_user']);
@@ -729,8 +736,10 @@ class installer_base {
 		
 		//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");
 		//* and create the symlink
-		if(!is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) {
-			exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/ispconfig.vhost");
+		if($this->install_ispconfig_interface == true) {
+			if(!is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) {
+				exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/ispconfig.vhost");
+			}
 		}
 		
 		// Make the Clamav log files readable by ISPConfig
-- 
GitLab