mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Merge branch 'ticket/nickvergessen/9119' into develop-olympus
* ticket/nickvergessen/9119: [ticket/9119] Respect language selection on automated update.
This commit is contained in:
commit
0f35101c49
1 changed files with 35 additions and 17 deletions
|
@ -72,7 +72,7 @@ class install_update extends module
|
||||||
|
|
||||||
function main($mode, $sub)
|
function main($mode, $sub)
|
||||||
{
|
{
|
||||||
global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth;
|
global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language;
|
||||||
|
|
||||||
$this->tpl_name = 'install_update';
|
$this->tpl_name = 'install_update';
|
||||||
$this->page_title = 'UPDATE_INSTALLATION';
|
$this->page_title = 'UPDATE_INSTALLATION';
|
||||||
|
@ -119,7 +119,17 @@ class install_update extends module
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
$auth->acl($user->data);
|
$auth->acl($user->data);
|
||||||
|
|
||||||
$user->setup('install');
|
// Overwrite user's language with the selected one.
|
||||||
|
// Config needs to be changed to ensure that guests also get the selected language.
|
||||||
|
$config_default_lang = $config['default_lang'];
|
||||||
|
$config['default_lang'] = $language;
|
||||||
|
$user->data['user_lang'] = $language;
|
||||||
|
|
||||||
|
$user->setup(array('common', 'acp/common', 'acp/board', 'install', 'posting'));
|
||||||
|
|
||||||
|
// Reset the default_lang
|
||||||
|
$config['default_lang'] = $config_default_lang;
|
||||||
|
unset($config_default_lang);
|
||||||
|
|
||||||
// If we are within the intro page we need to make sure we get up-to-date version info
|
// If we are within the intro page we need to make sure we get up-to-date version info
|
||||||
if ($sub == 'intro')
|
if ($sub == 'intro')
|
||||||
|
@ -133,6 +143,14 @@ class install_update extends module
|
||||||
// still, the acp template is never stored in the database
|
// still, the acp template is never stored in the database
|
||||||
$user->theme['template_storedb'] = false;
|
$user->theme['template_storedb'] = false;
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
'S_USER_LANG' => $user->lang['USER_LANG'],
|
||||||
|
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
||||||
|
'S_CONTENT_ENCODING' => 'UTF-8',
|
||||||
|
'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
|
||||||
|
'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',
|
||||||
|
));
|
||||||
|
|
||||||
// Get current and latest version
|
// Get current and latest version
|
||||||
if (($latest_version = $cache->get('_version_info')) === false)
|
if (($latest_version = $cache->get('_version_info')) === false)
|
||||||
{
|
{
|
||||||
|
@ -234,7 +252,7 @@ class install_update extends module
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_INTRO' => true,
|
'S_INTRO' => true,
|
||||||
'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=version_check"),
|
'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=version_check"),
|
||||||
));
|
));
|
||||||
|
|
||||||
// Make sure the update list is destroyed.
|
// Make sure the update list is destroyed.
|
||||||
|
@ -250,8 +268,8 @@ class install_update extends module
|
||||||
'S_UP_TO_DATE' => $up_to_date,
|
'S_UP_TO_DATE' => $up_to_date,
|
||||||
'S_VERSION_CHECK' => true,
|
'S_VERSION_CHECK' => true,
|
||||||
|
|
||||||
'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"),
|
'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check"),
|
||||||
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"),
|
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_db"),
|
||||||
|
|
||||||
'LATEST_VERSION' => $this->latest_version,
|
'LATEST_VERSION' => $this->latest_version,
|
||||||
'CURRENT_VERSION' => $this->current_version)
|
'CURRENT_VERSION' => $this->current_version)
|
||||||
|
@ -305,8 +323,8 @@ class install_update extends module
|
||||||
'S_DB_UPDATE' => true,
|
'S_DB_UPDATE' => true,
|
||||||
'S_DB_UPDATE_FINISHED' => ($config['version'] == $this->update_info['version']['to']) ? true : false,
|
'S_DB_UPDATE_FINISHED' => ($config['version'] == $this->update_info['version']['to']) ? true : false,
|
||||||
'U_DB_UPDATE' => append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=1&language=' . $user->data['user_lang']),
|
'U_DB_UPDATE' => append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=1&language=' . $user->data['user_lang']),
|
||||||
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"),
|
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_db"),
|
||||||
'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"),
|
'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check"),
|
||||||
));
|
));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -363,7 +381,7 @@ class install_update extends module
|
||||||
// Refresh the page if we are still not finished...
|
// Refresh the page if we are still not finished...
|
||||||
if ($update_list['status'] != -1)
|
if ($update_list['status'] != -1)
|
||||||
{
|
{
|
||||||
$refresh_url = append_sid($this->p_master->module_url, "mode=$mode&sub=file_check");
|
$refresh_url = append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check");
|
||||||
meta_refresh(2, $refresh_url);
|
meta_refresh(2, $refresh_url);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
@ -427,7 +445,7 @@ class install_update extends module
|
||||||
$file_part = $filename;
|
$file_part = $filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
$diff_url = append_sid($this->p_master->module_url, "mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename']));
|
$diff_url = append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename']));
|
||||||
|
|
||||||
if (isset($file_struct['as_expected']) && $file_struct['as_expected'])
|
if (isset($file_struct['as_expected']) && $file_struct['as_expected'])
|
||||||
{
|
{
|
||||||
|
@ -475,9 +493,9 @@ class install_update extends module
|
||||||
'S_FILE_CHECK' => true,
|
'S_FILE_CHECK' => true,
|
||||||
'S_ALL_UP_TO_DATE' => $all_up_to_date,
|
'S_ALL_UP_TO_DATE' => $all_up_to_date,
|
||||||
'S_VERSION_UP_TO_DATE' => $up_to_date,
|
'S_VERSION_UP_TO_DATE' => $up_to_date,
|
||||||
'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"),
|
'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check"),
|
||||||
'U_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_files"),
|
'U_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_files"),
|
||||||
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"),
|
'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_db"),
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($all_up_to_date)
|
if ($all_up_to_date)
|
||||||
|
@ -690,7 +708,7 @@ class install_update extends module
|
||||||
$params[] = 'download=1';
|
$params[] = 'download=1';
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirect_url = append_sid($this->p_master->module_url, "mode=$mode&sub=update_files&" . implode('&', $params));
|
$redirect_url = append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_files&" . implode('&', $params));
|
||||||
meta_refresh(3, $redirect_url);
|
meta_refresh(3, $redirect_url);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
@ -831,7 +849,7 @@ class install_update extends module
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_DOWNLOAD_FILES' => true,
|
'S_DOWNLOAD_FILES' => true,
|
||||||
'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_files"),
|
'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_files"),
|
||||||
'RADIO_BUTTONS' => $radio_buttons,
|
'RADIO_BUTTONS' => $radio_buttons,
|
||||||
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
||||||
);
|
);
|
||||||
|
@ -945,8 +963,8 @@ class install_update extends module
|
||||||
|
|
||||||
'S_FTP_UPLOAD' => true,
|
'S_FTP_UPLOAD' => true,
|
||||||
'UPLOAD_METHOD' => $method,
|
'UPLOAD_METHOD' => $method,
|
||||||
'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_files"),
|
'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_files"),
|
||||||
'U_DOWNLOAD_METHOD' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_files&download=1"),
|
'U_DOWNLOAD_METHOD' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=update_files&download=1"),
|
||||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -1079,7 +1097,7 @@ class install_update extends module
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_UPLOAD_SUCCESS' => true,
|
'S_UPLOAD_SUCCESS' => true,
|
||||||
'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"))
|
'U_ACTION' => append_sid($this->p_master->module_url, "language=$language&mode=$mode&sub=file_check"))
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue