Commit 82cf1e84 authored by Marius Cramer's avatar Marius Cramer
Browse files

Merge branch 'renky/ispconfig3-master'

Conflicts:
	interface/web/mail/templates/mail_user_backup_list.htm
parents f3f4aa5c f42d9169
......@@ -32,3 +32,5 @@ NS|{DOMAIN}.|{NS2}.|0|3600
MX|{DOMAIN}.|mail.{DOMAIN}.|10|3600
TXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600' WHERE `dns_template`.`template_id` = 1;
ALTER TABLE `mail_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT '';
ALTER TABLE `web_backup` CHANGE `filesize` `filesize` VARCHAR(20) NOT NULL DEFAULT '';
......@@ -703,7 +703,7 @@ CREATE TABLE `mail_backup` (
`backup_mode` varchar(64) NOT NULL DEFAULT '',
`tstamp` int(10) unsigned NOT NULL DEFAULT '0',
`filename` varchar(255) NOT NULL DEFAULT '',
`filesize` VARCHAR(10) NOT NULL DEFAULT '',
`filesize` VARCHAR(20) NOT NULL DEFAULT '',
PRIMARY KEY (`backup_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
......@@ -1746,7 +1746,7 @@ CREATE TABLE `web_backup` (
`backup_mode` varchar(64) NOT NULL DEFAULT '',
`tstamp` int(10) unsigned NOT NULL DEFAULT '0',
`filename` varchar(255) NOT NULL DEFAULT '',
`filesize` VARCHAR(10) NOT NULL DEFAULT '',
`filesize` VARCHAR(20) NOT NULL DEFAULT '',
PRIMARY KEY (`backup_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
......
......@@ -23,9 +23,13 @@ webdavuser_prefix=[CLIENTNAME]
dblist_phpmyadmin_link=y
phpmyadmin_url=/phpmyadmin
webftp_url=
vhost_subdomains=n
vhost_aliasdomains=n
client_username_web_check_disabled=n
backups_include_into_web_quota=n
reseller_can_use_options=n
[tools]
[domains]
......
......@@ -39,6 +39,9 @@ class plugin_backuplist_mail extends plugin_base {
function onShow() {
global $app;
$app->uses('functions');
$listTpl = new tpl;
$listTpl->newTemplate('templates/mail_user_backup_list.htm');
......@@ -53,7 +56,7 @@ class plugin_backuplist_mail extends plugin_base {
if(isset($_GET['backup_action'])) {
$backup_id = $app->functions->intval($_GET['backup_id']);
/*
if($_GET['backup_action'] == 'download' && $backup_id > 0) {
if($_GET['backup_action'] == 'download_mail' && $backup_id > 0) {
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_download' AND action_param = '$backup_id'";
$tmp = $app->db->queryOneRecord($sql);
if($tmp['number'] == 0) {
......@@ -73,8 +76,8 @@ class plugin_backuplist_mail extends plugin_base {
}
}
*/
if($_GET['backup_action'] == 'restore' && $backup_id > 0) {
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_restore' AND action_param = '$backup_id'";
if($_GET['backup_action'] == 'restore_mail' && $backup_id > 0) {
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = 'backup_restore_mail' AND action_param = '$backup_id'";
$tmp = $app->db->queryOneRecord($sql);
if($tmp['number'] == 0) {
$message .= $wb['restore_info_txt'];
......@@ -82,7 +85,7 @@ class plugin_backuplist_mail extends plugin_base {
"VALUES (".
(int)$this->form->dataRecord['server_id'] . ", " .
time() . ", " .
"'backup_restore', " .
"'backup_restore_mail', " .
"'".$backup_id."', " .
"'pending', " .
"''" .
......@@ -105,6 +108,7 @@ class plugin_backuplist_mail extends plugin_base {
$rec["bgcolor"] = $bgcolor;
$rec['date'] = date($app->lng('conf_format_datetime'),$rec['tstamp']);
$rec['backup_type'] = $wb[('backup_type_'.$rec['backup_type'])];
$rec['filesize'] = $app->functions->formatBytes($rec['filesize']);
$records_new[] = $rec;
}
}
......
......@@ -309,6 +309,71 @@ class remoting_mail extends remoting {
// $app->plugin->raiseEvent('mail:mail_user_filter:on_after_delete',$this);
return $affected_rows;
}
// Mail backup list function by Dominik Müller, info@profi-webdesign.net
public function mail_user_backup_list($session_id, $primary_id = null)
{
global $app;
if(!$this->checkPerm($session_id, 'mail_user_backup')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
if ($site_id != null) {
$sql = "SELECT * FROM mail_backup WHERE parent_domain_id = ".$app->functions->intval($site_id);
}
else {
$sql = "SELECT * FROM mail_backup";
}
$result = $app->db->queryAllRecords($sql);
return $result;
}
// Mail backup restore/download functions by Dominik Müller, info@profi-webdesign.net
public function mail_user_backup($session_id, $primary_id, $action_type)
{
global $app;
if(!$this->checkPerm($session_id, 'mail_user_backup')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
//*Set variables
$backup_record = $app->db->queryOneRecord("SELECT * FROM `mail_backup` WHERE `backup_id`='$primary_id'");
$server_id = $backup_record['server_id'];
//*Set default action state
$action_state = "pending";
$tstamp = time();
//* Basic validation of variables
if ($server_id <= 0) {
$this->server->fault('invalid_backup_id', "Invalid or non existant backup_id $primary_id");
return false;
}
if (/*$action_type != 'backup_download_mail' and*/ $action_type != 'backup_restore_mail') {
$this->server->fault('invalid_action', "Invalid action_type $action_type");
return false;
}
//* Validate instance
$instance_record = $app->db->queryOneRecord("SELECT * FROM `sys_remoteaction` WHERE `action_param`='$primary_id' and `action_type`='$action_type' and `action_state`='pending'");
if ($instance_record['action_id'] >= 1) {
$this->server->fault('duplicate_action', "There is already a pending $action_type action");
return false;
}
//* Save the record
if ($app->db->query("INSERT INTO `sys_remoteaction` SET `server_id` = '$server_id', `tstamp` = '$tstamp', `action_type` = '$action_type', `action_param` = '$primary_id', `action_state` = '$action_state'")) {
return true;
} else {
return false;
}
}
//* Get alias details
public function mail_alias_get($session_id, $primary_id)
......
......@@ -166,6 +166,12 @@ $form["tabs"]['sites'] = array (
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'backups_include_into_web_quota' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'reseller_can_use_options' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
......
......@@ -48,6 +48,7 @@ $wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
$wb['f5_to_reload_js_txt'] = 'If you change this, you might have to press F5 to make the browser reload JavaScript libraries or empty your browser cache.';
$wb['client_username_web_check_disabled_txt'] = 'Disable client username check for the word \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show autoresponder tab in mail account details';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details';
......
......@@ -48,6 +48,7 @@ $wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
$wb['f5_to_reload_js_txt'] = 'If you change this, you might have to press F5 to make the browser reload JavaScript libraries or empty your browser cache.';
$wb['client_username_web_check_disabled_txt'] = 'Disable client username check for the word \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show autoresponder tab in mail account details';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details';
......
......@@ -48,6 +48,7 @@ $wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
$wb['f5_to_reload_js_txt'] = 'If you change this, you might have to press F5 to make the browser reload JavaScript libraries or empty your browser cache.';
$wb['client_username_web_check_disabled_txt'] = 'Disable client username check for the word \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show autoresponder tab in mail account details';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details';
......
......@@ -48,6 +48,7 @@ $wb['use_combobox_txt'] = 'Použití jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Použití indikátoru zatížení';
$wb['f5_to_reload_js_txt'] = 'Pokud vypnete tuto volbu, zřejmě budete muset používat klávesu F5, aby internetový prohlížeč znovu načetl JavaScript knihovny nebo budete muset ručně vyprázdňovat mezipaměť (cache) vašeho internetového prohlížeče.';
$wb['client_username_web_check_disabled_txt'] = 'Disable client username check for the word \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show Autoresponder tab in Mailbox detail';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show Mail Filter tab in Mailbox detail';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show Custom Rules tab in Mailbox detail';
......
......@@ -48,6 +48,7 @@ $wb['use_loadindicator_txt'] = 'Laden Grafik anzeigen';
$wb['f5_to_reload_js_txt'] = 'Wenn Sie den Wert ändern, müssen Sie F5 drücken, damit der Browser die JavaScript Bibliotheken neu lädt, oder Ihren Browser Cache leeren.';
$wb['phpmyadmin_url_error_regex'] = 'Falsche phpMyAdmin URL';
$wb['client_username_web_check_disabled_txt'] = 'Deaktiviere die Kunden Benutzernamen Überprüfung für den Begriff <b>web<b>.';
$wb['backups_include_into_web_quota_txt'] = 'Backups in Web Quota hinzuzählen.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Zeige Autoresponder Reiter in E-Mail Kontodetails';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Zeige E-Mail Filter Reiter in E-Mail Kontodetails';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Zeige Benutzerregel Reiter in E-Mail Kontodetails';
......
......@@ -48,6 +48,7 @@ $wb['use_combobox_txt'] = 'Χρήση jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Χρήση Load Indicator (ενδεικτή φόρτωσης)';
$wb['f5_to_reload_js_txt'] = 'Αν το αλλάξετε, ίσως πρέπει να πατήσετε το F5 για να κάνετε τον φυλλομετρητη να ξαναφορτώσει τις βιβλιοθήκες JavaScript ή να αδείασετε την cache του φυλλομετρητή.';
$wb['client_username_web_check_disabled_txt'] = 'Απενεργοποίηση ελέγχου στο όνομα χρήστη για την λέξη \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Εμφάνιση της καρτέλας Αυτόματης Απάντησης στις λεπτομέρειες του λογαριασμού mail';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Εμφάνιση της καρτέλας Φίλτρα mail στις λεπτομέρειες του λογαριασμού mail';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Εμφάνιση της καρτέλας Προσαρμοσμένοι Κανόνες στις λεπτομέρειες του λογαριασμού mail';
......
......@@ -51,6 +51,7 @@ $wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
$wb['f5_to_reload_js_txt'] = 'If you change this, you might have to press F5 to make the browser reload JavaScript libraries or empty your browser cache.';
$wb['client_username_web_check_disabled_txt'] = 'Disable client username check for the word \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show autoresponder tab in mail account details';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details';
......
......@@ -46,6 +46,7 @@ $wb['use_combobox_txt'] = 'Usar Combobox de jQuery UI';
$wb['use_loadindicator_txt'] = 'Usar indicador de carga';
$wb['f5_to_reload_js_txt'] = 'Si cambias esto, podrías tener que pulsar F5 para que tu navegador recargue las librerías JavaScript o vacíar la caché del navegador.';
$wb['client_username_web_check_disabled_txt'] = "Desactivar comprobación de la palabra 'web' en el nombre de cliente.";
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Mostrar pestaña autoresponder en los detalles de la cuenta de correo';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Mostrar pestaña filtro de correo en los detalles de la cuenta de correo';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Mostrar pestaña filtros personalizados en los detalles de la cuenta de correo';
......
......@@ -48,6 +48,7 @@ $wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
$wb['f5_to_reload_js_txt'] = 'If you change this, you might have to press F5 to make the browser reload JavaScript libraries or empty your browser cache.';
$wb['client_username_web_check_disabled_txt'] = 'Disable client username check for the word \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show autoresponder tab in mail account details';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details';
......
......@@ -48,6 +48,7 @@ $wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
$wb['f5_to_reload_js_txt'] = 'If you change this, you might have to press F5 to make the browser reload JavaScript libraries or empty your browser cache.';
$wb['client_username_web_check_disabled_txt'] = 'Disable client username check for the word \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show autoresponder tab in mail account details';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details';
......
......@@ -48,6 +48,7 @@ $wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
$wb['f5_to_reload_js_txt'] = 'If you change this, you might have to press F5 to make the browser reload JavaScript libraries or empty your browser cache.';
$wb['client_username_web_check_disabled_txt'] = 'Disable client username check for the word \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show autoresponder tab in mail account details';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details';
......
......@@ -48,6 +48,7 @@ $wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
$wb['f5_to_reload_js_txt'] = 'If you change this, you might have to press F5 to make the browser reload JavaScript libraries or empty your browser cache.';
$wb['client_username_web_check_disabled_txt'] = 'Disable client username check for the word \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show autoresponder tab in mail account details';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details';
......
......@@ -48,6 +48,7 @@ $wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
$wb['f5_to_reload_js_txt'] = 'If you change this, you might have to press F5 to make the browser reload JavaScript libraries or empty your browser cache.';
$wb['client_username_web_check_disabled_txt'] = 'Disable client username check for the word \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show autoresponder tab in mail account details';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details';
......
......@@ -48,6 +48,7 @@ $wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
$wb['f5_to_reload_js_txt'] = 'If you change this, you might have to press F5 to make the browser reload JavaScript libraries or empty your browser cache.';
$wb['client_username_web_check_disabled_txt'] = 'Disable client username check for the word \'web\'.';
$wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota.';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show autoresponder tab in mail account details';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment