migrate old image + fix versioning
This commit is contained in:
@@ -826,12 +826,39 @@ if (\Froxlor\Froxlor::isDatabaseVersion('202106160')) {
|
|||||||
\Froxlor\Froxlor::updateToDbVersion('202106270');
|
\Froxlor\Froxlor::updateToDbVersion('202106270');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (\Froxlor\Froxlor::isDatabaseVersion('202107070')) {
|
if (\Froxlor\Froxlor::isDatabaseVersion('202106270')) {
|
||||||
|
|
||||||
showUpdateStep("Adding custom logo image settings", true);
|
showUpdateStep("Adding custom logo image settings", true);
|
||||||
Settings::AddNew("panel.logo_image_header", '');
|
Settings::AddNew("panel.logo_image_header", '');
|
||||||
Settings::AddNew("panel.logo_image_login", '');
|
Settings::AddNew("panel.logo_image_login", '');
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
// Migrating old custom logo over, if exists
|
||||||
|
$custom_logo_file_old = \Froxlor\Froxlor::getInstallDir() . '/templates/Sparkle/assets/img/logo_custom.png';
|
||||||
|
if (file_exists($custom_logo_file_old)) {
|
||||||
|
showUpdateStep("Migrating existing custom logo to new settings", true);
|
||||||
|
|
||||||
|
$path = \Froxlor\Froxlor::getInstallDir().'/img/';
|
||||||
|
if (!is_dir($path) && !mkdir($path, 0775)) {
|
||||||
|
throw new \Exception("img directory does not exist and cannot be created");
|
||||||
|
}
|
||||||
|
if (!is_writable($path)) {
|
||||||
|
if (!chmod($path, '0775')) {
|
||||||
|
throw new \Exception("Cannot write to img directory");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save as new custom logo header
|
||||||
|
$save_to = 'logo_header.png';
|
||||||
|
copy($custom_logo_file_old, $path.$save_to);
|
||||||
|
Settings::Set("panel.logo_image_header", "img/{$save_to}?v=".time());
|
||||||
|
|
||||||
|
// Save as new custom logo login
|
||||||
|
$save_to = 'logo_login.png';
|
||||||
|
copy($custom_logo_file_old, $path.$save_to);
|
||||||
|
Settings::Set("panel.logo_image_login", "img/{$save_to}?v=".time());
|
||||||
|
|
||||||
|
lastStepStatus(0);
|
||||||
|
}
|
||||||
|
|
||||||
\Froxlor\Froxlor::updateToDbVersion('202107070');
|
\Froxlor\Froxlor::updateToDbVersion('202107070');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ final class Froxlor
|
|||||||
const VERSION = '0.10.26';
|
const VERSION = '0.10.26';
|
||||||
|
|
||||||
// Database version (YYYYMMDDC where C is a daily counter)
|
// Database version (YYYYMMDDC where C is a daily counter)
|
||||||
const DBVERSION = '202106270';
|
const DBVERSION = '202107070';
|
||||||
|
|
||||||
// Distribution branding-tag (used for Debian etc.)
|
// Distribution branding-tag (used for Debian etc.)
|
||||||
const BRANDING = '';
|
const BRANDING = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user