| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
require '../include/ispcp-lib.php'; |
|---|
| 22 |
|
|---|
| 23 |
check_login(__FILE__); |
|---|
| 24 |
|
|---|
| 25 |
$theme_color = Config::get('USER_INITIAL_THEME'); |
|---|
| 26 |
|
|---|
| 27 |
$tpl = new pTemplate(); |
|---|
| 28 |
$tpl->define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/ispcp_updates.tpl'); |
|---|
| 29 |
$tpl->define_dynamic('page_message', 'page'); |
|---|
| 30 |
$tpl->define_dynamic('hosting_plans', 'page'); |
|---|
| 31 |
$tpl->define_dynamic('update_message', 'page'); |
|---|
| 32 |
$tpl->define_dynamic('update_infos', 'page'); |
|---|
| 33 |
|
|---|
| 34 |
$tpl->assign( |
|---|
| 35 |
array( |
|---|
| 36 |
'TR_ADMIN_ISPCP_UPDATES_PAGE_TITLE' => tr('ispCP - Virtual Hosting Control System'), |
|---|
| 37 |
'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| 38 |
'THEME_CHARSET' => tr('encoding'), |
|---|
| 39 |
'ISP_LOGO' => get_logo($_SESSION['user_id']) |
|---|
| 40 |
) |
|---|
| 41 |
); |
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
function get_update_infos(&$tpl) { |
|---|
| 45 |
|
|---|
| 46 |
if (!Config::get('CHECK_FOR_UPDATES')) { |
|---|
| 47 |
$tpl->assign( |
|---|
| 48 |
array( |
|---|
| 49 |
'UPDATE_MESSAGE' => '', |
|---|
| 50 |
'UPDATE' => tr('Update checking is disabled!'), |
|---|
| 51 |
'INFOS' => tr('Enable update at') . " <a href=\"settings.php\">" . tr('Settings') . "</a>" |
|---|
| 52 |
) |
|---|
| 53 |
); |
|---|
| 54 |
$tpl->parse('UPDATE_INFOS', 'update_infos'); |
|---|
| 55 |
return false; |
|---|
| 56 |
} |
|---|
| 57 |
|
|---|
| 58 |
if (versionUpdate::getInstance()->checkUpdateExists()) { |
|---|
| 59 |
$tpl->assign( |
|---|
| 60 |
array( |
|---|
| 61 |
'UPDATE_MESSAGE' => '', |
|---|
| 62 |
'UPDATE' => tr('New ispCP update is now available'), |
|---|
| 63 |
'INFOS' => tr('Get it at') . " <a href=\"http://www.isp-control.net/download.html\" class=\"link\" target=\"ispcp\">http://www.isp-control.net/download.html</a>" |
|---|
| 64 |
) |
|---|
| 65 |
); |
|---|
| 66 |
|
|---|
| 67 |
$tpl->parse('UPDATE_INFOS', 'update_infos'); |
|---|
| 68 |
} else { |
|---|
| 69 |
if( versionUpdate::getInstance()->getErrorMessage() != "" ) { |
|---|
| 70 |
$tpl->assign(array('TR_MESSAGE' => versionUpdate::getInstance()->getErrorMessage())); |
|---|
| 71 |
} |
|---|
| 72 |
$tpl->assign('UPDATE_INFOS', ''); |
|---|
| 73 |
} |
|---|
| 74 |
} |
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
gen_admin_mainmenu($tpl, Config::get('ADMIN_TEMPLATE_PATH') . '/main_menu_system_tools.tpl'); |
|---|
| 83 |
gen_admin_menu($tpl, Config::get('ADMIN_TEMPLATE_PATH') . '/menu_system_tools.tpl'); |
|---|
| 84 |
|
|---|
| 85 |
$tpl->assign( |
|---|
| 86 |
array( |
|---|
| 87 |
'TR_UPDATES_TITLE' => tr('ispCP updates'), |
|---|
| 88 |
'TR_AVAILABLE_UPDATES' => tr('Available ispCP updates'), |
|---|
| 89 |
'TR_MESSAGE' => tr('No new ispCP updates available'), |
|---|
| 90 |
'TR_UPDATE' => tr('Update'), |
|---|
| 91 |
'TR_INFOS' => tr('Update details') |
|---|
| 92 |
) |
|---|
| 93 |
); |
|---|
| 94 |
|
|---|
| 95 |
gen_page_message($tpl); |
|---|
| 96 |
|
|---|
| 97 |
get_update_infos($tpl); |
|---|
| 98 |
|
|---|
| 99 |
$tpl->parse('PAGE', 'page'); |
|---|
| 100 |
$tpl->prnt(); |
|---|
| 101 |
|
|---|
| 102 |
if (Config::get('DUMP_GUI_DEBUG')) dump_gui_debug(); |
|---|
| 103 |
|
|---|
| 104 |
unset_messages(); |
|---|
| 105 |
|
|---|
| 106 |
?> |
|---|