From ba747c0be201755bed0e36e02edfb85d31f5214f Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Wed, 30 May 2007 10:11:32 -0400 Subject: [PATCH] Enhanced getmail support and the installer. --- install/lib/installer_base.lib.php | 26 +++++++++++++++++++++++++- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 9c89a7c..a4c5a2b 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -439,6 +439,16 @@ wf($configfile,$content); } + function configure_getmail() { + global $conf; + + $command = "useradd -b /etc/getmail -d /etc/getmail getmail"; + caselog($command." &> /dev/null", __FILE__, __LINE__,"EXECUTED: ".$command,"Failed to execute the command ".$command); + + $command = "chmod -R 700 /etc/getmail"; + caselog($command." &> /dev/null", __FILE__, __LINE__,"EXECUTED: ".$command,"Failed to execute the command ".$command); + } + function install_ispconfig() { global $conf; @@ -466,7 +476,7 @@ $command = "ln -s ".$conf["ispconfig_install_dir"]."/interface/web/ /var/www/ispconfig"; caselog($command." &> /dev/null", __FILE__, __LINE__,"EXECUTED: ".$command,"Failed to execute the command ".$command); - // Create the config file for ISPConfig + // Create the config file for ISPConfig interface $configfile = 'config.inc.php'; if(is_file($conf["ispconfig_install_dir"].'/interface/lib/'.$configfile)) copy($conf["ispconfig_install_dir"].'/interface/lib/'.$configfile,$conf["ispconfig_install_dir"].'/interface/lib/'.$configfile.'~'); $content = rf("tpl/".$configfile.".master"); @@ -475,6 +485,17 @@ $content = str_replace('{mysql_server_database}',$conf["mysql_server_database"],$content); $content = str_replace('{mysql_server_host}',$conf["mysql_server_host"],$content); wf($conf["ispconfig_install_dir"].'/interface/lib/'.$configfile,$content); + + // Create the config file for ISPConfig server + $configfile = 'config.inc.php'; + if(is_file($conf["ispconfig_install_dir"].'/server/lib/'.$configfile)) copy($conf["ispconfig_install_dir"].'/server/lib/'.$configfile,$conf["ispconfig_install_dir"].'/interface/lib/'.$configfile.'~'); + $content = rf("tpl/".$configfile.".master"); + $content = str_replace('{mysql_server_ispconfig_user}',$conf["mysql_server_ispconfig_user"],$content); + $content = str_replace('{mysql_server_ispconfig_password}',$conf["mysql_server_ispconfig_password"],$content); + $content = str_replace('{mysql_server_database}',$conf["mysql_server_database"],$content); + $content = str_replace('{mysql_server_host}',$conf["mysql_server_host"],$content); + wf($conf["ispconfig_install_dir"].'/server/lib/'.$configfile,$content); + // Chmod the files $command = "chmod -R 750 ".$conf["ispconfig_install_dir"]; @@ -491,6 +512,9 @@ $command = "adduser www-data ispconfig"; caselog($command." &> /dev/null", __FILE__, __LINE__,"EXECUTED: ".$command,"Failed to execute the command ".$command); + // Make the shell scripts executable + $command = "chmod +x ".$conf["ispconfig_install_dir"]."/server/scripts/*.sh"; + caselog($command." &> /dev/null", __FILE__, __LINE__,"EXECUTED: ".$command,"Failed to execute the command ".$command); } -- Gitblit v1.9.1