From 8b5ccd302bd1497de721a25e4ce086bebf95173f Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Sun, 08 Jun 2008 15:32:42 -0400
Subject: [PATCH] Fixed a problem with the logout when the php session has ended.

---
 install/install.php |   43 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/install/install.php b/install/install.php
index 7da7b01..3138ee5 100644
--- a/install/install.php
+++ b/install/install.php
@@ -59,6 +59,8 @@
 //** Get distribution identifier
 $distname = get_distname();
 
+if($distname == '') die('Linux Dustribution or Version not recognized.');
+
 //** Include the distribution specific installer class library and configuration
 include_once('dist/lib/'.$distname.'.lib.php');
 include_once('dist/conf/'.$distname.'.conf.php');
@@ -77,6 +79,10 @@
 //** Check log file is writable (probably not root or sudo)
 if(!is_writable(dirname(ISPC_LOG_FILE))){
     die("ERROR: Cannot write to the directory ".dirname(ISPC_LOG_FILE).". Are you root or sudo ?\n\n");
+}
+
+if(is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) {
+	die('This software can not be installed on a server wich runs ISPConfig 2.x.');
 }
 
 //** Select the language
@@ -122,9 +128,16 @@
 	
 	//* Create the mysql database
 	$inst->configure_database();
+	
+	//* Insert the Server record into the database
+	$inst->add_database_server_record();
 
 	//* Configure postfix
 	$inst->configure_postfix();
+	
+	//* Configure postfix
+	swriteln('Configuring Jailkit');
+	$inst->configure_jailkit();
 
 	//* Configure saslauthd
 	swriteln('Configuring SASL');
@@ -165,6 +178,10 @@
 
 	//* Configure ISPConfig
 	swriteln('Installing ISPConfig');
+	
+	//** Customise the port ISPConfig runs on
+	$inst->conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080');
+
 	$inst->install_ispconfig();
 
 	//* Configure ISPConfig
@@ -189,13 +206,18 @@
 }else{
 
 	//** Get Server ID
-	$conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1');
+	// $conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1');
+	// Server ID is an autoInc value of the mysql database now
 	
-	if(strtolower($inst->simple_query('Create Database',array('y','n'),'y')) == 'y') {
+	if(strtolower($inst->simple_query('Shall this server join a existing ISPConfig installation? If not, we will create a new database now',array('y','n'),'y')) == 'n') {
 		//* Create the mysql database
 		$inst->configure_database();
 		system('/etc/init.d/mysql restart');
 	}
+		
+	//* Insert the Server record into the database
+	$inst->add_database_server_record();
+
 	
 	if(strtolower($inst->simple_query('Configure Mail', array('y','n') ,'y') ) == 'y') {
 		
@@ -257,6 +279,23 @@
 	//** Configure ISPConfig :-)
 	if(strtolower($inst->simple_query('Install ISPConfig',array('y','n'),'y')) == 'y') {
 		swriteln('Installing ISPConfig');
+		
+		//** We want to check if the server is a module or cgi based php enabled server
+		//** TODO: Don't always ask for this somehow ? 
+		$fast_cgi = $inst->simple_query('CGI PHP Enabled Server?', array('yes','no'),'no');
+
+		if($fast_cgi == 'yes') {
+	 		$alias = $inst->free_query('Script Alias', '/php/');
+	 		$path = $inst->free_query('Script Alias Path', '/path/to/cgi/bin');
+	 		$inst->conf['apache']['vhost_cgi_alias'] = sprintf('ScriptAlias %s %s', $alias, $path);
+		} else {
+	 		$inst->conf['apache']['vhost_cgi_alias'] = "";
+		}
+
+		//** Customise the port ISPConfig runs on
+		$inst->conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080');
+		
+		
 		$inst->install_ispconfig();
 		
 		//* Configure ISPConfig

--
Gitblit v1.9.1