Skip to content

Commit 88a927c

Browse files
author
redray
committed
added auto-wildcard and auto-www support for domains and aliasdomains
1 parent 0c702ba commit 88a927c

File tree

7 files changed

+1241
-1213
lines changed

7 files changed

+1241
-1213
lines changed

install/sql/ispconfig3.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,7 @@ CREATE TABLE `web_domain` (
11351135
`suexec` char(1) NOT NULL default 'y',
11361136
`errordocs` tinyint(1) NOT NULL default '1',
11371137
`is_subdomainwww` tinyint(1) NOT NULL default '1',
1138+
`subdomain` enum('none','www','*') NOT NULL default 'www',
11381139
`php` varchar(255) NOT NULL default 'y',
11391140
`redirect_type` varchar(255) default NULL,
11401141
`redirect_path` varchar(255) default NULL,
Lines changed: 137 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,138 @@
1-
<?php
2-
3-
/*
4-
Form Definition
5-
6-
Tabledefinition
7-
8-
Datatypes:
9-
- INTEGER (Forces the input to Int)
10-
- DOUBLE
11-
- CURRENCY (Formats the values to currency notation)
12-
- VARCHAR (no format check, maxlength: 255)
13-
- TEXT (no format check)
14-
- DATE (Dateformat, automatic conversion to timestamps)
15-
16-
Formtype:
17-
- TEXT (Textfield)
18-
- TEXTAREA (Textarea)
19-
- PASSWORD (Password textfield, input is not shown when edited)
20-
- SELECT (Select option field)
21-
- RADIO
22-
- CHECKBOX
23-
- CHECKBOXARRAY
24-
- FILE
25-
26-
VALUE:
27-
- Wert oder Array
28-
29-
Hint:
30-
The ID field of the database table is not part of the datafield definition.
31-
The ID field must be always auto incement (int or bigint).
32-
33-
34-
*/
35-
36-
$form["title"] = "Web Aliasdomain";
37-
$form["description"] = "";
38-
$form["name"] = "web_domain";
39-
$form["action"] = "web_aliasdomain_edit.php";
40-
$form["db_table"] = "web_domain";
41-
$form["db_table_idx"] = "domain_id";
42-
$form["db_history"] = "yes";
43-
$form["tab_default"] = "domain";
44-
$form["list_default"] = "web_aliasdomain_list.php";
45-
$form["auth"] = 'yes'; // yes / no
46-
47-
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
48-
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
49-
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
50-
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
51-
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
52-
53-
$form["tabs"]['domain'] = array (
54-
'title' => "Domain",
55-
'width' => 100,
56-
'template' => "templates/web_aliasdomain_edit.htm",
57-
'fields' => array (
58-
##################################
59-
# Begin Datatable fields
60-
##################################
61-
'server_id' => array (
62-
'datatype' => 'INTEGER',
63-
'formtype' => 'SELECT',
64-
'default' => '',
65-
'datasource' => array ( 'type' => 'SQL',
66-
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
67-
'keyfield'=> 'server_id',
68-
'valuefield'=> 'server_name'
69-
),
70-
'value' => ''
71-
),
72-
'domain' => array (
73-
'datatype' => 'VARCHAR',
74-
'formtype' => 'TEXT',
75-
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
76-
'errmsg'=> 'domain_error_empty'),
77-
1 => array ( 'type' => 'UNIQUE',
78-
'errmsg'=> 'domain_error_unique'),
79-
2 => array ( 'type' => 'REGEX',
80-
'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
81-
'errmsg'=> 'domain_error_regex'),
82-
),
83-
'default' => '',
84-
'value' => '',
85-
'width' => '30',
86-
'maxlength' => '255'
87-
),
88-
'type' => array (
89-
'datatype' => 'VARCHAR',
90-
'formtype' => 'SELECT',
91-
'default' => 'y',
92-
'value' => array('vhost' => 'Site', 'alias' => 'Alias', 'subdomain' => 'Subdomain')
93-
),
94-
'parent_domain_id' => array (
95-
'datatype' => 'INTEGER',
96-
'formtype' => 'SELECT',
97-
'default' => '',
98-
'datasource' => array ( 'type' => 'SQL',
99-
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
100-
'keyfield'=> 'domain_id',
101-
'valuefield'=> 'domain'
102-
),
103-
'value' => ''
104-
),
105-
'redirect_type' => array (
106-
'datatype' => 'VARCHAR',
107-
'formtype' => 'SELECT',
108-
'default' => 'y',
109-
'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
110-
),
111-
'redirect_path' => array (
112-
'datatype' => 'VARCHAR',
113-
'formtype' => 'TEXT',
114-
'default' => '',
115-
'value' => '',
116-
'width' => '30',
117-
'maxlength' => '255'
118-
),
119-
'active' => array (
120-
'datatype' => 'VARCHAR',
121-
'formtype' => 'CHECKBOX',
122-
'default' => 'y',
123-
'value' => array(0 => 'n',1 => 'y')
124-
),
125-
##################################
126-
# ENDE Datatable fields
127-
##################################
128-
)
129-
);
130-
131-
1+
<?php
2+
3+
/*
4+
Form Definition
5+
6+
Tabledefinition
7+
8+
Datatypes:
9+
- INTEGER (Forces the input to Int)
10+
- DOUBLE
11+
- CURRENCY (Formats the values to currency notation)
12+
- VARCHAR (no format check, maxlength: 255)
13+
- TEXT (no format check)
14+
- DATE (Dateformat, automatic conversion to timestamps)
15+
16+
Formtype:
17+
- TEXT (Textfield)
18+
- TEXTAREA (Textarea)
19+
- PASSWORD (Password textfield, input is not shown when edited)
20+
- SELECT (Select option field)
21+
- RADIO
22+
- CHECKBOX
23+
- CHECKBOXARRAY
24+
- FILE
25+
26+
VALUE:
27+
- Wert oder Array
28+
29+
Hint:
30+
The ID field of the database table is not part of the datafield definition.
31+
The ID field must be always auto incement (int or bigint).
32+
33+
34+
*/
35+
36+
$form["title"] = "Web Aliasdomain";
37+
$form["description"] = "";
38+
$form["name"] = "web_domain";
39+
$form["action"] = "web_aliasdomain_edit.php";
40+
$form["db_table"] = "web_domain";
41+
$form["db_table_idx"] = "domain_id";
42+
$form["db_history"] = "yes";
43+
$form["tab_default"] = "domain";
44+
$form["list_default"] = "web_aliasdomain_list.php";
45+
$form["auth"] = 'yes'; // yes / no
46+
47+
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
48+
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
49+
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
50+
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
51+
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
52+
53+
$form["tabs"]['domain'] = array (
54+
'title' => "Domain",
55+
'width' => 100,
56+
'template' => "templates/web_aliasdomain_edit.htm",
57+
'fields' => array (
58+
##################################
59+
# Begin Datatable fields
60+
##################################
61+
'server_id' => array (
62+
'datatype' => 'INTEGER',
63+
'formtype' => 'SELECT',
64+
'default' => '',
65+
'datasource' => array ( 'type' => 'SQL',
66+
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
67+
'keyfield'=> 'server_id',
68+
'valuefield'=> 'server_name'
69+
),
70+
'value' => ''
71+
),
72+
'domain' => array (
73+
'datatype' => 'VARCHAR',
74+
'formtype' => 'TEXT',
75+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
76+
'errmsg'=> 'domain_error_empty'),
77+
1 => array ( 'type' => 'UNIQUE',
78+
'errmsg'=> 'domain_error_unique'),
79+
2 => array ( 'type' => 'REGEX',
80+
'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
81+
'errmsg'=> 'domain_error_regex'),
82+
),
83+
'default' => '',
84+
'value' => '',
85+
'width' => '30',
86+
'maxlength' => '255'
87+
),
88+
'type' => array (
89+
'datatype' => 'VARCHAR',
90+
'formtype' => 'SELECT',
91+
'default' => 'y',
92+
'value' => array('vhost' => 'Site', 'alias' => 'Alias', 'subdomain' => 'Subdomain')
93+
),
94+
'parent_domain_id' => array (
95+
'datatype' => 'INTEGER',
96+
'formtype' => 'SELECT',
97+
'default' => '',
98+
'datasource' => array ( 'type' => 'SQL',
99+
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
100+
'keyfield'=> 'domain_id',
101+
'valuefield'=> 'domain'
102+
),
103+
'value' => ''
104+
),
105+
'redirect_type' => array (
106+
'datatype' => 'VARCHAR',
107+
'formtype' => 'SELECT',
108+
'default' => 'y',
109+
'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
110+
),
111+
'redirect_path' => array (
112+
'datatype' => 'VARCHAR',
113+
'formtype' => 'TEXT',
114+
'default' => '',
115+
'value' => '',
116+
'width' => '30',
117+
'maxlength' => '255'
118+
),
119+
'subdomain' => array (
120+
'datatype' => 'VARCHAR',
121+
'formtype' => 'SELECT',
122+
'default' => 'y',
123+
'value' => array('none' => 'none', 'www' => 'www.', '*' => '*.')
124+
),
125+
'active' => array (
126+
'datatype' => 'VARCHAR',
127+
'formtype' => 'CHECKBOX',
128+
'default' => 'y',
129+
'value' => array(0 => 'n',1 => 'y')
130+
),
131+
##################################
132+
# ENDE Datatable fields
133+
##################################
134+
)
135+
);
136+
137+
132138
?>

0 commit comments

Comments
 (0)