From 374c8db63dca02dcf62d64448dc408897925c19f Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 26 May 2010 08:24:42 -0400
Subject: [PATCH] Improved some list templates and the dashboard template.
---
interface/web/sites/form/web_domain.tform.php | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 211 insertions(+), 8 deletions(-)
diff --git a/interface/web/sites/form/web_domain.tform.php b/interface/web/sites/form/web_domain.tform.php
index 383ac61..1d79412 100644
--- a/interface/web/sites/form/web_domain.tform.php
+++ b/interface/web/sites/form/web_domain.tform.php
@@ -50,10 +50,19 @@
$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
+// Clients may not change the website basic settings if they are not resellers
+if($app->auth->has_clients($_SESSION['s']['user']['userid']) || $app->auth->is_admin()) {
+ $web_domain_edit_readonly = false;
+} else {
+ $web_domain_edit_readonly = true;
+}
+
+
$form["tabs"]['domain'] = array (
'title' => "Domain",
'width' => 100,
'template' => "templates/web_domain_edit.htm",
+ 'readonly' => $web_domain_edit_readonly,
'fields' => array (
##################################
# Begin Datatable fields
@@ -63,7 +72,7 @@
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
- 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
+ 'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND web_server = 1 AND {AUTHSQL} ORDER BY server_name',
'keyfield'=> 'server_id',
'valuefield'=> 'server_name'
),
@@ -88,7 +97,7 @@
1 => array ( 'type' => 'UNIQUE',
'errmsg'=> 'domain_error_unique'),
2 => array ( 'type' => 'REGEX',
- 'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
+ 'regex' => '/^[\w\.\-]{2,255}\.[a-zA-Z]{2,10}$/',
'errmsg'=> 'domain_error_regex'),
),
'default' => '',
@@ -144,26 +153,45 @@
'cgi' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
- 'default' => 'y',
+ 'default' => 'n',
'value' => array(0 => 'n',1 => 'y')
),
'ssi' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
- 'default' => 'y',
+ 'default' => 'n',
'value' => array(0 => 'n',1 => 'y')
),
'suexec' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
+ 'default' => 'n',
+ 'value' => array(0 => 'n',1 => 'y')
+ ),
+ 'errordocs' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'default' => '1',
+ 'value' => array(0 => '0',1 => '1')
+ ),
+ 'subdomain' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'SELECT',
'default' => 'y',
+ 'value' => array('none' => 'none', 'www' => 'www.', '*' => '*.')
+ ),
+ 'ssl' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'CHECKBOX',
+ 'default' => 'n',
'value' => array(0 => 'n',1 => 'y')
),
'php' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
- 'default' => 'y',
- 'value' => array('' => 'Disabled', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP')
+ 'default' => 'fast-cgi',
+ 'valuelimit' => 'client:web_php_options',
+ 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP')
),
'active' => array (
'datatype' => 'VARCHAR',
@@ -177,10 +205,12 @@
)
);
+
$form["tabs"]['redirect'] = array (
'title' => "Redirect",
'width' => 100,
'template' => "templates/web_domain_redirect.htm",
+ 'readonly' => false,
'fields' => array (
##################################
# Begin Datatable fields
@@ -188,12 +218,154 @@
'redirect_type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
- 'default' => 'y',
- 'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
+ 'default' => '',
+ 'value' => array('' => 'No redirect', 'no' => 'No flag', 'R' => 'R', 'L' => 'L', 'R,L' => 'R,L')
),
'redirect_path' => array (
'datatype' => 'VARCHAR',
+ 'validators' => array ( 0 => array ( 'type' => 'REGEX',
+ 'regex' => '@^(([.]{0})|(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.\,\-]*(\?\S+)?)?)?)|(/[\w/_\.\-]{1,255}/))$@',
+ 'errmsg'=> 'redirect_error_regex'),
+ ),
'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+$form["tabs"]['ssl'] = array (
+ 'title' => "SSL",
+ 'width' => 100,
+ 'template' => "templates/web_domain_ssl.htm",
+ 'readonly' => false,
+ 'fields' => array (
+ ##################################
+ # Begin Datatable fields
+ ##################################
+ 'ssl_state' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'REGEX',
+ 'regex' => '/^(([.]{0})|([a-zA-Z0-9\ \.\-\_\,]{1,255}))$/',
+ 'errmsg'=> 'ssl_state_error_regex'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'ssl_locality' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'REGEX',
+ 'regex' => '/^(([.]{0})|([a-zA-Z0-9\ \.\-\_\,]{1,255}))$/',
+ 'errmsg'=> 'ssl_locality_error_regex'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'ssl_organisation' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'REGEX',
+ 'regex' => '/^(([.]{0})|([a-zA-Z0-9\ \.\-\_\,]{1,255}))$/',
+ 'errmsg'=> 'ssl_organisation_error_regex'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'ssl_organisation_unit' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'REGEX',
+ 'regex' => '/^(([.]{0})|([a-zA-Z0-9\ \.\-\_\,]{1,255}))$/',
+ 'errmsg'=> 'ssl_organistaion_unit_error_regex'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'ssl_country' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'REGEX',
+ 'regex' => '/^(([.]{0})|([A-Z]{2,2}))$/',
+ 'errmsg'=> 'ssl_country_error_regex'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '2',
+ 'maxlength' => '2'
+ ),
+ 'ssl_domain' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'ssl_request' => array (
+ 'datatype' => 'TEXT',
+ 'formtype' => 'TEXTAREA',
+ 'default' => '',
+ 'value' => '',
+ 'cols' => '30',
+ 'rows' => '10'
+ ),
+ 'ssl_cert' => array (
+ 'datatype' => 'TEXT',
+ 'formtype' => 'TEXTAREA',
+ 'default' => '',
+ 'value' => '',
+ 'cols' => '30',
+ 'rows' => '10'
+ ),
+ 'ssl_bundle' => array (
+ 'datatype' => 'TEXT',
+ 'formtype' => 'TEXTAREA',
+ 'default' => '',
+ 'value' => '',
+ 'cols' => '30',
+ 'rows' => '10'
+ ),
+ 'ssl_action' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'SELECT',
+ 'default' => '',
+ 'value' => array('' => 'None', 'save' => 'Save Certificate', 'create' => 'Create Certificate','del' => 'Delete Certificate')
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+//* Statistics
+$form["tabs"]['stats'] = array (
+ 'title' => "Stats",
+ 'width' => 100,
+ 'template' => "templates/web_domain_stats.htm",
+ 'readonly' => false,
+ 'fields' => array (
+ ##################################
+ # Begin Datatable fields
+ ##################################
+ 'stats_password' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'PASSWORD',
+ 'encryption' => 'CRYPT',
'default' => '',
'value' => '',
'width' => '30',
@@ -211,6 +383,7 @@
'title' => "Options",
'width' => 100,
'template' => "templates/web_domain_advanced.htm",
+ 'readonly' => false,
'fields' => array (
##################################
# Begin Datatable fields
@@ -248,6 +421,36 @@
'width' => '30',
'maxlength' => '255'
),
+ 'allow_override' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
+ 'errmsg'=> 'allow_override_error_empty'),
+ ),
+ 'default' => 'All',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'php_open_basedir' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
+ 'errmsg'=> 'php_open_basedir_error_empty'),
+ ),
+ 'default' => 'All',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'apache_directives' => array (
+ 'datatype' => 'TEXT',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
##################################
# ENDE Datatable fields
##################################
--
Gitblit v1.9.1