clearify description and enhance validation for path-field in backup-job-planning
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -579,6 +579,11 @@ if ($page == 'overview') {
|
||||
$path = makeCorrectDir(validate($_POST['path'], 'path'));
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
|
||||
// path cannot be the customers docroot
|
||||
if ($path == makeCorrectDir($userinfo['documentroot'])) {
|
||||
standar_error('backupfoldercannotbedocroot');
|
||||
}
|
||||
|
||||
$backup_dbs = isset($_POST['backup_dbs']) ? intval($_POST['backup_dbs']) : 0;
|
||||
$backup_mail = isset($_POST['backup_mail']) ? intval($_POST['backup_mail']) : 0;
|
||||
$backup_web = isset($_POST['backup_web']) ? intval($_POST['backup_web']) : 0;
|
||||
|
||||
@@ -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']) ? '<br />'.$pathSelect['value'] : ''),
|
||||
'label' => $lng['panel']['backuppath']['title'],
|
||||
'desc' => $lng['panel']['backuppath']['description'].'<br>'.(Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''),
|
||||
'type' => $pathSelect['type'],
|
||||
'select_var' => $pathSelect['value'],
|
||||
'value' => $pathSelect['value']
|
||||
|
||||
@@ -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
|
||||
@@ -2127,3 +2128,5 @@ $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'] = '<br /><span class="red">Only used if "Override FPM-daemon settings" is set to "Yes"</span>';
|
||||
$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.';
|
||||
|
||||
@@ -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
|
||||
@@ -1777,3 +1778,5 @@ $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'] = '<br /><span class="red">Nur verwendet wenn "Überschreibe FPM-Daemon Einstellungen" auf "Ja" gestellt ist</span>';
|
||||
$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.';
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user