summaryrefslogtreecommitdiffstats
path: root/editparams.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-12-12 03:00:46 +0100
committerlpsolit%gmail.com <>2006-12-12 03:00:46 +0100
commit32f3ff65a8019fded30601f59f37306312576547 (patch)
tree3a5a3df17a0f49ab2b4dc32906238eaeb02eafbf /editparams.cgi
parent36540893adb1efd1a1fce5f2e115754f93442ca5 (diff)
downloadbugzilla-32f3ff65a8019fded30601f59f37306312576547.tar.gz
bugzilla-32f3ff65a8019fded30601f59f37306312576547.tar.xz
Bug 297186: Send emails in the recipient's locale, not the current user's - Patch by Frédéric Buclin <LpSolit@gmail.com> r=bkor a=justdave
Diffstat (limited to 'editparams.cgi')
-rwxr-xr-xeditparams.cgi14
1 files changed, 14 insertions, 0 deletions
diff --git a/editparams.cgi b/editparams.cgi
index 80b458d90..ca74df685 100755
--- a/editparams.cgi
+++ b/editparams.cgi
@@ -33,6 +33,7 @@ use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Token;
use Bugzilla::User;
+use Bugzilla::User::Setting;
my $user = Bugzilla->login(LOGIN_REQUIRED);
my $cgi = Bugzilla->cgi;
@@ -73,6 +74,7 @@ if ($action eq 'save' && $current_module) {
my @changes = ();
my @module_param_list = "Bugzilla::Config::${current_module}"->get_param_list(1);
+ my $update_lang_user_pref = 0;
foreach my $i (@module_param_list) {
my $name = $i->{'name'};
my $value = $cgi->param($name);
@@ -132,8 +134,20 @@ if ($action eq 'save' && $current_module) {
if (($name eq "shutdownhtml") && ($value ne "")) {
$vars->{'shutdown_is_active'} = 1;
}
+ if ($name eq 'languages') {
+ $update_lang_user_pref = 1;
+ }
}
}
+ if ($update_lang_user_pref) {
+ # We have to update the list of languages users can choose.
+ # If some users have selected a language which is no longer available,
+ # then we delete it (the user pref is reset to the default one).
+ my @languages = split(/[\s,]+/, Bugzilla->params->{'languages'});
+ map {trick_taint($_)} @languages;
+ add_setting('lang', \@languages, Bugzilla->params->{'defaultlanguage'}, undef, 1);
+ }
+
$vars->{'message'} = 'parameters_updated';
$vars->{'param_changed'} = \@changes;