fully migrate admin_updates; removed unused Froxlor\UI\Paging;
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -59,70 +59,68 @@ if ($page == 'overview') {
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
if ((isset($_POST['update_preconfig']) && isset($_POST['update_changesagreed']) && intval($_POST['update_changesagreed']) != 0) || !isset($_POST['update_preconfig'])) {
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('update/update_start') . "\";");
|
||||
|
||||
include_once \Froxlor\Froxlor::getInstallDir() . 'install/updatesql.php';
|
||||
|
||||
$redirect_url = 'admin_index.php';
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('update/update_end') . "\";");
|
||||
|
||||
\Froxlor\User::updateCounters();
|
||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
|
||||
@chmod(\Froxlor\Froxlor::getInstallDir() . '/lib/userdata.inc.php', 0400);
|
||||
|
||||
$successful_update = true;
|
||||
UI::view('install/update.html.twig', [
|
||||
'checks' => $update_tasks
|
||||
]);
|
||||
exit;
|
||||
} else {
|
||||
$message = '<br><br><strong>You have to agree that you have read the update notifications.</strong>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$successful_update) {
|
||||
$current_version = Settings::Get('panel.version');
|
||||
$current_db_version = Settings::Get('panel.db_version');
|
||||
if (empty($current_db_version)) {
|
||||
$current_db_version = "0";
|
||||
}
|
||||
$new_version = $version;
|
||||
$new_db_version = $dbversion;
|
||||
$current_version = Settings::Get('panel.version');
|
||||
$current_db_version = Settings::Get('panel.db_version');
|
||||
if (empty($current_db_version)) {
|
||||
$current_db_version = "0";
|
||||
}
|
||||
$new_version = $version;
|
||||
$new_db_version = $dbversion;
|
||||
|
||||
$ui_text = $lng['update']['update_information']['part_a'];
|
||||
if ($version != $current_version) {
|
||||
$ui_text = str_replace('%curversion', $current_version, $ui_text);
|
||||
$ui_text = str_replace('%newversion', $new_version, $ui_text);
|
||||
} else {
|
||||
// show db version
|
||||
$ui_text = str_replace('%curversion', $current_db_version, $ui_text);
|
||||
$ui_text = str_replace('%newversion', $new_db_version, $ui_text);
|
||||
}
|
||||
$ui_text .= $lng['update']['update_information']['part_b'];
|
||||
$ui_text = $lng['update']['update_information']['part_a'];
|
||||
if ($version != $current_version) {
|
||||
$ui_text = str_replace('%curversion', $current_version, $ui_text);
|
||||
$ui_text = str_replace('%newversion', $new_version, $ui_text);
|
||||
} else {
|
||||
// show db version
|
||||
$ui_text = str_replace('%curversion', $current_db_version, $ui_text);
|
||||
$ui_text = str_replace('%newversion', $new_db_version, $ui_text);
|
||||
}
|
||||
$ui_text .= $lng['update']['update_information']['part_b'];
|
||||
|
||||
$upd_formfield = [
|
||||
'updates' => [
|
||||
'title' => $lng['update']['update'],
|
||||
'image' => 'fa-solid fa-download',
|
||||
'sections' => [],
|
||||
'buttons' => [
|
||||
[
|
||||
'label' => $lng['update']['proceed']
|
||||
]
|
||||
$upd_formfield = [
|
||||
'updates' => [
|
||||
'title' => $lng['update']['update'],
|
||||
'image' => 'fa-solid fa-download',
|
||||
'description' => $lng['update']['description'],
|
||||
'sections' => [],
|
||||
'buttons' => [
|
||||
[
|
||||
'label' => $lng['update']['proceed']
|
||||
]
|
||||
]
|
||||
];
|
||||
]
|
||||
];
|
||||
|
||||
include_once \Froxlor\Froxlor::getInstallDir() . '/install/updates/preconfig.php';
|
||||
$preconfig = getPreConfig($current_version, $current_db_version);
|
||||
if (!empty($preconfig)) {
|
||||
$upd_formfield['updates']['sections'] = $preconfig;
|
||||
}
|
||||
|
||||
UI::view('user/form-note.html.twig', [
|
||||
'formaction' => $linker->getLink(array('section' => 'updates')),
|
||||
'formdata' => $upd_formfield['updates'],
|
||||
// alert
|
||||
'type' => !empty($message) ? 'danger' : 'info',
|
||||
'alert_msg' => $ui_text . $message
|
||||
]);
|
||||
include_once \Froxlor\Froxlor::getInstallDir() . '/install/updates/preconfig.php';
|
||||
$preconfig = getPreConfig($current_version, $current_db_version);
|
||||
if (!empty($preconfig)) {
|
||||
$upd_formfield['updates']['sections'] = $preconfig;
|
||||
}
|
||||
|
||||
UI::view('user/form-note.html.twig', [
|
||||
'formaction' => $linker->getLink(array('section' => 'updates')),
|
||||
'formdata' => $upd_formfield['updates'],
|
||||
// alert
|
||||
'type' => !empty($message) ? 'danger' : 'info',
|
||||
'alert_msg' => $ui_text . $message
|
||||
]);
|
||||
} else {
|
||||
\Froxlor\UI\Response::standard_success('noupdatesavail');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user