Till Brehm
2014-02-17 baa7f2736bc91ca3feaed685e8a67a46db4fbb98
install/lib/installer_base.lib.php
@@ -474,7 +474,15 @@
               $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
            }
            $query = "GRANT SELECT, UPDATE ON ".$value['db'].".`aps_instances` TO '".$value['user']."'@'".$host."' ";
            $query = "GRANT SELECT, UPDATE, DELETE ON ".$value['db'].".`aps_instances` TO '".$value['user']."'@'".$host."' ";
            if ($verbose){
               echo $query ."\n";
            }
            if(!$this->dbmaster->query($query)) {
               $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
            }
            $query = "GRANT SELECT, DELETE ON ".$value['db'].".`aps_instances_settings` TO '".$value['user']."'@'".$host."' ";
            if ($verbose){
               echo $query ."\n";
            }
@@ -963,6 +971,7 @@
         } else {
            copy('tpl/debian_dovecot2.conf.master', $config_dir.'/'.$configfile);
         }
         replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);
      } else {
         if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot.conf.master')) {
            copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_dovecot.conf.master', $config_dir.'/'.$configfile);
@@ -987,6 +996,9 @@
      chmod($config_dir.'/'.$configfile, 0600);
      chown($config_dir.'/'.$configfile, 'root');
      chgrp($config_dir.'/'.$configfile, 'root');
      // Dovecot shall ignore mounts in website directory
      exec("doveadm mount add '/var/www/*' ignore");
   }
@@ -1225,6 +1237,15 @@
         replaceLine('/etc/apache2/ports.conf', 'Listen 443', 'Listen 443', 1);
      }
      if(is_file('/etc/apache2/apache.conf')) {
         if(hasLine('/etc/apache2/apache.conf', 'Include sites-enabled/', 1) == false) {
            if(hasLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.conf', 1) == false) {
               replaceLine('/etc/apache2/apache.conf', 'Include sites-enabled/', 'Include sites-enabled/', 1, 1);
            } elseif(hasLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.vhost', 1) == false) {
               replaceLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.vhost', 'IncludeOptional sites-enabled/*.vhost', 1, 1);
            }
         }
      }
      //* Copy the ISPConfig configuration include
      $vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
@@ -1486,7 +1507,8 @@
         if(!is_user($apps_vhost_user)) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
         $command = 'adduser '.$conf['apache']['user'].' '.$apps_vhost_group;
         //$command = 'adduser '.$conf['apache']['user'].' '.$apps_vhost_group;
         $command = 'usermod -a -G '.$apps_vhost_group.' '.$conf['apache']['user'];
         caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
         if(!@is_dir($install_dir)){
@@ -1501,6 +1523,11 @@
         $vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
         $vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir'];
         $apps_vhost_servername = ($conf['web']['apps_vhost_servername'] == '')?'':'ServerName '.$conf['web']['apps_vhost_servername'];
         //* Get the apps vhost port
         if($this->is_update == true) {
            $conf['web']['apps_vhost_port'] = get_apps_vhost_port_number();
         }
         // Dont just copy over the virtualhost template but add some custom settings
         $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/apache_apps.vhost.master', 'tpl/apache_apps.vhost.master');
@@ -1994,14 +2021,14 @@
      }
      //* Install the update script
      if(is_file('/usr/local/bin/ispconfig_update_from_svn.sh')) unlink('/usr/local/bin/ispconfig_update_from_svn.sh');
      chown($install_dir.'/server/scripts/update_from_svn.sh', 'root');
      chmod($install_dir.'/server/scripts/update_from_svn.sh', 0700);
      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_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')) symlink($install_dir.'/server/scripts/ispconfig_update.sh', '/usr/local/bin/ispconfig_update.sh');
      //* Make the logs readable for the ispconfig user