seeddms-code/op/op.CreateDump.php

51 lines
1.8 KiB
PHP
Raw Normal View History

2012-07-06 10:03:25 +00:00
<?php
// MyDMS. Document Management System
// Copyright (C) 2010 Matteo Lucarelli
2016-08-09 05:34:30 +00:00
// Copyright (C) 2010-2016 Uwe Steinmann
2012-07-06 10:03:25 +00:00
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Version.php");
2012-07-06 10:03:25 +00:00
include("../inc/inc.Settings.php");
include("../inc/inc.LogInit.php");
include("../inc/inc.Language.php");
include("../inc/inc.Init.php");
include("../inc/inc.Extension.php");
2010-10-29 13:19:51 +00:00
include("../inc/inc.DBInit.php");
2012-07-06 10:03:25 +00:00
include("../inc/inc.ClassUI.php");
2010-10-29 13:19:51 +00:00
include("../inc/inc.Authentication.php");
if (!$user->isAdmin()) {
2012-07-06 10:03:25 +00:00
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
2010-10-29 13:19:51 +00:00
}
2019-09-06 12:32:14 +00:00
if (!$settings->_backupDir) {
UI::exitError(getMLText("admin_tools"),getMLText("no_backup_dir"));
}
2010-10-29 13:19:51 +00:00
$v = new SeedDMS_Version;
2019-09-06 12:32:14 +00:00
$dump_name = addDirSep($settings->_backupDir).date('Y-m-d\TH-i-s')."_".$v->_number.".sql";
2015-12-09 17:24:51 +00:00
if(!$dms->createDump($dump_name))
2010-10-29 13:19:51 +00:00
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
if (SeedDMS_Core_File::gzcompressfile($dump_name,9)) unlink($dump_name);
2010-10-29 13:19:51 +00:00
else UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
add_log_line();
2012-07-06 10:03:25 +00:00
header("Location:../out/out.BackupTools.php");
?>