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/client/form/client.tform.php | 335 ++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 293 insertions(+), 42 deletions(-)
diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php
index f4777ae..7d7bf45 100644
--- a/interface/web/client/form/client.tform.php
+++ b/interface/web/client/form/client.tform.php
@@ -29,20 +29,25 @@
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"] = "Client";
-$form["description"] = "";
-$form["name"] = "client";
-$form["action"] = "client_edit.php";
-$form["db_table"] = "client";
+$form["title"] = "Client";
+$form["description"] = "";
+$form["name"] = "client";
+$form["action"] = "client_edit.php";
+$form["db_table"] = "client";
$form["db_table_idx"] = "client_id";
-$form["db_history"] = "yes";
+$form["db_history"] = "yes";
$form["tab_default"] = "address";
$form["list_default"] = "client_list.php";
-$form["auth"] = 'yes';
+$form["auth"] = 'yes';
$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
@@ -68,7 +73,9 @@
while ($file = @readdir ($handle)) {
if (substr($file, 0, 1) != '.') {
if(@is_dir(ISPC_THEMES_PATH."/$file")) {
- $themes_list[$file] = $file;
+ if(!file_exists(ISPC_THEMES_PATH."/$file/ispconfig_version") || (@file_exists(ISPC_THEMES_PATH."/$file/ispconfig_version") && trim(@file_get_contents(ISPC_THEMES_PATH."/$file/ispconfig_version")) == ISPC_APP_VERSION)) {
+ $themes_list[$file] = $file;
+ }
}
}
}
@@ -90,53 +97,65 @@
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'contact_name' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
- 'errmsg'=> 'contact_error_empty'),
- ),
+ 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
+ 'errmsg'=> 'contact_error_empty'),
+ ),
'default' => '',
'value' => '',
'separator' => '',
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 1
),
'customer_no' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'UNIQUE',
+ 'errmsg'=> 'customer_no_error_unique',
+ 'allowempty' => 'y'),
+ ),
'default' => '',
'value' => '',
'separator' => '',
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'username' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
- 'errmsg'=> 'username_error_empty'),
- 1 => array ( 'type' => 'CUSTOM',
- 'class' => 'validate_client',
- 'function' => 'username_unique',
- 'errmsg'=> 'username_error_unique'),
- 2 => array ( 'type' => 'REGEX',
- 'regex' => '/^[\w\.\-\_]{0,64}$/',
- 'errmsg'=> 'username_error_regex'),
- ),
+ 'errmsg'=> 'username_error_empty'),
+ 1 => array ( 'type' => 'CUSTOM',
+ 'class' => 'validate_client',
+ 'function' => 'username_unique',
+ 'errmsg'=> 'username_error_unique'),
+ 2 => array ( 'type' => 'CUSTOM',
+ 'class' => 'validate_client',
+ 'function' => 'username_collision',
+ 'errmsg'=> 'username_error_collision'),
+ 3 => array ( 'type' => 'REGEX',
+ 'regex' => '/^[\w\.\-\_]{0,64}$/',
+ 'errmsg'=> 'username_error_regex'),
+ ),
'default' => '',
'value' => '',
'separator' => '',
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'password' => array (
'datatype' => 'VARCHAR',
@@ -164,7 +183,7 @@
'usertheme' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
- 'default' => 'default',
+ 'default' => $conf["theme"],
'value' => $themes_list,
'separator' => '',
'width' => '30',
@@ -181,7 +200,8 @@
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'zip' => array (
'datatype' => 'VARCHAR',
@@ -192,7 +212,8 @@
'width' => '10',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'city' => array (
'datatype' => 'VARCHAR',
@@ -203,7 +224,8 @@
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'state' => array (
'datatype' => 'VARCHAR',
@@ -214,18 +236,18 @@
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'country' => array (
'datatype' => 'VARCHAR',
-
'formtype' => 'SELECT',
- 'default' => 'DE',
- 'datasource' => array ( 'type' => 'SQL',
- 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name',
- 'keyfield'=> 'iso',
- 'valuefield'=> 'printable_name'
- ),
+ 'default' => (isset($conf['language']) ? strtoupper($conf['language']) : ''),
+ 'datasource' => array ( 'type' => 'SQL',
+ 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY iso ASC',
+ 'keyfield' => 'iso',
+ 'valuefield' => 'printable_name'
+ ),
'value' => ''
),
'telephone' => array (
@@ -237,7 +259,8 @@
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'mobile' => array (
'datatype' => 'VARCHAR',
@@ -248,7 +271,8 @@
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'fax' => array (
'datatype' => 'VARCHAR',
@@ -259,18 +283,31 @@
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'email' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
+ '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' => 'REGEX',
+ 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i',
+ 'errmsg'=> 'email_error_isemail'),
+ ),
'default' => '',
'value' => '',
'separator' => '',
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'internet' => array (
'datatype' => 'VARCHAR',
@@ -281,7 +318,8 @@
'width' => '30',
'maxlength' => '255',
'rows' => '',
- 'cols' => ''
+ 'cols' => '',
+ 'searchable' => 2
),
'icq' => array (
'datatype' => 'VARCHAR',
@@ -305,6 +343,83 @@
'rows' => '',
'cols' => ''
),
+ 'company_id' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '20',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'bank_account_owner' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'bank_account_number' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'bank_code' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'bank_name' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'bank_account_iban' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'bank_account_swift' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
'notes' => array (
'datatype' => 'TEXT',
'formtype' => 'TEXTAREA',
@@ -315,6 +430,29 @@
'maxlength' => '',
'rows' => '10',
'cols' => '30'
+ ),
+ 'paypal_email' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ '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' => 'REGEX',
+ 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i',
+ 'errmsg'=> 'paypal_email_error_isemail'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => '',
+ 'searchable' => 2
),
##################################
# END Datatable fields
@@ -402,6 +540,20 @@
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_mailaliasdomain_error_notint'),
+ ),
+ 'default' => '-1',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '10',
+ 'maxlength' => '10',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'limit_mailmailinglist' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'ISINT',
+ 'errmsg'=> 'limit_mailmailinglist_error_notint'),
),
'default' => '-1',
'value' => '',
@@ -579,10 +731,67 @@
'web_php_options' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOXARRAY',
+ 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
+ 'errmsg'=> 'web_php_options_notempty'),
+ ),
'default' => '',
'separator' => ',',
'valuelimit' => 'client:web_php_options',
- 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP')
+ 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP', 'php-fpm' => 'PHP-FPM')
+ ),
+ 'limit_cgi' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'CHECKBOX',
+ 'default' => 'n',
+ 'value' => array(0 => 'n',1 => 'y')
+ ),
+ 'limit_ssi' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'CHECKBOX',
+ 'default' => 'n',
+ 'value' => array(0 => 'n',1 => 'y')
+ ),
+ 'limit_perl' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'CHECKBOX',
+ 'default' => 'n',
+ 'value' => array(0 => 'n',1 => 'y')
+ ),
+ 'limit_ruby' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'CHECKBOX',
+ 'default' => 'n',
+ 'value' => array(0 => 'n',1 => 'y')
+ ),
+ 'limit_python' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'CHECKBOX',
+ 'default' => 'n',
+ 'value' => array(0 => 'n',1 => 'y')
+ ),
+ 'force_suexec' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'CHECKBOX',
+ 'default' => 'y',
+ 'value' => array(0 => 'n',1 => 'y')
+ ),
+ 'limit_hterror' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'CHECKBOX',
+ 'default' => 'n',
+ 'value' => array(0 => 'n',1 => 'y')
+ ),
+ 'limit_wildcard' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'CHECKBOX',
+ 'default' => 'n',
+ 'value' => array(0 => 'n',1 => 'y')
+ ),
+ 'limit_ssl' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'CHECKBOX',
+ 'default' => 'n',
+ 'value' => array(0 => 'n',1 => 'y')
),
'limit_web_aliasdomain' => array (
'datatype' => 'INTEGER',
@@ -643,6 +852,9 @@
'ssh_chroot' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOXARRAY',
+ 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
+ 'errmsg'=> 'ssh_chroot_notempty'),
+ ),
'default' => '',
'separator' => ',',
'valuelimit' => 'client:ssh_chroot',
@@ -802,6 +1014,45 @@
'rows' => '',
'cols' => ''
),
+ 'limit_openvz_vm' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'ISINT',
+ 'errmsg'=> 'limit_openvz_vm_error_notint'),
+ ),
+ 'default' => '0',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '10',
+ 'maxlength' => '10',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'limit_openvz_vm_template_id' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'SELECT',
+ 'default' => '',
+ 'datasource' => array ( 'type' => 'SQL',
+ 'querystring' => 'SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name',
+ 'keyfield'=> 'template_id',
+ 'valuefield'=> 'template_name'
+ ),
+ 'value' => array(0 => ' ')
+ ),
+ 'limit_aps' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'ISINT',
+ 'errmsg'=> 'limit_aps_error_notint'),
+ ),
+ 'default' => '-1',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '10',
+ 'maxlength' => '10',
+ 'rows' => '',
+ 'cols' => ''
+ ),
##################################
# END Datatable fields
##################################
--
Gitblit v1.9.1