Skip to content

Commit ef49b7e

Browse files
author
redray
committed
changed var-names for ownerrordocs option
added www.-Subdomain option
1 parent 2fe2c7a commit ef49b7e

File tree

6 files changed

+40
-21
lines changed

6 files changed

+40
-21
lines changed

install/sql/ispconfig3.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,8 @@ CREATE TABLE `web_domain` (
10001000
`cgi` char(1) NOT NULL default 'y',
10011001
`ssi` char(1) NOT NULL default 'y',
10021002
`suexec` char(1) NOT NULL default 'y',
1003-
`errordocs` char(1) NOT NULL default 'y',
1003+
`is_errordocs` tinyint(1) NOT NULL default '1',
1004+
`is_subdomainwww` tinyint(1) NOT NULL default '1',
10041005
`php` varchar(255) NOT NULL default 'y',
10051006
`redirect_type` varchar(255) default NULL,
10061007
`redirect_path` varchar(255) default NULL,

interface/web/sites/form/web_domain.tform.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,17 @@
168168
'default' => 'n',
169169
'value' => array(0 => 'n',1 => 'y')
170170
),
171-
'errordocs' => array (
172-
'datatype' => 'VARCHAR',
171+
'is_errordocs' => array (
172+
'datatype' => 'INTEGER',
173173
'formtype' => 'CHECKBOX',
174-
'default' => 'y',
175-
'value' => array(0 => 'n',1 => 'y')
174+
'default' => '1',
175+
'value' => array(0 => '0',1 => '1')
176+
),
177+
'is_subdomainwww' => array (
178+
'datatype' => 'INTEGER',
179+
'formtype' => 'CHECKBOX',
180+
'default' => '1',
181+
'value' => array(0 => '0',1 => '1')
176182
),
177183
'ssl' => array (
178184
'datatype' => 'VARCHAR',

interface/web/sites/lib/lang/en_web_domain.lng

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ $wb["hd_quota_txt"] = 'Harddisk Quota';
2626
$wb["traffic_quota_txt"] = 'Traffic Quota';
2727
$wb["cgi_txt"] = 'CGI';
2828
$wb["ssi_txt"] = 'SSI';
29-
$wb["errordocs_txt"] = 'Own Error-Documents';
29+
$wb["is_errordocs_txt"] = 'Own Error-Documents';
30+
$wb["is_subdomainwww_txt"] = 'www. Subdomain';
3031
$wb["ssl_txt"] = 'SSL';
3132
$wb["suexec_txt"] = 'SuEXEC';
3233
$wb["php_txt"] = 'PHP';

interface/web/sites/templates/web_domain_edit.htm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ <h2><tmpl_var name="list_head_txt"></h2>
6363
<span class="">{tmpl_var name='suexec'}</span>
6464
</span>
6565
<span class="wf_oneField">
66-
<label for="errordocs" class="wf_preField">{tmpl_var name='errordocs_txt'}</label>
67-
<span class="">{tmpl_var name='errordocs'}</span>
66+
<label for="is_errordocs" class="wf_preField">{tmpl_var name='is_errordocs_txt'}</label>
67+
<span class="">{tmpl_var name='is_errordocs'}</span>
68+
</span>
69+
<span class="wf_oneField">
70+
<label for="is_subdomainwww" class="wf_preField">{tmpl_var name='is_subdomainwww_txt'}</label>
71+
<span class="">{tmpl_var name='is_subdomainwww'}</span>
6872
</span>
6973
<span class="wf_oneField">
7074
<label for="ssl" class="wf_preField">{tmpl_var name='ssl_txt'}</label>

server/conf/vhost.conf.master

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
ServerAdmin webmaster@<tmpl_var name='domain'>
1414

1515
ErrorLog <tmpl_var name='document_root'>/log/error.log
16-
<tmpl_if name='errordocs' op='==' value='y'>
16+
<tmpl_if name='is_errordocs'>
1717

1818
ErrorDocument 400 /error/invalidSyntax.html
1919
ErrorDocument 401 /error/authorizationRequired.html
@@ -87,9 +87,9 @@
8787
<tmpl_if name='php' op='!=' value=''>
8888

8989
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"
90+
php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
91+
php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
9092
#php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
91-
#php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
92-
#php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
9393
</tmpl_if>
9494
<tmpl_var name='apache_directives'>
9595
</VirtualHost>
@@ -112,7 +112,7 @@
112112

113113
ErrorLog <tmpl_var name='document_root'>/log/error.log
114114

115-
<tmpl_if name='errordocs' op='==' value='y'>
115+
<tmpl_if name='is_errordocs'>
116116
ErrorDocument 400 /error/invalidSyntax.html
117117
ErrorDocument 401 /error/authorizationRequired.html
118118
ErrorDocument 403 /error/forbidden.html
@@ -172,9 +172,9 @@
172172
<tmpl_if name='php' op='!=' value=''>
173173

174174
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"
175+
php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
176+
php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
175177
#php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
176-
#php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
177-
#php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
178178
</tmpl_if>
179179

180180
<tmpl_var name='apache_directives'>

server/plugins-available/apache2_plugin.inc.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,11 @@ function update($event_name,$data) {
212212

213213
// Check if the directories are there and create them if nescessary.
214214
if(!is_dir($data["new"]["document_root"]."/web")) exec("mkdir -p ".$data["new"]["document_root"]."/web");
215-
if(!is_dir($data["new"]["document_root"]."/web/error")) exec("mkdir -p ".$data["new"]["document_root"]."/web/error");
215+
if(!is_dir($data["new"]["document_root"]."/web/error") and $data["new"]["is_errordocs"]) exec("mkdir -p ".$data["new"]["document_root"]."/web/error");
216216
//if(!is_dir($data["new"]["document_root"]."/log")) exec("mkdir -p ".$data["new"]["document_root"]."/log");
217217
if(!is_dir($data["new"]["document_root"]."/ssl")) exec("mkdir -p ".$data["new"]["document_root"]."/ssl");
218218
if(!is_dir($data["new"]["document_root"]."/cgi-bin")) exec("mkdir -p ".$data["new"]["document_root"]."/cgi-bin");
219+
if(!is_dir($data["new"]["document_root"]."/tmp")) exec("mkdir -p ".$data["new"]["document_root"]."/tmp");
219220

220221
// Remove the symlink for the site, if site is renamed
221222
if($this->action == 'update' && $data["old"]["domain"] != '' && $data["new"]["domain"] != $data["old"]["domain"]) {
@@ -287,10 +288,12 @@ function update($event_name,$data) {
287288

288289
if($this->action == 'insert' && $data["new"]["type"] == 'vhost') {
289290
// Copy the error pages
290-
$error_page_path = escapeshellcmd($data["new"]["document_root"])."/web/error/";
291-
exec("cp /usr/local/ispconfig/server/conf/error/".substr(escapeshellcmd($conf["language"]),0,2)."/* ".$error_page_path);
292-
exec("chmod -R +r ".$error_page_path);
293-
291+
if($data["new"]["is_errordocs"]){
292+
$error_page_path = escapeshellcmd($data["new"]["document_root"])."/web/error/";
293+
exec("cp /usr/local/ispconfig/server/conf/error/".substr(escapeshellcmd($conf["language"]),0,2)."/* ".$error_page_path);
294+
exec("chmod -R +r ".$error_page_path);
295+
}
296+
294297
// copy the standard index page
295298
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");
296299
exec("chmod +r ".escapeshellcmd($data["new"]["document_root"])."/web/index.html");
@@ -369,10 +372,14 @@ function update($event_name,$data) {
369372

370373
// get alias domains (co-domains and subdomains)
371374
$aliases = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE parent_domain_id = ".$data["new"]["domain_id"]." AND active = 'y'");
372-
$server_alias = '';
375+
if($data["new"]["is_subdomainwww"]){
376+
$server_alias .= 'www.'.$data["new"]["domain"].' ';
377+
} else {
378+
$server_alias = '';
379+
}
373380
if(is_array($aliases)) {
374381
foreach($aliases as $alias) {
375-
$server_alias .= $alias["domain"].' ';
382+
$server_alias .= $alias["domain"].' ';
376383
$app->log("Add server alias: $alias[domain]",LOGLEVEL_DEBUG);
377384
// Rewriting
378385
if($alias["redirect_type"] != '') {

0 commit comments

Comments
 (0)