redray
2008-11-12 ef49b7e5ae53355012e8e570132d0514a61a6a81
changed var-names for ownerrordocs option
added www.-Subdomain option
6 files modified
61 ■■■■■ changed files
install/sql/ispconfig3.sql 3 ●●●● patch | view | raw | blame | history
interface/web/sites/form/web_domain.tform.php 14 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_domain.lng 3 ●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_domain_edit.htm 8 ●●●● patch | view | raw | blame | history
server/conf/vhost.conf.master 12 ●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php 21 ●●●●● patch | view | raw | blame | history
install/sql/ispconfig3.sql
@@ -1000,7 +1000,8 @@
  `cgi` char(1) NOT NULL default 'y',
  `ssi` char(1) NOT NULL default 'y',
  `suexec` char(1) NOT NULL default 'y',
  `errordocs` char(1) NOT NULL default 'y',
  `is_errordocs` tinyint(1) NOT NULL default '1',
  `is_subdomainwww` tinyint(1) NOT NULL default '1',
  `php` varchar(255) NOT NULL default 'y',
  `redirect_type` varchar(255) default NULL,
  `redirect_path` varchar(255) default NULL,
interface/web/sites/form/web_domain.tform.php
@@ -168,11 +168,17 @@
            'default'    => 'n',
            'value'        => array(0 => 'n',1 => 'y')
        ),
        'errordocs' => array (
            'datatype'    => 'VARCHAR',
        'is_errordocs' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'CHECKBOX',
            'default'    => 'y',
            'value'        => array(0 => 'n',1 => 'y')
            'default'    => '1',
            'value'        => array(0 => '0',1 => '1')
        ),
        'is_subdomainwww' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'CHECKBOX',
            'default'    => '1',
            'value'        => array(0 => '0',1 => '1')
        ),
        'ssl' => array (
            'datatype'    => 'VARCHAR',
interface/web/sites/lib/lang/en_web_domain.lng
@@ -26,7 +26,8 @@
$wb["traffic_quota_txt"] = 'Traffic Quota';
$wb["cgi_txt"] = 'CGI';
$wb["ssi_txt"] = 'SSI';
$wb["errordocs_txt"] = 'Own Error-Documents';
$wb["is_errordocs_txt"] = 'Own Error-Documents';
$wb["is_subdomainwww_txt"] = 'www. Subdomain';
$wb["ssl_txt"] = 'SSL';
$wb["suexec_txt"] = 'SuEXEC';
$wb["php_txt"] = 'PHP';
interface/web/sites/templates/web_domain_edit.htm
@@ -63,8 +63,12 @@
        <span class="">{tmpl_var name='suexec'}</span>
      </span>
      <span class="wf_oneField">
        <label for="errordocs" class="wf_preField">{tmpl_var name='errordocs_txt'}</label>
        <span class="">{tmpl_var name='errordocs'}</span>
        <label for="is_errordocs" class="wf_preField">{tmpl_var name='is_errordocs_txt'}</label>
        <span class="">{tmpl_var name='is_errordocs'}</span>
      </span>
      <span class="wf_oneField">
        <label for="is_subdomainwww" class="wf_preField">{tmpl_var name='is_subdomainwww_txt'}</label>
        <span class="">{tmpl_var name='is_subdomainwww'}</span>
      </span>
      <span class="wf_oneField">
        <label for="ssl" class="wf_preField">{tmpl_var name='ssl_txt'}</label>                    
server/conf/vhost.conf.master
@@ -13,7 +13,7 @@
  ServerAdmin webmaster@<tmpl_var name='domain'>
  ErrorLog <tmpl_var name='document_root'>/log/error.log
<tmpl_if name='errordocs' op='==' value='y'>
<tmpl_if name='is_errordocs'>
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
@@ -87,9 +87,9 @@
<tmpl_if name='php' op='!=' value=''>
  php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"    
  php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
  php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
  #php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
  #php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
  #php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
</tmpl_if>
<tmpl_var name='apache_directives'>
</VirtualHost>
@@ -112,7 +112,7 @@
  
  ErrorLog <tmpl_var name='document_root'>/log/error.log
<tmpl_if name='errordocs' op='==' value='y'>
<tmpl_if name='is_errordocs'>
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
@@ -172,9 +172,9 @@
<tmpl_if name='php' op='!=' value=''>
  php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"    
  php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
  php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
  #php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
  #php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
  #php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
</tmpl_if>
<tmpl_var name='apache_directives'>
server/plugins-available/apache2_plugin.inc.php
@@ -212,10 +212,11 @@
        
        // Check if the directories are there and create them if nescessary.
        if(!is_dir($data["new"]["document_root"]."/web")) exec("mkdir -p ".$data["new"]["document_root"]."/web");
        if(!is_dir($data["new"]["document_root"]."/web/error")) exec("mkdir -p ".$data["new"]["document_root"]."/web/error");
        if(!is_dir($data["new"]["document_root"]."/web/error") and $data["new"]["is_errordocs"]) exec("mkdir -p ".$data["new"]["document_root"]."/web/error");
        //if(!is_dir($data["new"]["document_root"]."/log")) exec("mkdir -p ".$data["new"]["document_root"]."/log");
        if(!is_dir($data["new"]["document_root"]."/ssl")) exec("mkdir -p ".$data["new"]["document_root"]."/ssl");
        if(!is_dir($data["new"]["document_root"]."/cgi-bin")) exec("mkdir -p ".$data["new"]["document_root"]."/cgi-bin");
        if(!is_dir($data["new"]["document_root"]."/tmp")) exec("mkdir -p ".$data["new"]["document_root"]."/tmp");
        
        // Remove the symlink for the site, if site is renamed
        if($this->action == 'update' && $data["old"]["domain"] != '' && $data["new"]["domain"] != $data["old"]["domain"]) {
@@ -287,10 +288,12 @@
        
        if($this->action == 'insert' && $data["new"]["type"] == 'vhost') {
            // Copy the error pages
            $error_page_path = escapeshellcmd($data["new"]["document_root"])."/web/error/";
            exec("cp /usr/local/ispconfig/server/conf/error/".substr(escapeshellcmd($conf["language"]),0,2)."/* ".$error_page_path);
            exec("chmod -R +r ".$error_page_path);
      if($data["new"]["is_errordocs"]){
              $error_page_path = escapeshellcmd($data["new"]["document_root"])."/web/error/";
              exec("cp /usr/local/ispconfig/server/conf/error/".substr(escapeshellcmd($conf["language"]),0,2)."/* ".$error_page_path);
              exec("chmod -R +r ".$error_page_path);
      }
            // copy the standard index page
            exec("cp /usr/local/ispconfig/server/conf/index/standard_index.html_".substr(escapeshellcmd($conf["language"]),0,2)." ".escapeshellcmd($data["new"]["document_root"])."/web/index.html");
            exec("chmod +r ".escapeshellcmd($data["new"]["document_root"])."/web/index.html");
@@ -369,10 +372,14 @@
        
        // get alias domains (co-domains and subdomains)
        $aliases = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE parent_domain_id = ".$data["new"]["domain_id"]." AND active = 'y'");
        $server_alias = '';
    if($data["new"]["is_subdomainwww"]){
        $server_alias .= 'www.'.$data["new"]["domain"].' ';
    } else {
          $server_alias = '';
    }
        if(is_array($aliases)) {
            foreach($aliases as $alias) {
                $server_alias .= $alias["domain"].' ';
              $server_alias .= $alias["domain"].' ';
                $app->log("Add server alias: $alias[domain]",LOGLEVEL_DEBUG);
                // Rewriting
                if($alias["redirect_type"] != '') {