tbrehm
2010-09-16 603bcbfdb00a6836598d25cbfa2873c67535826f
install/dist/lib/opensuse.lib.php
@@ -91,7 +91,9 @@
      } else {
         $command = 'useradd -g '.$cf['vmail_groupname'].' -u '.$cf['vmail_userid'].' '.$cf['vmail_username'].' -d '.$cf['vmail_mailbox_base'].' -m';
         caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
      }
      }
      if($cf['vmail_mailbox_base'] != '' && strlen($cf['vmail_mailbox_base']) >= 10) exec('chown -R '.$cf['vmail_username'].':'.$cf['vmail_groupname'].' '.$cf['vmail_mailbox_base']);
      $postconf_commands = array (
         'myhostname = '.$conf['hostname'],
@@ -269,6 +271,8 @@
      $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content);
      $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
      wf("$pam/smtp", $content);
      // On some OSes smtp is world readable which allows for reading database information.  Removing world readable rights should have no effect.
      if(is_file("$pam/smtp"))    exec("chmod o= $pam/smtp");
      //exec("chmod 660 $pam/smtp");
      //exec("chown root:root $pam/smtp");
   
@@ -379,7 +383,7 @@
      
      // amavisd user config file
      $configfile = 'opensuse_amavisd_conf';
      if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) @copy($conf["amavis"]["config_dir"].'/amavisd.conf',$conf["courier"]["config_dir"].'/amavisd.conf~');
      if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) @copy($conf["amavis"]["config_dir"].'/amavisd.conf',$conf["amavis"]["config_dir"].'/amavisd.conf~');
      if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf~')) exec('chmod 400 '.$conf["amavis"]["config_dir"].'/amavisd.conf~');
      $content = rf("tpl/".$configfile.".master");
      $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content);
@@ -514,7 +518,8 @@
      exec('mkdir -p /var/log/ispconfig/httpd');
      
      //if(is_file('/etc/suphp.conf')) {
      replaceLine('/etc/suphp.conf','php=php','x-httpd-suphp=php:/srv/www/cgi-bin/php5',0,0);
      replaceLine('/etc/suphp.conf','php=php','x-httpd-suphp="php:/srv/www/cgi-bin/php5"',0,0);
      replaceLine('/etc/suphp.conf','php="php','x-httpd-suphp="php:/srv/www/cgi-bin/php5"',0,0);
      replaceLine('/etc/suphp.conf','docroot=','docroot=/srv/www',0,0);
      replaceLine('/etc/suphp.conf','umask=0077','umask=0022',0);
      //}
@@ -628,8 +633,7 @@
        unset($iptables_location);
   }
   public function install_ispconfig()
    {
      global $conf;
@@ -833,6 +837,12 @@
         $content = str_replace('{vhost_port_listen}', '', $content);
      }
      
      if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) {
         $content = str_replace('{ssl_comment}', '', $content);
      } else {
         $content = str_replace('{ssl_comment}', '#', $content);
      }
      $content = str_replace('/var/www/', '/srv/www/', $content);
      
      wf("$vhost_conf_dir/ispconfig.vhost", $content);