$i = find_submit('Clear');
if ($i != -1)
{
- unlink($path_to_root.'/tmp/upgrade.'.$i.'.log');
+ unlink(VARLOG_PATH.'/upgrade.'.$i.'.log');
$Ajax->activate('_page_body');
}
if (get_post('_select_comp_update'))
label_cell($comp['version'], 'align=center' .($status ? '':' class=redfg')/*, 'class='.( $status ? 'ok' : 'error')*/);
- $log = $path_to_root.'/tmp/upgrade.'.$i.'.log';
+ $log = VARLOG_PATH.'/upgrade.'.$i.'.log';
if (file_exists($log))
{
label_cell(viewer_link(_('View log'), "admin/view/view_upgrade_log.php?id=$i", null, $i, 'log.png')
} else
label_cell('-', 'align=center');
-
if (!$status)
{
label_cell(radio(null, 'select_comp', $i, null, true), 'align=center');
if (get_post('select_comp') !== '')
{
$patch = @$installers[$site_status[get_post('select_comp')]['version']];
- if ($patch)
- $patch->show_params(get_post('select_comp'));
+ if ($patch) {
+ if (!set_global_connection(get_post('select_comp'))) // create page in target database context
+ display_error(_("Cannot connect to company database for database restore."));
+ else {
+ $patch->show_params(get_post('select_comp'));
+ set_global_connection(); // switch back
+ }
+ }
}
div_end();