From 152f61366bd9b268cd838307c1e58399003ef2c7 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 8 Aug 2007 18:58:19 +0000 Subject: Bug 332149: Ability to have symbols placed next to user names based on group membership - Patch by Frédéric Buclin r=myk a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editgroups.cgi | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'editgroups.cgi') diff --git a/editgroups.cgi b/editgroups.cgi index 5e2a3baf6..b9503426b 100755 --- a/editgroups.cgi +++ b/editgroups.cgi @@ -244,12 +244,18 @@ if ($action eq 'new') { my $desc = CheckGroupDesc($cgi->param('desc')); my $regexp = CheckGroupRegexp($cgi->param('regexp')); my $isactive = $cgi->param('isactive') ? 1 : 0; + # This is an admin page. The URL is considered safe. + my $icon_url; + if ($cgi->param('icon_url')) { + $icon_url = clean_text($cgi->param('icon_url')); + trick_taint($icon_url); + } # Add the new group $dbh->do('INSERT INTO groups - (name, description, isbuggroup, userregexp, isactive) - VALUES (?, ?, 1, ?, ?)', - undef, ($name, $desc, $regexp, $isactive)); + (name, description, isbuggroup, userregexp, isactive, icon_url) + VALUES (?, ?, 1, ?, ?, ?)', + undef, ($name, $desc, $regexp, $isactive, $icon_url)); my $gid = $dbh->bz_last_key('groups', 'id'); my $admin = Bugzilla::Group->new({name => 'admin'})->id(); @@ -565,6 +571,10 @@ sub doGroupChanges { } } + if (defined $cgi->param('icon_url')) { + $group->set_icon_url($cgi->param('icon_url')); + } + my $changes = $group->update(); my $sth_insert = $dbh->prepare('INSERT INTO group_group_map -- cgit v1.2.3-24-g4f1b