Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 304133 Details for
Bug 443561
FEAT: Match the new db schema of bz3.0 [#5 TABLE group_group_map]
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch Improve:
b.patch (text/plain), 9.60 KB, created by
XINSUN
on 2008-04-29 15:34:36 UTC
(
hide
)
Description:
Patch Improve:
Filename:
MIME Type:
Creator:
XINSUN
Created:
2008-04-29 15:34:36 UTC
Size:
9.60 KB
patch
obsolete
>Index: Bugzilla/User.pm >=================================================================== >RCS file: /cvs/qa/hwcert/Bugzilla/User.pm,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 User.pm >--- Bugzilla/User.pm 16 Nov 2004 16:42:36 -0000 1.1.1.1 >+++ Bugzilla/User.pm 29 Apr 2008 10:36:09 -0000 >@@ -231,136 +209,6 @@ > return defined($res); > } > >-sub derive_groups { >- my ($self, $already_locked) = @_; >- >- my $id = $self->id; >- >- my $dbh = Bugzilla->dbh; >- >- my $sth; >- >- if ($db_driver eq 'mysql') { >- $dbh->do(q{LOCK TABLES profiles WRITE, >- user_group_map WRITE, >- group_group_map READ, >- groups READ}) unless $already_locked; >- } >- >- # avoid races, we are only up to date as of the BEGINNING of this process >- my $time = $dbh->selectrow_array("SELECT NOW()"); >- >- # first remove any old derived stuff for this user >- $dbh->do(q{DELETE FROM user_group_map >- WHERE user_id = ? >- AND grant_type != ?}, >- undef, >- $id, >- GRANT_DIRECT); >- >- my %groupidsadded = (); >- # add derived records for any matching regexps >- >- $sth = $dbh->prepare("SELECT id, userregexp FROM groups WHERE userregexp != ''"); >- $sth->execute; >- >- my $group_check; >- my $group_insert; >- while (my $row = $sth->fetch) { >- if ($self->{login} =~ m/$row->[1]/i) { >- $group_check ||= $dbh->prepare(q{SELECT user_id FROM user_group_map >- WHERE user_id = ? AND group_id = ? >- AND isbless = 0 AND grant_type = ?}); >- $group_check->execute($id, $row->[0], GRANT_REGEXP); >- my $in_group = $group_check->fetchrow_array(); >- >- if (!$in_group) { >- $group_insert ||= $dbh->prepare(q{INSERT INTO user_group_map >- (user_id, group_id, isbless, grant_type) >- VALUES (?, ?, 0, ?)}); >- $groupidsadded{$row->[0]} = 1; >- open (LOG, ">/tmp/groups"); >- print LOG "$id, $row->[0], " . GRANT_REGEXP . "<br/>\n"; >- close (LOG); >- $group_insert->execute($id, $row->[0], GRANT_REGEXP); >- } >- } >- } >- >- # Get a list of the groups of which the user is a member. >- my %groupidschecked = (); >- >- my @groupidstocheck = @{$dbh->selectcol_arrayref(q{SELECT group_id >- FROM user_group_map >- WHERE user_id=?}, >- undef, >- $id)}; >- >- # Each group needs to be checked for inherited memberships once. >- my $group_sth; >- while (@groupidstocheck) { >- my $group = shift @groupidstocheck; >- if (!defined($groupidschecked{"$group"})) { >- $groupidschecked{"$group"} = 1; >- $group_sth ||= $dbh->prepare(q{SELECT grantor_id >- FROM group_group_map >- WHERE member_id=? >- AND isbless=0}); >- $group_sth->execute($group); >- while (my $groupid = $group_sth->fetchrow_array) { >- if (!defined($groupidschecked{"$groupid"})) { >- push(@groupidstocheck,$groupid); >- } >- if (!$groupidsadded{$groupid}) { >- $groupidsadded{$groupid} = 1; >- $group_insert ||= $dbh->prepare(q{INSERT INTO user_group_map >- (user_id, group_id, isbless, grant_type) >- VALUES (?, ?, 0, ?)}); >- $group_insert->execute($id, $groupid, GRANT_DERIVED); >- } >- } >- } >- } >- >- $dbh->do(q{UPDATE profiles >- SET refreshed_when = ? >- WHERE userid=?}, >- undef, >- $time, >- $id); >- >- Bugzilla::DB::UnlockTables() unless $already_locked; >-} >- >-sub can_bless { >- my $self = shift; >- >- return $self->{can_bless} if defined $self->{can_bless}; >- >- my $dbh = Bugzilla->dbh; >- # First check if the user can explicitly bless a group >- my $res = $dbh->selectrow_arrayref(q{SELECT 1 >- FROM user_group_map >- WHERE user_id=? >- AND isbless=1}, >- undef, >- $self->{id}); >- if (!$res) { >- # Now check if user is a member of a group that can bless a group >- $res = $dbh->selectrow_arrayref(q{SELECT 1 >- FROM user_group_map, group_group_map >- WHERE user_group_map.user_id=? >- AND user_group_map.group_id=member_id >- AND group_group_map.isbless=1}, >- undef, >- $self->{id}); >- } >- >- $self->{can_bless} = $res ? 1 : 0; >- >- return $self->{can_bless}; >-} >- > sub can_move { > my $login = shift->login(); > 1 if Param('move-enabled') && defined($login) >@@ -861,14 +642,6 @@ > and only need to make a quick check for the group, where calling C<groups> > and getting all of the groups would be overkill. > >-=item C<derive_groups> >- >-Bugzilla allows for group inheritance. When data about the user (or any of the >-groups) changes, the database must be updated. Handling updated groups is taken >-care of by the constructor. However, when updating the email address, the >-user may be placed into different groups, based on a new email regexp. This >-method should be called in such a case to force reresolution of these groups. >- > =begin undocumented > > This routine takes an optional argument. If true, then this routine will not >@@ -886,10 +659,6 @@ > > =end undocumented > >-=item C<can_bless> >- >-Returns C<1> if the user can bless at least one group. Otherwise returns C<0>. >- > =item C<can_move> > > Returns C<1> if the user can move a bug to another Bugzilla or reopen >Index: globals.pl >=================================================================== >RCS file: /cvs/qa/hwcert/globals.pl,v >retrieving revision 1.23 >diff -u -r1.23 globals.pl >--- globals.pl 31 Oct 2007 14:18:20 -0000 1.23 >+++ globals.pl 29 Apr 2008 10:36:09 -0000 >@@ -1241,36 +1241,6 @@ > return defined Bugzilla->user && Bugzilla->user->can_move(); > } > >-sub UserCanBlessGroup { >- my ($groupname) = (@_); >- PushGlobalSQLState(); >- # check if user explicitly can bless group >- SendSQL("SELECT groups.id FROM groups, user_group_map >- WHERE groups.id = user_group_map.group_id >- AND user_group_map.user_id = $::userid >- AND isbless = 1 >- AND groups.name = " . SqlQuote($groupname)); >- my $result = FetchOneColumn(); >- PopGlobalSQLState(); >- if ($result) { >- return 1; >- } >- PushGlobalSQLState(); >- # check if user is a member of a group that can bless this group >- # this group does not count >- SendSQL("SELECT groups.id FROM groups, user_group_map, >- group_group_map >- WHERE groups.id = grantor_id >- AND user_group_map.user_id = $::userid >- AND user_group_map.isbless = 0 >- AND group_group_map.isbless = 1 >- AND user_group_map.group_id = member_id >- AND groups.name = " . SqlQuote($groupname)); >- $result = FetchOneColumn(); >- PopGlobalSQLState(); >- return $result; >-} >- > sub BugInGroup { > my ($bugid, $groupname) = (@_); > PushGlobalSQLState(); >Index: token.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/token.cgi,v >retrieving revision 1.3 >diff -u -r1.3 token.cgi >--- token.cgi 9 Feb 2007 16:47:10 -0000 1.3 >+++ token.cgi 29 Apr 2008 10:36:09 -0000 >@@ -254,7 +254,6 @@ > > # The email address has been changed, so we need to rederive the groups > my $user = new Bugzilla::User($userid); >- $user->derive_groups; > > # Return HTTP response headers. > print $cgi->header(); >@@ -297,7 +296,6 @@ > # issue > > my $user = new Bugzilla::User($userid); >- $user->derive_groups; > > $vars->{'message'} = "email_change_cancelled_reinstated"; > } >Index: template/en/default/global/useful-links.html.tmpl >=================================================================== >RCS file: /cvs/qa/hwcert/template/en/default/global/useful-links.html.tmpl,v >retrieving revision 1.1.1.1 >diff -u -r1.1.1.1 useful-links.html.tmpl >--- template/en/default/global/useful-links.html.tmpl 16 Nov 2004 16:42:37 -0000 1.1.1.1 >+++ template/en/default/global/useful-links.html.tmpl 29 Apr 2008 10:36:09 -0000 >@@ -71,8 +71,7 @@ > <a href="userprefs.cgi">Prefs</a> > [% ' | <a href="editparams.cgi">Parameters</a>' > IF user.groups.tweakparams %] >- [% ' | <a href="editusers.cgi">Users</a>' IF user.groups.editusers >- || user.can_bless %] >+ [% ' | <a href="editusers.cgi">Users</a>' IF user.groups.editusers %] > [% ' | <a href="editproducts.cgi">Products</a>' > IF user.groups.editcomponents %] > [% ' | <a href="editflagtypes.cgi">Flags</a>'
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 443561
:
303736
|
304097
| 304133