Skip to content

Commit c4085b8

Browse files
committed
Added interface part for website backup function.
1 parent 2d6dac4 commit c4085b8

File tree

8 files changed

+144
-65
lines changed

8 files changed

+144
-65
lines changed

install/sql/ispconfig3.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,8 @@ CREATE TABLE `web_domain` (
10841084
`allow_override` varchar(255) NOT NULL default 'All',
10851085
`apache_directives` text,
10861086
`php_open_basedir` text,
1087+
`backup_interval` VARCHAR( 255 ) NOT NULL DEFAULT 'none',
1088+
`backup_copies` INT NOT NULL DEFAULT '1',
10871089
`active` enum('n','y') NOT NULL default 'y',
10881090
`traffic_quota_lock` enum('n','y') NOT NULL default 'n',
10891091
PRIMARY KEY (`domain_id`)

install/tpl/server.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ gateway=192.168.0.1
1212
hostname=server1.domain.tld
1313
nameservers=192.168.0.1,192.168.0.2
1414
loglevel=2
15+
backup_dir=/var/backup
1516

1617
[mail]
1718
module=postfix_mysql

interface/web/admin/form/server_config.tform.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,17 @@
127127
'width' => '40',
128128
'maxlength' => '255'
129129
),
130+
'backup_dir' => array (
131+
'datatype' => 'VARCHAR',
132+
'formtype' => 'TEXT',
133+
'default' => '/var/backup',
134+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
135+
'errmsg'=> 'backup_dir_error_empty'),
136+
),
137+
'value' => '',
138+
'width' => '40',
139+
'maxlength' => '255'
140+
),
130141
##################################
131142
# ENDE Datatable fields
132143
##################################

interface/web/admin/lib/lang/en_server_config.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,5 @@ $wb["awstats_conf_dir_txt"] = 'awstats conf folder';
6969
$wb["awstats_data_dir_txt"] = 'awstats data folder';
7070
$wb["awstats_pl_txt"] = 'awstats.pl script';
7171
$wb["awstats_buildstaticpages_pl_txt"] = 'awstats_buildstaticpages.pl script';
72+
$wb["backup_dir_txt"] = 'Backup directory';
7273
?>

interface/web/admin/templates/server_config_server_edit.htm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ <h2><tmpl_var name="list_head_txt"></h2>
3838
{tmpl_var name='loglevel'}
3939
</select>
4040
</div>
41+
<div class="ctrlHolder">
42+
<label for="backup_dir">{tmpl_var name='backup_dir_txt'}</label>
43+
<input name="backup_dir" id="backup_dir" value="{tmpl_var name='backup_dir'}" size="40" maxlength="255" type="text" class="textInput" />
44+
</div>
4145
</fieldset>
4246

4347
<input type="hidden" name="id" value="{tmpl_var name='id'}">

interface/web/sites/form/web_domain.tform.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@
380380
'stats_type' => array (
381381
'datatype' => 'VARCHAR',
382382
'formtype' => 'SELECT',
383-
'default' => 'y',
383+
'default' => 'webalizer',
384384
'value' => array('webalizer' => 'Webalizer', 'awstats' => 'AWStats')
385385
),
386386
##################################
@@ -389,6 +389,34 @@
389389
)
390390
);
391391

