Commit 88a927c0 authored by redray's avatar redray

added auto-wildcard and auto-www support for domains and aliasdomains

parent 0c702ba4
......@@ -1135,6 +1135,7 @@ CREATE TABLE `web_domain` (
`suexec` char(1) NOT NULL default 'y',
`errordocs` tinyint(1) NOT NULL default '1',
`is_subdomainwww` tinyint(1) NOT NULL default '1',
`subdomain` enum('none','www','*') NOT NULL default 'www',
`php` varchar(255) NOT NULL default 'y',
`redirect_type` varchar(255) default NULL,
`redirect_path` varchar(255) default NULL,
......
<?php
/*
Form Definition
Tabledefinition
Datatypes:
- INTEGER (Forces the input to Int)
- DOUBLE
- CURRENCY (Formats the values to currency notation)
- VARCHAR (no format check, maxlength: 255)
- TEXT (no format check)
- DATE (Dateformat, automatic conversion to timestamps)
Formtype:
- TEXT (Textfield)
- TEXTAREA (Textarea)
- PASSWORD (Password textfield, input is not shown when edited)
- SELECT (Select option field)
- RADIO
- CHECKBOX
- CHECKBOXARRAY
- FILE
VALUE:
- Wert oder Array
Hint:
The ID field of the database table is not part of the datafield definition.
The ID field must be always auto incement (int or bigint).
*/
$form["title"] = "Web Aliasdomain";
$form["description"] = "";
$form["name"] = "web_domain";
$form["action"] = "web_aliasdomain_edit.php";
$form["db_table"] = "web_domain";
$form["db_table_idx"] = "domain_id";
$form["db_history"] = "yes";
$form["tab_default"] = "domain";
$form["list_default"] = "web_aliasdomain_list.php";
$form["auth"] = 'yes'; // yes / no
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['domain'] = array (
'title' => "Domain",
'width' => 100,
'template' => "templates/web_aliasdomain_edit.htm",
'fields' => array (
##################################
# Begin Datatable fields
##################################
'server_id' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
'keyfield'=> 'server_id',
'valuefield'=> 'server_name'
),
'value' => ''
),
'domain' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'domain_error_empty'),
1 => array ( 'type' => 'UNIQUE',
'errmsg'=> 'domain_error_unique'),
2 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
'errmsg'=> 'domain_error_regex'),
),
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => 'y',
'value' => array('vhost' => 'Site', 'alias' => 'Alias', 'subdomain' => 'Subdomain')
),
'parent_domain_id' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
),
'value' => ''
),
'redirect_type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => 'y',
'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
),
'redirect_path' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'active' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'y',
'value' => array(0 => 'n',1 => 'y')
),
##################################
# ENDE Datatable fields
##################################
)
);
<?php
/*
Form Definition
Tabledefinition
Datatypes:
- INTEGER (Forces the input to Int)
- DOUBLE
- CURRENCY (Formats the values to currency notation)
- VARCHAR (no format check, maxlength: 255)
- TEXT (no format check)
- DATE (Dateformat, automatic conversion to timestamps)
Formtype:
- TEXT (Textfield)
- TEXTAREA (Textarea)
- PASSWORD (Password textfield, input is not shown when edited)
- SELECT (Select option field)
- RADIO
- CHECKBOX
- CHECKBOXARRAY
- FILE
VALUE:
- Wert oder Array
Hint:
The ID field of the database table is not part of the datafield definition.
The ID field must be always auto incement (int or bigint).
*/
$form["title"] = "Web Aliasdomain";
$form["description"] = "";
$form["name"] = "web_domain";
$form["action"] = "web_aliasdomain_edit.php";
$form["db_table"] = "web_domain";
$form["db_table_idx"] = "domain_id";
$form["db_history"] = "yes";
$form["tab_default"] = "domain";
$form["list_default"] = "web_aliasdomain_list.php";
$form["auth"] = 'yes'; // yes / no
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['domain'] = array (
'title' => "Domain",
'width' => 100,
'template' => "templates/web_aliasdomain_edit.htm",
'fields' => array (
##################################
# Begin Datatable fields
##################################
'server_id' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
'keyfield'=> 'server_id',
'valuefield'=> 'server_name'
),
'value' => ''
),
'domain' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'domain_error_empty'),
1 => array ( 'type' => 'UNIQUE',
'errmsg'=> 'domain_error_unique'),
2 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
'errmsg'=> 'domain_error_regex'),
),
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => 'y',
'value' => array('vhost' => 'Site', 'alias' => 'Alias', 'subdomain' => 'Subdomain')
),
'parent_domain_id' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
),
'value' => ''
),
'redirect_type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => 'y',
'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
),
'redirect_path' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'subdomain' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => 'y',
'value' => array('none' => 'none', 'www' => 'www.', '*' => '*.')
),
'active' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'y',
'value' => array(0 => 'n',1 => 'y')
),
##################################
# ENDE Datatable fields
##################################
)
);
?>
\ No newline at end of file
......@@ -27,7 +27,7 @@ $wb["traffic_quota_txt"] = 'Traffic Quota';
$wb["cgi_txt"] = 'CGI';
$wb["ssi_txt"] = 'SSI';
$wb["errordocs_txt"] = 'Own Error-Documents';
$wb["is_subdomainwww_txt"] = 'www. Subdomain';
$wb["subdomain_txt"] = 'Auto-Subdomain';
$wb["ssl_txt"] = 'SSL';
$wb["suexec_txt"] = 'SuEXEC';
$wb["php_txt"] = 'PHP';
......
......@@ -20,6 +20,10 @@
<label for="redirect_path" class="wf_preField">{tmpl_var name='redirect_path_txt'}</label>
<input type="text" id="redirect_path" name="redirect_path" value="{tmpl_var name='redirect_path'}" size="30" maxlength="255">
</span>
<span class="wf_oneField">
<label for="subdomain" class="wf_preField">{tmpl_var name='subdomain_txt'}</label>
<select id="subdomain" name="subdomain">{tmpl_var name='subdomain'}</select>
</span>
<span class="wf_oneField">
<label for="active" class="wf_preField">{tmpl_var name='active_txt'}</label>
<span class="">{tmpl_var name='active'}</span>
......
<h2><tmpl_var name="list_head_txt"></h2>
<div class="panel panel_web_domain">
<div class="pnl_formsarea">
<fieldset id="wf_area_web_domain"><legend>Domain</legend>
<tmpl_if name="is_admin">
<span class="wf_oneField">
<label for="server_id" class="wf_preField">{tmpl_var name='server_id_txt'}</label>
<select id="server_id" name="server_id" onChange="loadContentInto('ip_address','sites/ajax_get_ip.php?server_id='+document.getElementById('server_id').value)">{tmpl_var name='server_id'}</select>
</span>
<span class="wf_oneField">
<label for="client_group_id" class="wf_preField">{tmpl_var name='client_txt'}</label>
<select id="client_group_id" name="client_group_id">{tmpl_var name='client_group_id'}</select>
</span>
</tmpl_if>
<tmpl_if name="is_reseller">
<span class="wf_oneField">
<label for="client_group_id" class="wf_preField">{tmpl_var name='client_group_id_txt'}</label>
<select id="client_group_id" name="client_group_id">{tmpl_var name='client_group_id'}</select>
</span>
</tmpl_if>
<span class="wf_oneField">
<label for="ip_address" class="wf_preField">{tmpl_var name='ip_address_txt'}</label>
<select id="ip_address" name="ip_address">{tmpl_var name='ip_address'}</select>
</span>
<span class="wf_oneField">
<label for="domain" class="wf_preField">{tmpl_var name='domain_txt'}</label>
<input type="text" id="domain" name="domain" value="{tmpl_var name='domain'}" size="30" maxlength="255">
</span>
<!--
<span class="wf_oneField">
<label for="type" class="wf_preField">{tmpl_var name='type_txt'}</label>
<select id="type" name="type">{tmpl_var name='type'}</select>
</span>
<span class="wf_oneField">
<label for="parent_domain_id" class="wf_preField">{tmpl_var name='parent_domain_id_txt'}</label>
<select id="parent_domain_id" name="parent_domain_id">{tmpl_var name='parent_domain_id'}</select>
</span>
<span class="wf_oneField">
<label for="vhost_type" class="wf_preField">{tmpl_var name='vhost_type_txt'}</label>
<select id="vhost_type" name="vhost_type">{tmpl_var name='vhost_type'}</select>
</span>
-->
<span class="wf_oneField">
<label for="hd_quota" class="wf_preField">{tmpl_var name='hd_quota_txt'}</label>
<input type="text" id="hd_quota" name="hd_quota" value="{tmpl_var name='hd_quota'}" size="7" maxlength="7">
</span>
<span class="wf_oneField">
<label for="traffic_quota" class="wf_preField">{tmpl_var name='traffic_quota_txt'}</label>
<input type="text" id="traffic_quota" name="traffic_quota" value="{tmpl_var name='traffic_quota'}" size="7" maxlength="7">
</span>
<span class="wf_oneField">
<label for="cgi" class="wf_preField">{tmpl_var name='cgi_txt'}</label>
<span class="">{tmpl_var name='cgi'}</span>
</span>
<span class="wf_oneField">
<label for="ssi" class="wf_preField">{tmpl_var name='ssi_txt'}</label>
<span class="">{tmpl_var name='ssi'}</span>
</span>
<span class="wf_oneField">
<label for="suexec" class="wf_preField">{tmpl_var name='suexec_txt'}</label>
<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>
</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>
<span class="">{tmpl_var name='ssl'}</span>
</span>
<span class="wf_oneField">
<label for="php" class="wf_preField">{tmpl_var name='php_txt'}</label>
<select id="php" name="php">{tmpl_var name='php'}</select>
</span>
<span class="wf_oneField">
<label for="active" class="wf_preField">{tmpl_var name='active_txt'}</label>
<span class="">{tmpl_var name='active'}</span>
</span>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="wf_actions buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_domain_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
</div>
<h2><tmpl_var name="list_head_txt"></h2>
<div class="panel panel_web_domain">
<div class="pnl_formsarea">
<fieldset id="wf_area_web_domain"><legend>Domain</legend>
<tmpl_if name="is_admin">
<span class="wf_oneField">
<label for="server_id" class="wf_preField">{tmpl_var name='server_id_txt'}</label>
<select id="server_id" name="server_id" onChange="loadContentInto('ip_address','sites/ajax_get_ip.php?server_id='+document.getElementById('server_id').value)">{tmpl_var name='server_id'}</select>
</span>
<span class="wf_oneField">
<label for="client_group_id" class="wf_preField">{tmpl_var name='client_txt'}</label>
<select id="client_group_id" name="client_group_id">{tmpl_var name='client_group_id'}</select>
</span>
</tmpl_if>
<tmpl_if name="is_reseller">
<span class="wf_oneField">
<label for="client_group_id" class="wf_preField">{tmpl_var name='client_group_id_txt'}</label>
<select id="client_group_id" name="client_group_id">{tmpl_var name='client_group_id'}</select>
</span>
</tmpl_if>
<span class="wf_oneField">
<label for="ip_address" class="wf_preField">{tmpl_var name='ip_address_txt'}</label>
<select id="ip_address" name="ip_address">{tmpl_var name='ip_address'}</select>
</span>
<span class="wf_oneField">
<label for="domain" class="wf_preField">{tmpl_var name='domain_txt'}</label>
<input type="text" id="domain" name="domain" value="{tmpl_var name='domain'}" size="30" maxlength="255">
</span>
<!--
<span class="wf_oneField">
<label for="type" class="wf_preField">{tmpl_var name='type_txt'}</label>
<select id="type" name="type">{tmpl_var name='type'}</select>
</span>
<span class="wf_oneField">
<label for="parent_domain_id" class="wf_preField">{tmpl_var name='parent_domain_id_txt'}</label>
<select id="parent_domain_id" name="parent_domain_id">{tmpl_var name='parent_domain_id'}</select>
</span>
<span class="wf_oneField">
<label for="vhost_type" class="wf_preField">{tmpl_var name='vhost_type_txt'}</label>
<select id="vhost_type" name="vhost_type">{tmpl_var name='vhost_type'}</select>
</span>
-->
<span class="wf_oneField">
<label for="hd_quota" class="wf_preField">{tmpl_var name='hd_quota_txt'}</label>
<input type="text" id="hd_quota" name="hd_quota" value="{tmpl_var name='hd_quota'}" size="7" maxlength="7">
</span>
<span class="wf_oneField">
<label for="traffic_quota" class="wf_preField">{tmpl_var name='traffic_quota_txt'}</label>
<input type="text" id="traffic_quota" name="traffic_quota" value="{tmpl_var name='traffic_quota'}" size="7" maxlength="7">
</span>
<span class="wf_oneField">
<label for="cgi" class="wf_preField">{tmpl_var name='cgi_txt'}</label>
<span class="">{tmpl_var name='cgi'}</span>
</span>
<span class="wf_oneField">
<label for="ssi" class="wf_preField">{tmpl_var name='ssi_txt'}</label>
<span class="">{tmpl_var name='ssi'}</span>
</span>
<span class="wf_oneField">
<label for="suexec" class="wf_preField">{tmpl_var name='suexec_txt'}</label>
<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>
</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="subdomain" class="wf_preField">{tmpl_var name='subdomain_txt'}</label>
<select id="subdomain" name="subdomain">{tmpl_var name='subdomain'}</select>
</span>
<span class="wf_oneField">
<label for="ssl" class="wf_preField">{tmpl_var name='ssl_txt'}</label>
<span class="">{tmpl_var name='ssl'}</span>
</span>
<span class="wf_oneField">
<label for="php" class="wf_preField">{tmpl_var name='php_txt'}</label>
<select id="php" name="php">{tmpl_var name='php'}</select>
</span>
<span class="wf_oneField">
<label for="active" class="wf_preField">{tmpl_var name='active_txt'}</label>
<span class="">{tmpl_var name='active'}</span>
</span>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="wf_actions buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_domain_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
</div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment