From 7d52e00a51450bc4a080d4e21b7dda02c0a65191 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 14 Nov 2013 05:42:06 -0500
Subject: [PATCH] Fixed list sorting
---
interface/web/sites/form/web_vhost_subdomain.tform.php | 68 ++++++++++++++++++++-------------
1 files changed, 41 insertions(+), 27 deletions(-)
diff --git a/interface/web/sites/form/web_vhost_subdomain.tform.php b/interface/web/sites/form/web_vhost_subdomain.tform.php
index 448e3ae..e424afa 100644
--- a/interface/web/sites/form/web_vhost_subdomain.tform.php
+++ b/interface/web/sites/form/web_vhost_subdomain.tform.php
@@ -111,14 +111,18 @@
'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,255}\.[a-zA-Z0-9\-]{2,30}$/',
- 'errmsg'=> 'domain_error_regex'),
- ),
+ 'filters' => array( 0 => array( 'event' => 'SAVE',
+ 'type' => 'IDNTOASCII'),
+ 1 => array( 'event' => 'SHOW',
+ 'type' => 'IDNTOUTF8'),
+ 2 => array( 'event' => 'SAVE',
+ 'type' => 'TOLOWER')
+ ),
+ 'validators' => array ( 0 => array ( 'type' => 'CUSTOM',
+ 'class' => 'validate_domain',
+ 'function' => 'sub_domain',
+ 'errmsg'=> 'domain_error_regex'),
+ ),
'default' => '',
'value' => '',
'width' => '30',
@@ -136,16 +140,16 @@
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
- 'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
+ 'querystring' => "SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
'keyfield'=> 'domain_id',
- 'valuefield'=> 'domain'
+ 'valuefield'=> 'parent_domain'
),
'value' => ''
),
'web_folder' => array (
'datatype' => 'VARCHAR',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '@^([\w/_\.\-]{1,100})$@',
+ 'regex' => '@^((?!.*\.\.)[\w/_\.\-]{1,100})$@',
'errmsg'=> 'web_folder_error_regex'),
),
'formtype' => 'TEXT',
@@ -163,13 +167,7 @@
'hd_quota' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
- 'errmsg'=> 'hd_quota_error_empty'),
- 1 => array ( 'type' => 'REGEX',
- 'regex' => '/^(\-1|[0-9]{1,10})$/',
- 'errmsg'=> 'hd_quota_error_regex'),
- ),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'width' => '7',
'maxlength' => '7'
@@ -277,7 +275,7 @@
$form["tabs"]['redirect'] = array (
'title' => "Redirect",
'width' => 100,
- 'template' => "templates/web_domain_redirect.htm",
+ 'template' => "templates/web_vhost_subdomain_redirect.htm",
'readonly' => false,
'fields' => array (
##################################
@@ -287,12 +285,12 @@
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => '',
- 'value' => array('' => 'no_redirect_txt', 'no' => 'no_flag_txt', 'R' => 'R', 'L' => 'L', 'R,L' => 'R,L', 'R=301,L' => 'R=301,L', 'last' => 'last', 'break' => 'break', 'redirect' => 'redirect', 'permanent' => 'permanent')
+ 'value' => array('' => 'no_redirect_txt', 'no' => 'no_flag_txt', 'R' => 'R', 'L' => 'L', 'R,L' => 'R,L', 'R=301,L' => 'R=301,L', 'last' => 'last', 'break' => 'break', 'redirect' => 'redirect', 'permanent' => 'permanent', 'proxy' => 'proxy')
),
'redirect_path' => array (
'datatype' => 'VARCHAR',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '@^(([\.]{0})|(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.\,\-\+\?\~]*(\?\S+)?)?)?)|(\[scheme\]://([-\w\.]+)+(:\d+)?(/([\w/_\.\-\,\+\?\~]*(\?\S+)?)?)?)|(/[\w/_\.\-]{1,255}/))$@',
+ 'regex' => '@^(([\.]{0})|((ftp|https?)://([-\w\.]+)+(:\d+)?(/([\w/_\.\,\-\+\?\~!:%]*(\?\S+)?)?)?)|(\[scheme\]://([-\w\.]+)+(:\d+)?(/([\w/_\.\-\,\+\?\~!:%]*(\?\S+)?)?)?)|(/(?!.*\.\.)[\w/_\.\-]{1,255}/))$@',
'errmsg'=> 'redirect_error_regex'),
),
'formtype' => 'TEXT',
@@ -305,7 +303,15 @@
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => '',
- 'value' => array('' => 'no_redirect_txt', 'non_www_to_www' => 'non_www_to_www_txt', 'www_to_non_www' => 'www_to_non_www_txt')
+ 'value' => array('' => 'no_redirect_txt', 'non_www_to_www' => 'domain.tld => www.domain.tld', 'www_to_non_www' => 'www.domain.tld => domain.tld', '*_domain_tld_to_domain_tld' => '*.doman.tld => domain.tld', '*_domain_tld_to_www_domain_tld' => '*.domain.tld => www.domain.tld', '*_to_domain_tld' => '* => domain.tld', '*_to_www_domain_tld' => '* => www.domain.tld')
+ ),
+ 'rewrite_rules' => array (
+ 'datatype' => 'TEXT',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
),
##################################
# ENDE Datatable fields
@@ -317,7 +323,7 @@
$form["tabs"]['ssl'] = array (
'title' => "SSL",
'width' => 100,
- 'template' => "templates/web_domain_ssl.htm",
+ 'template' => "templates/web_vhost_subdomain_ssl.htm",
'readonly' => false,
'fields' => array (
##################################
@@ -453,7 +459,7 @@
$form["tabs"]['stats'] = array (
'title' => "Stats",
'width' => 100,
- 'template' => "templates/web_domain_stats.htm",
+ 'template' => "templates/web_vhost_subdomain_stats.htm",
'readonly' => false,
'fields' => array (
##################################
@@ -486,7 +492,7 @@
$form["tabs"]['backup'] = array (
'title' => "Backup",
'width' => 100,
- 'template' => "templates/web_domain_backup.htm",
+ 'template' => "templates/web_vhost_subdomain_backup.htm",
'readonly' => false,
'fields' => array (
##################################
@@ -524,7 +530,7 @@
$form["tabs"]['advanced'] = array (
'title' => "Options",
'width' => 100,
- 'template' => "templates/web_domain_advanced.htm",
+ 'template' => "templates/web_vhost_subdomain_advanced.htm",
'readonly' => false,
'fields' => array (
##################################
@@ -692,7 +698,15 @@
'value' => '',
'width' => '30',
'maxlength' => '255'
- )
+ ),
+ 'proxy_directives' => array (
+ 'datatype' => 'TEXT',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
##################################
# ENDE Datatable fields
##################################
--
Gitblit v1.9.1