Florian Schaal
2014-09-22 752ab3dc79da6fa2dbfd7bfba3c48a6b60c82fa5
install/dist/lib/gentoo.lib.php
@@ -335,7 +335,7 @@
        // Append the configuration for amavisd to the master.cf file
      $content = rf($conf['postfix']['config_dir'].'/master.cf');
      // Only add the content if we had not addded it before
      if(!preg_match('/^amavis\s+/m', $content)) {
      if(!preg_match('/^amavis\s+unix\s+/m', $content)) {
         unset($content);
         $content = $this->get_template_file('master_cf_amavis', true);
         af($conf['postfix']['config_dir'].'/master.cf', $content);
@@ -519,6 +519,7 @@
      //* Copy the ISPConfig configuration include
      /*
      $content = $this->get_template_file('apache_ispconfig.conf', true);
      $records = $this->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ".$conf["server_id"]." AND virtualhost = 'y'");
@@ -531,6 +532,37 @@
      }
      $this->write_config_file($conf['apache']['vhost_conf_dir'].'/000-ispconfig.conf', $content);
      */
      $tpl = new tpl('apache_ispconfig.conf.master');
      $tpl->setVar('apache_version',getapacheversion());
      $records = $this->db->queryAllRecords('SELECT * FROM '.$conf['mysql']['master_database'].'.server_ip WHERE server_id = '.$conf['server_id']." AND virtualhost = 'y'");
      $ip_addresses = array();
      if(is_array($records) && count($records) > 0) {
         foreach($records as $rec) {
            if($rec['ip_type'] == 'IPv6') {
               $ip_address = '['.$rec['ip_address'].']';
            } else {
               $ip_address = $rec['ip_address'];
            }
            $ports = explode(',', $rec['virtualhost_port']);
            if(is_array($ports)) {
               foreach($ports as $port) {
                  $port = intval($port);
                  if($port > 0 && $port < 65536 && $ip_address != '') {
                     $ip_addresses[] = array('ip_address' => $ip_address, 'port' => $port);
                  }
               }
            }
         }
      }
      if(count($ip_addresses) > 0) $tpl->setLoop('ip_adresses',$ip_addresses);
      wf($conf['apache']['vhost_conf_dir'].'/000-ispconfig.conf', $tpl->grab());
      unset($tpl);
      //* Gentoo by default does not include .vhost files. Add include line to config file.
      $content = rf($conf['apache']['config_file']);
@@ -1014,19 +1046,19 @@
      }
      //* Install the update script
      if (is_file('/usr/local/bin/ispconfig_update_from_svn.sh')) {
         unlink('/usr/local/bin/ispconfig_update_from_svn.sh');
      if (is_file('/usr/local/bin/ispconfig_update_from_dev.sh')) {
         unlink('/usr/local/bin/ispconfig_update_from_dev.sh');
      }
      chown($install_dir.'/server/scripts/update_from_svn.sh', 'root');
      chmod($install_dir.'/server/scripts/update_from_svn.sh', 0700);
      chown($install_dir.'/server/scripts/update_from_dev.sh', 'root');
      chmod($install_dir.'/server/scripts/update_from_dev.sh', 0700);
      chown($install_dir.'/server/scripts/update_from_tgz.sh', 'root');
      chmod($install_dir.'/server/scripts/update_from_tgz.sh', 0700);
      chown($install_dir.'/server/scripts/ispconfig_update.sh', 'root');
      chmod($install_dir.'/server/scripts/ispconfig_update.sh', 0700);
      if (!is_link('/usr/local/bin/ispconfig_update_from_svn.sh')) {
         symlink($install_dir.'/server/scripts/ispconfig_update.sh', '/usr/local/bin/ispconfig_update_from_svn.sh');
      if (!is_link('/usr/local/bin/ispconfig_update_from_dev.sh')) {
         symlink($install_dir.'/server/scripts/ispconfig_update.sh', '/usr/local/bin/ispconfig_update_from_dev.sh');
      }
      if (!is_link('/usr/local/bin/ispconfig_update.sh')) {
@@ -1071,6 +1103,9 @@
      //* Remove Domain module as its functions are available in the client module now
      if(@is_dir('/usr/local/ispconfig/interface/web/domain')) exec('rm -rf /usr/local/ispconfig/interface/web/domain');
      // Add symlink for patch tool
      if(!is_link('/usr/local/bin/ispconfig_patch')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_patch /usr/local/bin/ispconfig_patch');
   }