~ubuntu-branches/debian/sid/bugzilla/sid

« back to all changes in this revision

Viewing changes to editparams.cgi

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Patrick Davies
  • Date: 2008-05-29 17:20:32 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080529172032-tddh964ztksxayjm
Tags: 3.0.4-0ubuntu1
* New upstream release (LP: #138886, #235701).
* Removed "CVS" directories and ".cvsignore" files from upstream tarball.
* Added patches/ubuntu_01_bugzilla_libpath.dpatch - newly updated as necessary
  version of old 01_libpath.dpatch patch.
* Added patches/01_debian_package_version.dpatch - replaces old patch
  01_VERSION.dpatch, simply changes the version of Bugzilla to show the
  Debian packaging's versioning.
* Added patches/ubuntu_05_makefile_install.dpatch - Use a Makefile to
  install Bugzilla to the correct locations. Based on Makefile in old
  package but in patch form.
* Removed 02_checksetup.dpatch - fixed upstream.
* Removed 101_Config.diff - upstream has changed codebase.
* Renamed 06_contrib.dpatch to ubuntu_02_contrib_shebang_fixes.dpatch -
  corrects 'shebangs' which point to /usr/local/bin/ to /usr/bin/.
* Renamed 08_showdependencygraph.dpatch to
  ubuntu_03_showdependencygraph_url_fixes.dpatch and updated code as
  necessary - fixes graph URL to make the webdot generation possible.
* Removed CVE-2007-0791.dpatch - applied to upstream code.
* Removed CVE-2007-4543.dpatch - applied to upstream code.
* Renamed 09_homelink.dpatch to ubuntu_04_fixed_homepage_linked.dpatch -
  upstream now has links in
  'template/en/default/global/common-links.html.tmpl' instead of
  'useful-links.html.tmpl'.
* Removed 03_webpath.dpatch - upstream has changed stylesheet layout.
* Updated 10_perl_scripts_shebang.dpatch and removed part on "globals.pl" -
  no longer in source.
* Removed Debian vhost support patches (see docs/html/multiple-bz-dbs.html
  for how to run multiple Bugzilla instances):
  - Removed 04_Config.pm.dpatch - duplicate patch and unable to adapt it to
    new upstream code.
  - Removed 07_virtualhosting.dpatch - duplicate patch of
    04_Config.pm.dpatch.
  - Removed 'debian/examples' - contained Apache VHost example setup files
    for Bugzilla.
  - Removed section about vhosts from README.Debian.
* debian/rules:
  - Removed rules for "vhost conf dir", "examples" and "101_Config.diff"
    installation rules.
  - Removed part about bugzilla-fr package.
  - Remved part about "whine.pl" - now in Makefile.
  - Added rules to check the setup with upstream's "checksetup.pl" script.
* debian/control:
  - Updated Standards-Version to 3.7.3.
  - Updated compatibity level and debhelper build dependency version to 6.
  - Added Homepage field to source package stanza.
  - Added part about seeing 'bugzilla' package for more info to
    'bugzilla-docs'.
  - Added libapache2-mod-perl2, libtemplate-perl, libmime-perl,
    libappconfig-perl, libdbd-mysql-perl, libtimedate-perl, libgd-gd2-perl,
    libgd-text-perl, libxml-twig-perl, perlmagick, libemail-send-perl,
    libemail-mime-modifier-perl, libchart-perl, libgd-graph-perl,
    libhtml-scrubber-perl, libdbi-perl, libfile-spec-perl, libgd-graph-perl,
    libgd-text-perl, libnet-ldap-perl, libxml-parser-perl: to build
    dependencies with the necessary versions as stated by upstream in
    docs/html/installation.html - in order to check packaging correctly with
    'checksetup.pl' in rules. Also updated the 'bugzilla' dependencies with
    the above (LP: #235461).
  - Removed dependencies on old "apache" packages as they are no longer in
    the archives.
  - Moved mail transport agents on 'bugzilla' from Depends to
    Suggests (LP: #156405).
* debian/copyright: Updated the downloaded from link.
* debian/bugzilla.docs: Added "QUICKSTART", "rel_notes.txt" and "UPGRADING"
  documentation from source tarball for inclusion in package.
* debian/bugzilla-doc.doc-base: Corrected some spelling mistakes.
* debian/bugzilla.postinst: Removed sections about 101_Config.diff.
* Changed 'X_BUGZILLA_SITE' in bugzilla.cron.daily and bugzilla.postinst to
  'PROJECT'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
use strict;
26
26
use lib ".";
27
27
 
 
28
use Bugzilla;
28
29
use Bugzilla::Constants;
29
 
use Bugzilla::Config qw(:DEFAULT :admin :params $datadir);
 
30
use Bugzilla::Config qw(:admin);
30
31
use Bugzilla::Config::Common;
 
32
use Bugzilla::Util;
 
33
use Bugzilla::Error;
31
34
use Bugzilla::Token;
32
 
 
33
 
require "globals.pl";
34
 
use vars qw(@parampanels);
 
35
use Bugzilla::User;
 
36
use Bugzilla::User::Setting;
35
37
 
36
38
my $user = Bugzilla->login(LOGIN_REQUIRED);
37
39
my $cgi = Bugzilla->cgi;
51
53
$current_panel =~ /^([A-Za-z0-9_-]+)$/;
52
54
$current_panel = $1;
53
55
 
54
 
GetVersionTable();
55
 
 
56
56
my $current_module;
57
57
my @panels = ();
58
 
foreach my $panel (@parampanels) {
59
 
    next if ($panel eq 'Common');
60
 
    require "Bugzilla/Config/$panel.pm";
61
 
    my @module_param_list = "Bugzilla::Config::${panel}"->get_param_list();
 
58
foreach my $panel (Bugzilla::Config::param_panels()) {
 
59
    eval("require Bugzilla::Config::$panel") || die $@;
 
60
    my @module_param_list = "Bugzilla::Config::${panel}"->get_param_list(1);
62
61
    my $item = { name => lc($panel),
63
62
                 current => ($current_panel eq lc($panel)) ? 1 : 0,
64
63
                 param_list => \@module_param_list,
73
72
if ($action eq 'save' && $current_module) {
74
73
    check_token_data($token, 'edit_parameters');
75
74
    my @changes = ();
76
 
    my @module_param_list = "Bugzilla::Config::${current_module}"->get_param_list();
 
75
    my @module_param_list = "Bugzilla::Config::${current_module}"->get_param_list(1);
77
76
 
 
77
    my $update_lang_user_pref = 0;
78
78
    foreach my $i (@module_param_list) {
79
79
        my $name = $i->{'name'};
80
80
        my $value = $cgi->param($name);
95
95
 
96
96
        my $changed;
97
97
        if ($i->{'type'} eq 'm') {
98
 
            my @old = sort @{Param($name)};
 
98
            my @old = sort @{Bugzilla->params->{$name}};
99
99
            my @new = sort @$value;
100
100
            if (scalar(@old) != scalar(@new)) {
101
101
                $changed = 1;
110
110
                }
111
111
            }
112
112
        } else {
113
 
            $changed = ($value eq Param($name))? 0 : 1;
 
113
            $changed = ($value eq Bugzilla->params->{$name})? 0 : 1;
114
114
        }
115
115
 
116
116
        if ($changed) {
119
119
                if ($ok ne "") {
120
120
                    ThrowUserError('invalid_parameter', { name => $name, err => $ok });
121
121
                }
 
122
            } elsif ($name eq 'globalwatchers') {
 
123
                # can't check this as others, as Bugzilla::Config::Common
 
124
                # can not use Bugzilla::User
 
125
                foreach my $watcher (split(/[,\s]+/, $value)) {
 
126
                    ThrowUserError(
 
127
                        'invalid_parameter',
 
128
                        { name => $name, err => "no such user $watcher" }
 
129
                    ) unless login_to_id($watcher);
 
130
                }
122
131
            }
123
132
            push(@changes, $name);
124
133
            SetParam($name, $value);
125
134
            if (($name eq "shutdownhtml") && ($value ne "")) {
126
135
                $vars->{'shutdown_is_active'} = 1;
127
136
            }
 
137
            if ($name eq 'languages') {
 
138
                $update_lang_user_pref = 1;
 
139
            }
128
140
        }
129
141
    }
 
142
    if ($update_lang_user_pref) {
 
143
        # We have to update the list of languages users can choose.
 
144
        # If some users have selected a language which is no longer available,
 
145
        # then we delete it (the user pref is reset to the default one).
 
146
        my @languages = split(/[\s,]+/, Bugzilla->params->{'languages'});
 
147
        map {trick_taint($_)} @languages;
 
148
        my $lang = Bugzilla->params->{'defaultlanguage'};
 
149
        trick_taint($lang);
 
150
        add_setting('lang', \@languages, $lang, undef, 1);
 
151
    }
 
152
 
130
153
    $vars->{'message'} = 'parameters_updated';
131
154
    $vars->{'param_changed'} = \@changes;
132
155
 
133
 
    WriteParams();
134
 
    unlink "$datadir/versioncache";
 
156
    write_params();
135
157
    delete_token($token);
136
158
}
137
159