diff options
author | mkanat%bugzilla.org <> | 2006-09-14 07:33:41 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2006-09-14 07:33:41 +0000 |
commit | 110e9309a0418b63c1d919936c3e1d13396b9fc3 (patch) | |
tree | 15fa34740fde69b048d9fa13f048a41792c87dbe /editgroups.cgi | |
parent | Bug 352355: Cannot log in on a fresh installation - Patch by Frédéric Bucli... (diff) | |
download | bugzilla-110e9309a0418b63c1d919936c3e1d13396b9fc3.tar.gz bugzilla-110e9309a0418b63c1d919936c3e1d13396b9fc3.tar.bz2 bugzilla-110e9309a0418b63c1d919936c3e1d13396b9fc3.zip |
Bug 346597: Have Bugzilla::Group implement Bugzilla::Object->create, and make checksetup.pl use it
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=myk
Diffstat (limited to 'editgroups.cgi')
-rwxr-xr-x | editgroups.cgi | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/editgroups.cgi b/editgroups.cgi index 7ab2ac62e..8e6cf55ac 100755 --- a/editgroups.cgi +++ b/editgroups.cgi @@ -52,36 +52,6 @@ $user->in_group('creategroups') my $action = trim($cgi->param('action') || ''); -# RederiveRegexp: update user_group_map with regexp-based grants -sub RederiveRegexp -{ - my $regexp = shift; - my $gid = shift; - my $dbh = Bugzilla->dbh; - my $sth = $dbh->prepare("SELECT userid, login_name, group_id - FROM profiles - LEFT JOIN user_group_map - ON user_group_map.user_id = profiles.userid - AND group_id = ? - AND grant_type = ? - AND isbless = 0"); - my $sthadd = $dbh->prepare("INSERT INTO user_group_map - (user_id, group_id, grant_type, isbless) - VALUES (?, ?, ?, 0)"); - my $sthdel = $dbh->prepare("DELETE FROM user_group_map - WHERE user_id = ? AND group_id = ? - AND grant_type = ? and isbless = 0"); - $sth->execute($gid, GRANT_REGEXP); - while (my ($uid, $login, $present) = $sth->fetchrow_array()) { - if (($regexp =~ /\S+/) && ($login =~ m/$regexp/i)) - { - $sthadd->execute($uid, $gid, GRANT_REGEXP) unless $present; - } else { - $sthdel->execute($uid, $gid, GRANT_REGEXP) if $present; - } - } -} - # Add missing entries in bug_group_map for bugs created while # a mandatory group was disabled and which is now enabled again. sub fix_bug_permissions { @@ -313,7 +283,7 @@ if ($action eq 'new') { SELECT ?, products.id, 0, ?, ?, 0 FROM products', undef, ($gid, CONTROLMAPSHOWN, CONTROLMAPNA)); } - RederiveRegexp($regexp, $gid); + Bugzilla::Group::RederiveRegexp($regexp, $gid); print $cgi->header(); $template->process("admin/groups/created.html.tmpl", $vars) @@ -657,7 +627,7 @@ sub doGroupChanges { $chgs = 1; $dbh->do('UPDATE groups SET userregexp = ? WHERE id = ?', undef, ($regexp, $gid)); - RederiveRegexp($regexp, $gid); + Bugzilla::Group::RederiveRegexp($regexp, $gid); } my $sthInsert = $dbh->prepare('INSERT INTO group_group_map |