From 66c3bc24f069a2854bdf1eeebb6dcb51f6ef0afb Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Wed, 28 Oct 2009 14:30:28 -0400 Subject: [PATCH] Implemented: FS#757 - Add "custom" option to transports --- interface/web/client/form/client.tform.php | 198 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 173 insertions(+), 25 deletions(-) diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php index 14aeab1..cd599df 100644 --- a/interface/web/client/form/client.tform.php +++ b/interface/web/client/form/client.tform.php @@ -50,6 +50,18 @@ $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 +//* Languages +$language_list = array(); +$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); +while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { + $tmp = substr($file, 0, 2); + $language_list[$tmp] = $tmp; + } + } +} + $form["tabs"]['address'] = array ( 'title' => "Address", 'width' => 100, @@ -92,6 +104,9 @@ 'class' => 'validate_client', 'function' => 'username_unique', 'errmsg'=> 'username_error_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-\_]{0,64}$/', + 'errmsg'=> 'username_error_regex'), ), 'default' => '', 'value' => '', @@ -104,6 +119,7 @@ 'password' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'PASSWORD', + 'encryption'=> 'CRYPT', 'default' => '', 'value' => '', 'separator' => '', @@ -116,7 +132,7 @@ 'datatype' => 'VARCHAR', 'formtype' => 'SELECT', 'default' => $conf["language"], - 'value' => array('en' => 'en'), + 'value' => $language_list, 'separator' => '', 'width' => '30', 'maxlength' => '255', @@ -180,14 +196,15 @@ ), 'country' => array ( 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' + + 'formtype' => 'SELECT', + 'default' => 'DE', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name', + 'keyfield'=> 'iso', + 'valuefield'=> 'printable_name' + ), + 'value' => '' ), 'telephone' => array ( 'datatype' => 'VARCHAR', @@ -280,16 +297,30 @@ ################################## # Begin Datatable fields ################################## + 'template_master' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'master_templates' + ), + 'value' => '' + ), + 'template_additional' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + ), 'default_mailserver' => array ( 'datatype' => 'INTEGER', 'formtype' => 'SELECT', 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' ), - 'value' => '' + 'value' => '', + 'name' => 'default_mailserver' ), 'limit_maildomain' => array ( 'datatype' => 'INTEGER', @@ -324,6 +355,20 @@ 'formtype' => 'TEXT', 'validators' => array ( 0 => array ( 'type' => 'ISINT', 'errmsg'=> 'limit_mailalias_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailaliasdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailaliasdomain_error_notint'), ), 'default' => '-1', 'value' => '', @@ -463,12 +508,12 @@ 'datatype' => 'INTEGER', 'formtype' => 'SELECT', 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE web_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' ), - 'value' => '' + 'value' => '', + 'name' => 'default_webserver' ), 'limit_web_domain' => array ( 'datatype' => 'INTEGER', @@ -483,6 +528,28 @@ 'maxlength' => '10', 'rows' => '', 'cols' => '' + ), + 'limit_web_quota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_quota_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'web_php_options' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'valuelimit' => 'client:web_php_options', + 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP') ), 'limit_web_aliasdomain' => array ( 'datatype' => 'INTEGER', @@ -540,16 +607,24 @@ 'rows' => '', 'cols' => '' ), + 'ssh_chroot' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'valuelimit' => 'client:ssh_chroot', + 'value' => array('no' => 'None', 'jailkit' => 'Jailkit') + ), 'default_dnsserver' => array ( 'datatype' => 'INTEGER', 'formtype' => 'SELECT', 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE dns_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' ), - 'value' => '' + 'value' => '', + 'name' => 'default_dnsserver' ), 'limit_dns_zone' => array ( 'datatype' => 'INTEGER', @@ -569,7 +644,7 @@ 'datatype' => 'INTEGER', 'formtype' => 'TEXT', 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_zone_error_notint'), + 'errmsg'=> 'limit_dns_record_error_notint'), ), 'default' => '-1', 'value' => '', @@ -579,6 +654,79 @@ 'rows' => '', 'cols' => '' ), + 'limit_client' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_client_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'default_dbserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' + ), + 'value' => '', + 'name' => 'default_dbserver' + ), + 'limit_database' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_database_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_cron' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_cron_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => '', + 'value' => array('full' => 'Full Cron','chrooted' => 'Chrooted Cron','url' => 'URL Cron') + ), + 'limit_cron_frequency' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_frequency'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), ################################## # END Datatable fields ################################## -- Gitblit v1.9.1