392+
//* Statistics
393+
$form["tabs"]['backup'] = array (
394+
'title' => "Backup",
395+
'width' => 100,
396+
'template' => "templates/web_domain_backup.htm",
397+
'readonly' => false,
398+
'fields' => array (
399+
##################################
400+
# Begin Datatable fields
401+
##################################
402+
'backup_interval' => array (
403+
'datatype' => 'VARCHAR',
404+
'formtype' => 'SELECT',
405+
'default' => '',
406+
'value' => array('none' => 'No backup', 'daily' => 'Daily', 'weekly' => 'Weekly', 'monthly' => 'Monthly')
407+
),
408+
'backup_copies' => array (
409+
'datatype' => 'INTEGER',
410+
'formtype' => 'SELECT',
411+
'default' => '',
412+
'value' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10')
413+
),
414+
##################################
415+
# ENDE Datatable fields
416+
##################################
417+
)
418+
);
419+
392420
if($_SESSION["s"]["user"]["typ"] == 'admin') {
393421

394422
$form["tabs"]['advanced'] = array (
Lines changed: 66 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,66 @@
1-
<?php
2-
$wb["ssl_state_txt"] = 'State';
3-
$wb["ssl_locality_txt"] = 'Locality';
4-
$wb["ssl_organisation_txt"] = 'Organisation';
5-
$wb["ssl_organisation_unit_txt"] = 'Organisation Unit';
6-
$wb["ssl_country_txt"] = 'Country';
7-
$wb["ssl_request_txt"] = 'SSL Request';
8-
$wb["ssl_cert_txt"] = 'SSL Certificate';
9-
$wb["ssl_bundle_txt"] = 'SSL Bundle';
10-
$wb["ssl_action_txt"] = 'SSL Action';
11-
$wb["ssl_domain_txt"] = 'SSL Domain';
12-
$wb["server_id_txt"] = 'Server';
13-
$wb["domain_txt"] = 'Domain';
14-
$wb["type_txt"] = 'Type';
15-
$wb["parent_domain_id_txt"] = 'Parent Website';
16-
$wb["redirect_type_txt"] = 'Redirect Type';
17-
$wb["redirect_path_txt"] = 'Redirect Path';
18-
$wb["active_txt"] = 'Active';
19-
$wb["document_root_txt"] = 'Documentroot';
20-
$wb["system_user_txt"] = 'Linux User';
21-
$wb["system_group_txt"] = 'Linux Group';
22-
$wb["ip_address_txt"] = 'IP-Address';
23-
$wb["vhost_type_txt"] = 'VHost Type';
24-
$wb["hd_quota_txt"] = 'Harddisk Quota';
25-
$wb["traffic_quota_txt"] = 'Traffic Quota';
26-
$wb["cgi_txt"] = 'CGI';
27-
$wb["ssi_txt"] = 'SSI';
28-
$wb["errordocs_txt"] = 'Own Error-Documents';
29-
$wb["subdomain_txt"] = 'Auto-Subdomain';
30-
$wb["ssl_txt"] = 'SSL';
31-
$wb["suexec_txt"] = 'SuEXEC';
32-
$wb["php_txt"] = 'PHP';
33-
$wb["client_txt"] = 'Client';
34-
$wb["limit_web_domain_txt"] = 'The max. number of web domains for your account is reached.';
35-
$wb["limit_web_aliasdomain_txt"] = 'The max. number of aliasdomains for your account is reached.';
36-
$wb["limit_web_subdomain_txt"] = 'The max. number of web subdomains for your account is reached.';
37-
$wb["apache_directives_txt"] = 'Apache directives';
38-
$wb["domain_error_empty"] = 'Domain is empty.';
39-
$wb["domain_error_unique"] = 'There is already a website or sub / aliasdomain with this domain name.';
40-
$wb["domain_error_regex"] = 'Domain name invalid.';
41-
$wb["hd_quota_error_empty"] = 'Harddisk quota is 0 or empty.';
42-
$wb["traffic_quota_error_empty"] = 'Traffic quota is empty.';
43-
$wb['error_ssl_state_empty'] = 'SSL State is empty.';
44-
$wb['error_ssl_locality_empty'] = 'SSL Locality is empty.';
45-
$wb['error_ssl_organisation_empty'] = 'SSL Organisation is empty.';
46-
$wb['error_ssl_organisation_unit_empty'] = 'SSL Organisation Unit is empty.';
47-
$wb['error_ssl_country_empty'] = 'SSL Country is empty.';
48-
$wb["client_group_id_txt"] = 'Client';
49-
$wb["stats_password_txt"] = 'Webstatistics password';
50-
$wb["allow_override_txt"] = 'Allow Override';
51-
$wb["limit_web_quota_free_txt"] = 'Max. available Harddisk Quota';
52-
$wb["ssl_state_error_regex"] = 'Invalid SSL State. Valid characters are: a-z, 0-9 and .,-_';
53-
$wb["ssl_locality_error_regex"] = 'Invalid SSL Locality. Valid characters are: a-z, 0-9 and .,-_';
54-
$wb["ssl_organisation_error_regex"] = 'Invalid SSL Organisation. Valid characters are: a-z, 0-9 and .,-_';
55-
$wb["ssl_organistaion_unit_error_regex"] = 'Invalid SSL Organisation Unit. Valid characters are: a-z, 0-9 and .,-_';
56-
$wb["ssl_country_error_regex"] = 'Invalid SSL Country. Valid characters are: A-Z';
57-
$wb["limit_traffic_quota_free_txt"] = 'Max. available Traffic Quota';
58-
$wb["redirect_error_regex"] = 'Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/';
59-
$wb["php_open_basedir_txt"] = 'PHP open_basedir';
60-
$wb["traffic_quota_exceeded_txt"] = 'Traffic quota exceeded';
61-
$wb["ruby_txt"] = 'Ruby';
62-
$wb["stats_user_txt"] = 'Webstatistics username';
63-
$wb["stats_type_txt"] = 'Webstatistics program';
64-
?>
1+
<?php
2+
$wb["backup_interval_txt"] = 'Backup interval';
3+
$wb["backup_copies_txt"] = 'Number of backup copies';
4+
$wb["ssl_state_txt"] = 'State';
5+
$wb["ssl_locality_txt"] = 'Locality';
6+
$wb["ssl_organisation_txt"] = 'Organisation';
7+
$wb["ssl_organisation_unit_txt"] = 'Organisation Unit';
8+
$wb["ssl_country_txt"] = 'Country';
9+
$wb["ssl_request_txt"] = 'SSL Request';
10+
$wb["ssl_cert_txt"] = 'SSL Certificate';
11+
$wb["ssl_bundle_txt"] = 'SSL Bundle';
12+
$wb["ssl_action_txt"] = 'SSL Action';
13+
$wb["ssl_domain_txt"] = 'SSL Domain';
14+
$wb["server_id_txt"] = 'Server';
15+
$wb["domain_txt"] = 'Domain';
16+
$wb["type_txt"] = 'Type';
17+
$wb["parent_domain_id_txt"] = 'Parent Website';
18+
$wb["redirect_type_txt"] = 'Redirect Type';
19+
$wb["redirect_path_txt"] = 'Redirect Path';
20+
$wb["active_txt"] = 'Active';
21+
$wb["document_root_txt"] = 'Documentroot';
22+
$wb["system_user_txt"] = 'Linux User';
23+
$wb["system_group_txt"] = 'Linux Group';
24+
$wb["ip_address_txt"] = 'IP-Address';
25+
$wb["vhost_type_txt"] = 'VHost Type';
26+
$wb["hd_quota_txt"] = 'Harddisk Quota';
27+
$wb["traffic_quota_txt"] = 'Traffic Quota';
28+
$wb["cgi_txt"] = 'CGI';
29+
$wb["ssi_txt"] = 'SSI';
30+
$wb["errordocs_txt"] = 'Own Error-Documents';
31+
$wb["subdomain_txt"] = 'Auto-Subdomain';
32+
$wb["ssl_txt"] = 'SSL';
33+
$wb["suexec_txt"] = 'SuEXEC';
34+
$wb["php_txt"] = 'PHP';
35+
$wb["client_txt"] = 'Client';
36+
$wb["limit_web_domain_txt"] = 'The max. number of web domains for your account is reached.';
37+
$wb["limit_web_aliasdomain_txt"] = 'The max. number of aliasdomains for your account is reached.';
38+
$wb["limit_web_subdomain_txt"] = 'The max. number of web subdomains for your account is reached.';
39+
$wb["apache_directives_txt"] = 'Apache directives';
40+
$wb["domain_error_empty"] = 'Domain is empty.';
41+
$wb["domain_error_unique"] = 'There is already a website or sub / aliasdomain with this domain name.';
42+
$wb["domain_error_regex"] = 'Domain name invalid.';
43+
$wb["hd_quota_error_empty"] = 'Harddisk quota is 0 or empty.';
44+
$wb["traffic_quota_error_empty"] = 'Traffic quota is empty.';
45+
$wb["error_ssl_state_empty"] = 'SSL State is empty.';
46+
$wb["error_ssl_locality_empty"] = 'SSL Locality is empty.';
47+
$wb["error_ssl_organisation_empty"] = 'SSL Organisation is empty.';
48+
$wb["error_ssl_organisation_unit_empty"] = 'SSL Organisation Unit is empty.';
49+
$wb["error_ssl_country_empty"] = 'SSL Country is empty.';
50+
$wb["client_group_id_txt"] = 'Client';
51+
$wb["stats_password_txt"] = 'Webstatistics password';
52+
$wb["allow_override_txt"] = 'Allow Override';
53+
$wb["limit_web_quota_free_txt"] = 'Max. available Harddisk Quota';
54+
$wb["ssl_state_error_regex"] = 'Invalid SSL State. Valid characters are: a-z, 0-9 and .,-_';
55+
$wb["ssl_locality_error_regex"] = 'Invalid SSL Locality. Valid characters are: a-z, 0-9 and .,-_';
56+
$wb["ssl_organisation_error_regex"] = 'Invalid SSL Organisation. Valid characters are: a-z, 0-9 and .,-_';
57+
$wb["ssl_organistaion_unit_error_regex"] = 'Invalid SSL Organisation Unit. Valid characters are: a-z, 0-9 and .,-_';
58+
$wb["ssl_country_error_regex"] = 'Invalid SSL Country. Valid characters are: A-Z';
59+
$wb["limit_traffic_quota_free_txt"] = 'Max. available Traffic Quota';
60+
$wb["redirect_error_regex"] = 'Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/';
61+
$wb["php_open_basedir_txt"] = 'PHP open_basedir';
62+
$wb["traffic_quota_exceeded_txt"] = 'Traffic quota exceeded';
63+
$wb["ruby_txt"] = 'Ruby';
64+
$wb["stats_user_txt"] = 'Webstatistics username';
65+
$wb["stats_type_txt"] = 'Webstatistics program';
66+
?>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<h2><tmpl_var name="list_head_txt"></h2>
2+
<p><tmpl_var name="list_desc_txt"></p>
3+
4+
<div class="panel panel_web_domain">
5+
6+
<div class="pnl_formsarea">
7+
<fieldset class="inlineLabels"><legend>Backup</legend>
8+
<div class="ctrlHolder">
9+
<label for="backup_interval">{tmpl_var name='backup_interval_txt'}</label>
10+
<select name="backup_interval" id="backup_interval" class="selectInput">
11+
{tmpl_var name='backup_interval'}
12+
</select>
13+
</div>
14+
<div class="ctrlHolder">
15+
<label for="backup_copies">{tmpl_var name='backup_copies_txt'}</label>
16+
<select name="backup_copies" id="backup_copies" class="selectInput">
17+
{tmpl_var name='backup_copies'}
18+
</select>
19+
</div>
20+
</fieldset>
21+
22+
<input type="hidden" name="id" value="{tmpl_var name='id'}">
23+
24+
<div class="buttonHolder buttons">
25+
<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>
26+
<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>
27+
</div>
28+
</div>
29+
30+
</div>

0 commit comments

Comments
 (0)