diff --git a/lib/classes/api/commands/class.CustomerBackups.php b/lib/classes/api/commands/class.CustomerBackups.php index cdd02365..6a4ccfb5 100644 --- a/lib/classes/api/commands/class.CustomerBackups.php +++ b/lib/classes/api/commands/class.CustomerBackups.php @@ -73,6 +73,11 @@ class CustomerBackups extends ApiCommand implements ResourceEntity $userpath = $path; $path = makeCorrectDir($customer['documentroot'] . '/' . $path); + // path cannot be the customers docroot + if ($path == makeCorrectDir($customer['documentroot'])) { + standar_error('backupfoldercannotbedocroot', '', true); + } + if ($backup_dbs != '1') { $backup_dbs = '0'; } diff --git a/lib/formfields/customer/extras/formfield.backup.php b/lib/formfields/customer/extras/formfield.backup.php index 4a808ec0..1cc11b87 100644 --- a/lib/formfields/customer/extras/formfield.backup.php +++ b/lib/formfields/customer/extras/formfield.backup.php @@ -24,8 +24,8 @@ return array( 'image' => 'icons/backup_big.png', 'fields' => array( 'path' => array( - 'label' => $lng['panel']['path'], - 'desc' => (Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$pathSelect['value'] : ''), + 'label' => $lng['panel']['backuppath']['title'], + 'desc' => $lng['panel']['backuppath']['description'].'
'.(Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$pathSelect['value'] : ''), 'type' => $pathSelect['type'], 'select_var' => $pathSelect['value'], 'value' => $pathSelect['value'] diff --git a/lng/english.lng.php b/lng/english.lng.php index a69b82c8..a3250e0b 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -229,6 +229,7 @@ $lng['error']['destinationalreadyexistasmail'] = 'The forwarder to %s already ex $lng['error']['destinationalreadyexist'] = 'You have already defined a forwarder to "%s"'; $lng['error']['destinationiswrong'] = 'The forwarder %s contains invalid character(s) or is incomplete.'; $lng['error']['ticketnotaccessible'] = 'You cannot access this ticket.'; +$lng['error']['backupfoldercannotbedocroot'] = 'The folder for backups cannot be your homedir, please chose a folder within your homedir, e.g. /backups'; /** * Questions @@ -2129,6 +2130,8 @@ $lng['admin']['notryfiles']['title'] = 'No autogenerated try_files'; $lng['admin']['notryfiles']['description'] = 'Say yes here if you want to specify a custom try_files directive in specialsettings (needed for some wordpress plugins for example).'; $lng['serversettings']['phpfpm_settings']['override_fpmconfig'] = 'Override FPM-daemon settings (pm, max_children, etc.)'; $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'] = '
Only used if "Override FPM-daemon settings" is set to "Yes"'; +$lng['panel']['backuppath']['title'] = 'Destination path for the backup'; +$lng['panel']['backuppath']['description'] = 'This is the path where the backups will be stored. If backup of web-data is selected, all files from the homedir are stored excluding the backup-folder specified here.'; // added in froxlor 0.10.0 $lng['panel']['none_value'] = 'None'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 1648e606..751b8dc6 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -227,6 +227,7 @@ $lng['error']['destinationalreadyexistasmail'] = 'Die Weiterleitung zu "%s" exis $lng['error']['destinationalreadyexist'] = 'Es existiert bereits eine Weiterleitung nach "%s".'; $lng['error']['destinationiswrong'] = 'Die Weiterleitungsadresse "%s" enthält ungültige Zeichen oder ist nicht vollständig.'; $lng['error']['ticketnotaccessible'] = 'Sie können sich das Ticket nicht ansehen.'; +$lng['error']['backupfoldercannotbedocroot'] = 'Der Ordner für Backups darf nicht das Heimatverzeichnis sein, wähle einen Ordner unterhalb des Heimatverzeichnisses, z.B. /backups'; /** * Questions @@ -1779,6 +1780,8 @@ $lng['admin']['notryfiles']['title'] = 'Keine generierte try_files Anweisung'; $lng['admin']['notryfiles']['description'] = 'Wähle "Ja", wenn eine eigene try_files Direktive in den "eigenen Vhost Einstellungen" angegeben werden soll (z.B. nötig für manche Wordpress Plugins).'; $lng['serversettings']['phpfpm_settings']['override_fpmconfig'] = 'Überschreibe FPM-Daemon Einstellungen (pm, max_children, etc.)'; $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'] = '
Nur verwendet wenn "Überschreibe FPM-Daemon Einstellungen" auf "Ja" gestellt ist'; +$lng['panel']['backuppath']['title'] = 'Pfad zur Ablage der Backups'; +$lng['panel']['backuppath']['description'] = 'In diesem Ordner werden die Backups abgelegt. Wenn das Sichern von Web-Daten aktiviert ist, werden alle Dateien aus dem Heimatverzeichnis gesichert, exklusive des hier angegebenen Backup-Ordners.'; // added in froxlor 0.10.0 $lng['panel']['none_value'] = 'Keine'; diff --git a/scripts/jobs/cron_backup.php b/scripts/jobs/cron_backup.php index 131a2004..87f866fa 100644 --- a/scripts/jobs/cron_backup.php +++ b/scripts/jobs/cron_backup.php @@ -91,6 +91,7 @@ foreach ($all_jobs as $row) { $row['data']['destdir'] = makeCorrectDir($row['data']['destdir']); $customerdocroot = makeCorrectDir(Settings::Get('system.documentroot_prefix').'/'.$row['data']['loginname'].'/'); + // create folder if not exists if (!file_exists($row['data']['destdir']) && $row['data']['destdir'] != '/' && $row['data']['destdir'] != Settings::Get('system.documentroot_prefix')