From c1fcaed2ee8f05a5030fe4e8e211ca4eae7a9489 Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Tue, 11 Jun 2013 11:44:57 -0400
Subject: [PATCH] - Fixed FS#2921 - RBL list field in server config can not be empty.
---
interface/web/sites/form/web_aliasdomain.tform.php | 80 +++++++++++++++++++++++++++++++++-------
1 files changed, 66 insertions(+), 14 deletions(-)
diff --git a/interface/web/sites/form/web_aliasdomain.tform.php b/interface/web/sites/form/web_aliasdomain.tform.php
index 815a373..e815034 100644
--- a/interface/web/sites/form/web_aliasdomain.tform.php
+++ b/interface/web/sites/form/web_aliasdomain.tform.php
@@ -29,13 +29,18 @@
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).
+
+ Search:
+ - searchable = 1 or searchable = 2 include the field in the search
+ - searchable = 1: this field will be the title of the search result
+ - searchable = 2: this field will be included in the description of the search result
*/
$form["title"] = "Web Aliasdomain";
$form["description"] = "";
-$form["name"] = "web_domain";
+$form["name"] = "web_aliasdomain";
$form["action"] = "web_aliasdomain_edit.php";
$form["db_table"] = "web_domain";
$form["db_table_idx"] = "domain_id";
@@ -72,18 +77,23 @@
'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'),
- ),
+ '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' => 'alias_domain',
+ 'errmsg'=> 'domain_error_regex'),
+ ),
'default' => '',
'value' => '',
'width' => '30',
- 'maxlength' => '255'
+ 'maxlength' => '255',
+ 'searchable' => 1
),
'type' => array (
'datatype' => 'VARCHAR',
@@ -106,11 +116,15 @@
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => 'y',
- 'value' => array('' => 'No redirect', 'no' => 'No flag', 'R' => 'R', 'L' => 'L', 'R,L' => 'R,L')
+ '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',
'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'REGEX',
+ 'regex' => '@^(([\.]{0})|((ftp|https?)://([-\w\.]+)+(:\d+)?(/([\w/_\.\-\,\+\?\~!:%]*(\?\S+)?)?)?)|(\[scheme\]://([-\w\.]+)+(:\d+)?(/([\w/_\.\-\,\+\?\~!:%]*(\?\S+)?)?)?)|(/(?!.*\.\.)[\w/_\.\-]{1,255}/))$@',
+ 'errmsg'=> 'redirect_error_regex'),
+ ),
'default' => '',
'value' => '',
'width' => '30',
@@ -119,8 +133,19 @@
'subdomain' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
- 'default' => 'y',
- 'value' => array('none' => 'none', 'www' => 'www.', '*' => '*.')
+ 'default' => 'www',
+ 'validators' => array ( 0 => array ( 'type' => 'CUSTOM',
+ 'class' => 'validate_domain',
+ 'function' => 'web_domain_autosub',
+ 'errmsg'=> 'domain_error_autosub'),
+ ),
+ 'value' => array('none' => 'none_txt', 'www' => 'www.', '*' => '*.')
+ ),
+ 'seo_redirect' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'SELECT',
+ 'default' => '',
+ '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')
),
'active' => array (
'datatype' => 'VARCHAR',
@@ -134,5 +159,32 @@
)
);
+if($_SESSION["s"]["user"]["typ"] == 'admin') {
-?>
\ No newline at end of file
+$form["tabs"]['advanced'] = array (
+ 'title' => "Options",
+ 'width' => 100,
+ 'template' => "templates/web_aliasdomain_advanced.htm",
+ 'readonly' => false,
+ 'fields' => array (
+ ##################################
+ # Begin Datatable fields
+ ##################################
+ 'proxy_directives' => array (
+ 'datatype' => 'TEXT',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+}
+
+
+?>
--
Gitblit v1.9.1