rename SQLite database on profile rename

This commit is contained in:
Roland Gruber 2016-03-28 09:25:21 +02:00
parent e8760f2541
commit 25f546e100
1 changed files with 4 additions and 1 deletions

View File

@ -80,7 +80,10 @@ if (isset($_POST['action'])) {
// rename pdf and profiles folder
rename("../../config/profiles/" . $_POST['oldfilename'], "../../config/profiles/" . $_POST['renfilename']);
rename("../../config/pdf/" . $_POST['oldfilename'], "../../config/pdf/" . $_POST['renfilename']);
// rename sqlite database if any
if (file_exists("../../config/" . $_POST['oldfilename'] . ".sqlite")) {
rename("../../config/" . $_POST['oldfilename'] . ".sqlite", "../../config/" . $_POST['renfilename'] . ".sqlite");
}
$msg = _("Renamed profile.");
}
else $error = _("Could not rename file!");