From c4085b8b99bf48c1950bab49bcb6a202ef4dec52 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 30 Jun 2010 10:30:04 -0400
Subject: [PATCH] Added interface part for website backup function.
---
install/sql/ispconfig3.sql | 2
interface/web/sites/templates/web_domain_backup.htm | 30 +++++++
interface/web/sites/lib/lang/en_web_domain.lng | 130 ++++++++++++++++----------------
interface/web/admin/lib/lang/en_server_config.lng | 1
install/tpl/server.ini.master | 1
interface/web/admin/form/server_config.tform.php | 11 ++
interface/web/admin/templates/server_config_server_edit.htm | 4 +
interface/web/sites/form/web_domain.tform.php | 30 +++++++
8 files changed, 144 insertions(+), 65 deletions(-)
diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql
index 2c0caf2..2a88003 100644
--- a/install/sql/ispconfig3.sql
+++ b/install/sql/ispconfig3.sql
@@ -1084,6 +1084,8 @@
`allow_override` varchar(255) NOT NULL default 'All',
`apache_directives` text,
`php_open_basedir` text,
+ `backup_interval` VARCHAR( 255 ) NOT NULL DEFAULT 'none',
+ `backup_copies` INT NOT NULL DEFAULT '1',
`active` enum('n','y') NOT NULL default 'y',
`traffic_quota_lock` enum('n','y') NOT NULL default 'n',
PRIMARY KEY (`domain_id`)
diff --git a/install/tpl/server.ini.master b/install/tpl/server.ini.master
index cfddc49..d5584ba 100644
--- a/install/tpl/server.ini.master
+++ b/install/tpl/server.ini.master
@@ -12,6 +12,7 @@
hostname=server1.domain.tld
nameservers=192.168.0.1,192.168.0.2
loglevel=2
+backup_dir=/var/backup
[mail]
module=postfix_mysql
diff --git a/interface/web/admin/form/server_config.tform.php b/interface/web/admin/form/server_config.tform.php
index 5ebb88d..cf43c9a 100644
--- a/interface/web/admin/form/server_config.tform.php
+++ b/interface/web/admin/form/server_config.tform.php
@@ -127,6 +127,17 @@
'width' => '40',
'maxlength' => '255'
),
+ 'backup_dir' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '/var/backup',
+ 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
+ 'errmsg'=> 'backup_dir_error_empty'),
+ ),
+ 'value' => '',
+ 'width' => '40',
+ 'maxlength' => '255'
+ ),
##################################
# ENDE Datatable fields
##################################
diff --git a/interface/web/admin/lib/lang/en_server_config.lng b/interface/web/admin/lib/lang/en_server_config.lng
index 761150a..af703c4 100644
--- a/interface/web/admin/lib/lang/en_server_config.lng
+++ b/interface/web/admin/lib/lang/en_server_config.lng
@@ -69,4 +69,5 @@
$wb["awstats_data_dir_txt"] = 'awstats data folder';
$wb["awstats_pl_txt"] = 'awstats.pl script';
$wb["awstats_buildstaticpages_pl_txt"] = 'awstats_buildstaticpages.pl script';
+$wb["backup_dir_txt"] = 'Backup directory';
?>
\ No newline at end of file
diff --git a/interface/web/admin/templates/server_config_server_edit.htm b/interface/web/admin/templates/server_config_server_edit.htm
index 96204c7..bbe4a4c 100644
--- a/interface/web/admin/templates/server_config_server_edit.htm
+++ b/interface/web/admin/templates/server_config_server_edit.htm
@@ -38,6 +38,10 @@
{tmpl_var name='loglevel'}
</select>
</div>
+ <div class="ctrlHolder">
+ <label for="backup_dir">{tmpl_var name='backup_dir_txt'}</label>
+ <input name="backup_dir" id="backup_dir" value="{tmpl_var name='backup_dir'}" size="40" maxlength="255" type="text" class="textInput" />
+ </div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
diff --git a/interface/web/sites/form/web_domain.tform.php b/interface/web/sites/form/web_domain.tform.php
index 2c3d80e..8dc0b16 100644
--- a/interface/web/sites/form/web_domain.tform.php
+++ b/interface/web/sites/form/web_domain.tform.php
@@ -380,7 +380,7 @@
'stats_type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
- 'default' => 'y',
+ 'default' => 'webalizer',
'value' => array('webalizer' => 'Webalizer', 'awstats' => 'AWStats')
),
##################################
@@ -389,6 +389,34 @@
)
);
+//* Statistics
+$form["tabs"]['backup'] = array (
+ 'title' => "Backup",
+ 'width' => 100,
+ 'template' => "templates/web_domain_backup.htm",
+ 'readonly' => false,
+ 'fields' => array (
+ ##################################
+ # Begin Datatable fields
+ ##################################
+ 'backup_interval' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'SELECT',
+ 'default' => '',
+ 'value' => array('none' => 'No backup', 'daily' => 'Daily', 'weekly' => 'Weekly', 'monthly' => 'Monthly')
+ ),
+ 'backup_copies' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'SELECT',
+ 'default' => '',
+ 'value' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10')
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
if($_SESSION["s"]["user"]["typ"] == 'admin') {
$form["tabs"]['advanced'] = array (
diff --git a/interface/web/sites/lib/lang/en_web_domain.lng b/interface/web/sites/lib/lang/en_web_domain.lng
index bdf46fa..d20f1b9 100644
--- a/interface/web/sites/lib/lang/en_web_domain.lng
+++ b/interface/web/sites/lib/lang/en_web_domain.lng
@@ -1,64 +1,66 @@
-<?php
-$wb["ssl_state_txt"] = 'State';
-$wb["ssl_locality_txt"] = 'Locality';
-$wb["ssl_organisation_txt"] = 'Organisation';
-$wb["ssl_organisation_unit_txt"] = 'Organisation Unit';
-$wb["ssl_country_txt"] = 'Country';
-$wb["ssl_request_txt"] = 'SSL Request';
-$wb["ssl_cert_txt"] = 'SSL Certificate';
-$wb["ssl_bundle_txt"] = 'SSL Bundle';
-$wb["ssl_action_txt"] = 'SSL Action';
-$wb["ssl_domain_txt"] = 'SSL Domain';
-$wb["server_id_txt"] = 'Server';
-$wb["domain_txt"] = 'Domain';
-$wb["type_txt"] = 'Type';
-$wb["parent_domain_id_txt"] = 'Parent Website';
-$wb["redirect_type_txt"] = 'Redirect Type';
-$wb["redirect_path_txt"] = 'Redirect Path';
-$wb["active_txt"] = 'Active';
-$wb["document_root_txt"] = 'Documentroot';
-$wb["system_user_txt"] = 'Linux User';
-$wb["system_group_txt"] = 'Linux Group';
-$wb["ip_address_txt"] = 'IP-Address';
-$wb["vhost_type_txt"] = 'VHost Type';
-$wb["hd_quota_txt"] = 'Harddisk Quota';
-$wb["traffic_quota_txt"] = 'Traffic Quota';
-$wb["cgi_txt"] = 'CGI';
-$wb["ssi_txt"] = 'SSI';
-$wb["errordocs_txt"] = 'Own Error-Documents';
-$wb["subdomain_txt"] = 'Auto-Subdomain';
-$wb["ssl_txt"] = 'SSL';
-$wb["suexec_txt"] = 'SuEXEC';
-$wb["php_txt"] = 'PHP';
-$wb["client_txt"] = 'Client';
-$wb["limit_web_domain_txt"] = 'The max. number of web domains for your account is reached.';
-$wb["limit_web_aliasdomain_txt"] = 'The max. number of aliasdomains for your account is reached.';
-$wb["limit_web_subdomain_txt"] = 'The max. number of web subdomains for your account is reached.';
-$wb["apache_directives_txt"] = 'Apache directives';
-$wb["domain_error_empty"] = 'Domain is empty.';
-$wb["domain_error_unique"] = 'There is already a website or sub / aliasdomain with this domain name.';
-$wb["domain_error_regex"] = 'Domain name invalid.';
-$wb["hd_quota_error_empty"] = 'Harddisk quota is 0 or empty.';
-$wb["traffic_quota_error_empty"] = 'Traffic quota is empty.';
-$wb['error_ssl_state_empty'] = 'SSL State is empty.';
-$wb['error_ssl_locality_empty'] = 'SSL Locality is empty.';
-$wb['error_ssl_organisation_empty'] = 'SSL Organisation is empty.';
-$wb['error_ssl_organisation_unit_empty'] = 'SSL Organisation Unit is empty.';
-$wb['error_ssl_country_empty'] = 'SSL Country is empty.';
-$wb["client_group_id_txt"] = 'Client';
-$wb["stats_password_txt"] = 'Webstatistics password';
-$wb["allow_override_txt"] = 'Allow Override';
-$wb["limit_web_quota_free_txt"] = 'Max. available Harddisk Quota';
-$wb["ssl_state_error_regex"] = 'Invalid SSL State. Valid characters are: a-z, 0-9 and .,-_';
-$wb["ssl_locality_error_regex"] = 'Invalid SSL Locality. Valid characters are: a-z, 0-9 and .,-_';
-$wb["ssl_organisation_error_regex"] = 'Invalid SSL Organisation. Valid characters are: a-z, 0-9 and .,-_';
-$wb["ssl_organistaion_unit_error_regex"] = 'Invalid SSL Organisation Unit. Valid characters are: a-z, 0-9 and .,-_';
-$wb["ssl_country_error_regex"] = 'Invalid SSL Country. Valid characters are: A-Z';
-$wb["limit_traffic_quota_free_txt"] = 'Max. available Traffic Quota';
-$wb["redirect_error_regex"] = 'Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/';
-$wb["php_open_basedir_txt"] = 'PHP open_basedir';
-$wb["traffic_quota_exceeded_txt"] = 'Traffic quota exceeded';
-$wb["ruby_txt"] = 'Ruby';
-$wb["stats_user_txt"] = 'Webstatistics username';
-$wb["stats_type_txt"] = 'Webstatistics program';
-?>
+<?php
+$wb["backup_interval_txt"] = 'Backup interval';
+$wb["backup_copies_txt"] = 'Number of backup copies';
+$wb["ssl_state_txt"] = 'State';
+$wb["ssl_locality_txt"] = 'Locality';
+$wb["ssl_organisation_txt"] = 'Organisation';
+$wb["ssl_organisation_unit_txt"] = 'Organisation Unit';
+$wb["ssl_country_txt"] = 'Country';
+$wb["ssl_request_txt"] = 'SSL Request';
+$wb["ssl_cert_txt"] = 'SSL Certificate';
+$wb["ssl_bundle_txt"] = 'SSL Bundle';
+$wb["ssl_action_txt"] = 'SSL Action';
+$wb["ssl_domain_txt"] = 'SSL Domain';
+$wb["server_id_txt"] = 'Server';
+$wb["domain_txt"] = 'Domain';
+$wb["type_txt"] = 'Type';
+$wb["parent_domain_id_txt"] = 'Parent Website';
+$wb["redirect_type_txt"] = 'Redirect Type';
+$wb["redirect_path_txt"] = 'Redirect Path';
+$wb["active_txt"] = 'Active';
+$wb["document_root_txt"] = 'Documentroot';
+$wb["system_user_txt"] = 'Linux User';
+$wb["system_group_txt"] = 'Linux Group';
+$wb["ip_address_txt"] = 'IP-Address';
+$wb["vhost_type_txt"] = 'VHost Type';
+$wb["hd_quota_txt"] = 'Harddisk Quota';
+$wb["traffic_quota_txt"] = 'Traffic Quota';
+$wb["cgi_txt"] = 'CGI';
+$wb["ssi_txt"] = 'SSI';
+$wb["errordocs_txt"] = 'Own Error-Documents';
+$wb["subdomain_txt"] = 'Auto-Subdomain';
+$wb["ssl_txt"] = 'SSL';
+$wb["suexec_txt"] = 'SuEXEC';
+$wb["php_txt"] = 'PHP';
+$wb["client_txt"] = 'Client';
+$wb["limit_web_domain_txt"] = 'The max. number of web domains for your account is reached.';
+$wb["limit_web_aliasdomain_txt"] = 'The max. number of aliasdomains for your account is reached.';
+$wb["limit_web_subdomain_txt"] = 'The max. number of web subdomains for your account is reached.';
+$wb["apache_directives_txt"] = 'Apache directives';
+$wb["domain_error_empty"] = 'Domain is empty.';
+$wb["domain_error_unique"] = 'There is already a website or sub / aliasdomain with this domain name.';
+$wb["domain_error_regex"] = 'Domain name invalid.';
+$wb["hd_quota_error_empty"] = 'Harddisk quota is 0 or empty.';
+$wb["traffic_quota_error_empty"] = 'Traffic quota is empty.';
+$wb["error_ssl_state_empty"] = 'SSL State is empty.';
+$wb["error_ssl_locality_empty"] = 'SSL Locality is empty.';
+$wb["error_ssl_organisation_empty"] = 'SSL Organisation is empty.';
+$wb["error_ssl_organisation_unit_empty"] = 'SSL Organisation Unit is empty.';
+$wb["error_ssl_country_empty"] = 'SSL Country is empty.';
+$wb["client_group_id_txt"] = 'Client';
+$wb["stats_password_txt"] = 'Webstatistics password';
+$wb["allow_override_txt"] = 'Allow Override';
+$wb["limit_web_quota_free_txt"] = 'Max. available Harddisk Quota';
+$wb["ssl_state_error_regex"] = 'Invalid SSL State. Valid characters are: a-z, 0-9 and .,-_';
+$wb["ssl_locality_error_regex"] = 'Invalid SSL Locality. Valid characters are: a-z, 0-9 and .,-_';
+$wb["ssl_organisation_error_regex"] = 'Invalid SSL Organisation. Valid characters are: a-z, 0-9 and .,-_';
+$wb["ssl_organistaion_unit_error_regex"] = 'Invalid SSL Organisation Unit. Valid characters are: a-z, 0-9 and .,-_';
+$wb["ssl_country_error_regex"] = 'Invalid SSL Country. Valid characters are: A-Z';
+$wb["limit_traffic_quota_free_txt"] = 'Max. available Traffic Quota';
+$wb["redirect_error_regex"] = 'Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/';
+$wb["php_open_basedir_txt"] = 'PHP open_basedir';
+$wb["traffic_quota_exceeded_txt"] = 'Traffic quota exceeded';
+$wb["ruby_txt"] = 'Ruby';
+$wb["stats_user_txt"] = 'Webstatistics username';
+$wb["stats_type_txt"] = 'Webstatistics program';
+?>
\ No newline at end of file
diff --git a/interface/web/sites/templates/web_domain_backup.htm b/interface/web/sites/templates/web_domain_backup.htm
new file mode 100644
index 0000000..6b8c627
--- /dev/null
+++ b/interface/web/sites/templates/web_domain_backup.htm
@@ -0,0 +1,30 @@
+<h2><tmpl_var name="list_head_txt"></h2>
+<p><tmpl_var name="list_desc_txt"></p>
+
+<div class="panel panel_web_domain">
+
+ <div class="pnl_formsarea">
+ <fieldset class="inlineLabels"><legend>Backup</legend>
+ <div class="ctrlHolder">
+ <label for="backup_interval">{tmpl_var name='backup_interval_txt'}</label>
+ <select name="backup_interval" id="backup_interval" class="selectInput">
+ {tmpl_var name='backup_interval'}
+ </select>
+ </div>
+ <div class="ctrlHolder">
+ <label for="backup_copies">{tmpl_var name='backup_copies_txt'}</label>
+ <select name="backup_copies" id="backup_copies" class="selectInput">
+ {tmpl_var name='backup_copies'}
+ </select>
+ </div>
+ </fieldset>
+
+ <input type="hidden" name="id" value="{tmpl_var name='id'}">
+
+ <div class="buttonHolder buttons">
+ <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_domain_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
+ <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
+ </div>
+ </div>
+
+</div>
--
Gitblit v1.9.1