Fix backup - Exclude existing backup when path is uppercase.
This commit is contained in:
parent
ced91d049d
commit
86c46bbb97
@ -65,6 +65,7 @@ if ($action == 'delete')
|
|||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -119,7 +120,9 @@ if (in_array($type, array('pgsql'))) {
|
|||||||
print "});\n";
|
print "});\n";
|
||||||
print "</script>\n";
|
print "</script>\n";
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("Backup"), '', 'title_setup');
|
$title = $langs->trans("Backup");
|
||||||
|
|
||||||
|
print load_fiche_titre($title, '', 'title_setup');
|
||||||
//print_barre_liste($langs->trans("Backup"), '', '', '', '', '', $langs->trans("BackupDesc",DOL_DATA_ROOT), 0, 0, 'title_setup');
|
//print_barre_liste($langs->trans("Backup"), '', '', '', '', '', $langs->trans("BackupDesc",DOL_DATA_ROOT), 0, 0, 'title_setup');
|
||||||
|
|
||||||
print '<div class="center opacitymedium">';
|
print '<div class="center opacitymedium">';
|
||||||
@ -139,7 +142,9 @@ print '<br>';
|
|||||||
|
|
||||||
print '<div id="backupdatabaseleft" class="fichehalfleft" >';
|
print '<div id="backupdatabaseleft" class="fichehalfleft" >';
|
||||||
|
|
||||||
print load_fiche_titre($title ? $title : $langs->trans("BackupDumpWizard"));
|
$title = $langs->trans("BackupDumpWizard");
|
||||||
|
|
||||||
|
print load_fiche_titre($title);
|
||||||
|
|
||||||
print '<table width="100%" class="'.($useinecm ? 'nobordernopadding' : 'liste').' nohover">';
|
print '<table width="100%" class="'.($useinecm ? 'nobordernopadding' : 'liste').' nohover">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|||||||
@ -122,7 +122,7 @@ $utils = new Utils($db);
|
|||||||
// MYSQL
|
// MYSQL
|
||||||
if ($what == 'mysql')
|
if ($what == 'mysql')
|
||||||
{
|
{
|
||||||
$cmddump = GETPOST("mysqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
|
$cmddump = GETPOST("mysqldump", 'none'); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
|
||||||
$cmddump = dol_sanitizePathName($cmddump);
|
$cmddump = dol_sanitizePathName($cmddump);
|
||||||
|
|
||||||
if (!empty($dolibarr_main_restrict_os_commands))
|
if (!empty($dolibarr_main_restrict_os_commands))
|
||||||
@ -163,7 +163,7 @@ if ($what == 'mysqlnobin')
|
|||||||
// POSTGRESQL
|
// POSTGRESQL
|
||||||
if ($what == 'postgresql')
|
if ($what == 'postgresql')
|
||||||
{
|
{
|
||||||
$cmddump = GETPOST("postgresqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
|
$cmddump = GETPOST("postgresqldump", 'none'); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
|
||||||
$cmddump = dol_sanitizePathName($cmddump);
|
$cmddump = dol_sanitizePathName($cmddump);
|
||||||
|
|
||||||
/* Not required, the command is output on screen but not ran for pgsql
|
/* Not required, the command is output on screen but not ran for pgsql
|
||||||
|
|||||||
@ -113,7 +113,7 @@ $utils = new Utils($db);
|
|||||||
if ($compression == 'zip')
|
if ($compression == 'zip')
|
||||||
{
|
{
|
||||||
$file .= '.zip';
|
$file .= '.zip';
|
||||||
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.log|\/temp\/|documents\/admin\/documents\/)/');
|
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.log|\/temp\/|documents\/admin\/documents\/)/i');
|
||||||
if ($ret < 0)
|
if ($ret < 0)
|
||||||
{
|
{
|
||||||
if ($ret == -2) {
|
if ($ret == -2) {
|
||||||
|
|||||||
@ -221,25 +221,25 @@ if (!empty($_POST["DOL_AUTOSET_COOKIE"]))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Init session. Name of session is specific to Dolibarr instance.
|
// Init the 5 global objects, this include will make the 'new Xxx()' and set properties for: $conf, $db, $langs, $user, $mysoc
|
||||||
// Note: the function dol_getprefix may have been redefined to return a different key to manage another area to protect.
|
require_once 'master.inc.php';
|
||||||
$prefix = dol_getprefix('');
|
|
||||||
|
|
||||||
|
// Init session. Name of session is specific to Dolibarr instance.
|
||||||
|
// Must be done after the include of master.inc.php so $conf file is loaded and vars like $dolibarr_main_force_https are set.
|
||||||
|
// Note: the function dol_getprefix may have been redefined to return a different key to manage another area to protect.
|
||||||
|
$prefix = dol_getprefix(''); // This uses the $conf file
|
||||||
$sessionname = 'DOLSESSID_'.$prefix;
|
$sessionname = 'DOLSESSID_'.$prefix;
|
||||||
$sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix;
|
$sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix;
|
||||||
if (!empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime', $_COOKIE[$sessiontimeout]);
|
if (!empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime', $_COOKIE[$sessiontimeout]);
|
||||||
session_set_cookie_params(0, '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // Add tag secure and httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
|
session_set_cookie_params(0, '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // Add tag secure and httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
|
||||||
session_name($sessionname);
|
session_name($sessionname);
|
||||||
// This create lock, released when session_write_close() or end of page.
|
// This create lock, released by session_write_close() or end of page.
|
||||||
// We need this lock as long as we read/write $_SESSION ['vars']. We can remove lock when finished.
|
// We need this lock as long as we read/write $_SESSION ['vars']. We can remove lock when finished.
|
||||||
if (!defined('NOSESSION'))
|
if (!defined('NOSESSION'))
|
||||||
{
|
{
|
||||||
session_start();
|
session_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init the 5 global objects, this include will make the 'new Xxx()' and set properties for: $conf, $db, $langs, $user, $mysoc
|
|
||||||
require_once 'master.inc.php';
|
|
||||||
|
|
||||||
// Activate end of page function
|
// Activate end of page function
|
||||||
register_shutdown_function('dol_shutdown');
|
register_shutdown_function('dol_shutdown');
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user