Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 303788 Details for
Bug 443566
FEAT: Match the new db schema of bz3.0 [#9 TABLE profiles]
Home
New
Search
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.rh90 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 for patching operation.
profiles.patch (text/plain), 8.34 KB, created by
XINSUN
on 2008-04-25 14:05:48 UTC
(
hide
)
Description:
Patch Improve for patching operation.
Filename:
MIME Type:
Creator:
XINSUN
Created:
2008-04-25 14:05:48 UTC
Size:
8.34 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 25 Apr 2008 01:53:57 -0000 >@@ -100,27 +100,6 @@ > > bless ($self, $class); > >- # Now update any old group information if needed >- my $result = $dbh->selectrow_array(q{SELECT 1 >- FROM profiles, groups >- WHERE userid=? >- AND profiles.refreshed_when <= >- groups.last_changed}, >- undef, >- $id); >- >- if ($result) { >- my $is_main_db; >- unless ($is_main_db = Bugzilla->dbwritesallowed()) { >- Bugzilla->switch_to_main_db(); >- } >- # FIXME Throws error due to unique constraint differences in current db >- #$self->derive_groups($tables_locked_for_derive_groups); >- unless ($is_main_db) { >- Bugzilla->switch_to_shadow_db(); >- } >- } >- > return $self; > } > >@@ -671,73 +643,6 @@ > > } > >-sub email_prefs { >- # Get or set (not implemented) the user's email notification preferences. >- >- my $self = shift; >- >- # If the calling code is setting the email preferences, update the object >- # but don't do anything else. This needs to write email preferences back >- # to the database. >- if (@_) { $self->{email_prefs} = shift; return; } >- >- # If we already got them from the database, return the existing values. >- return $self->{email_prefs} if $self->{email_prefs}; >- >- # Retrieve the values from the database. >- &::SendSQL("SELECT emailflags FROM profiles WHERE userid = $self->{id}"); >- my ($flags) = &::FetchSQLData(); >- >- my @roles = qw(Owner Reporter QAcontact CClist Voter); >- my @reasons = qw(Removeme Comments Attachments Status Resolved Keywords >- CC Other Unconfirmed); >- >- # If the prefs are empty, this user hasn't visited the email pane >- # of userprefs.cgi since before the change to use the "emailflags" >- # column, so initialize that field with the default prefs. >- if (!$flags) { >- # Create a default prefs string that causes the user to get all email. >- $flags = "ExcludeSelf~on~FlagRequestee~on~FlagRequester~on~"; >- foreach my $role (@roles) { >- foreach my $reason (@reasons) { >- $flags .= "email$role$reason~on~"; >- } >- } >- chop $flags; >- } >- >- # Convert the prefs from the flags string from the database into >- # a Perl record. The 255 param is here because split will trim >- # any trailing null fields without a third param, which causes Perl >- # to eject lots of warnings. Any suitably large number would do. >- my $prefs = { split(/~/, $flags, 255) }; >- >- # Determine the value of the "excludeself" global email preference. >- # Note that the value of "excludeself" is assumed to be off if the >- # preference does not exist in the user's list, unlike other >- # preferences whose value is assumed to be on if they do not exist. >- $prefs->{ExcludeSelf} = >- exists($prefs->{ExcludeSelf}) && $prefs->{ExcludeSelf} eq "on"; >- >- # Determine the value of the global request preferences. >- foreach my $pref (qw(FlagRequestee FlagRequester)) { >- $prefs->{$pref} = !exists($prefs->{$pref}) || $prefs->{$pref} eq "on"; >- } >- >- # Determine the value of the rest of the preferences by looping over >- # all roles and reasons and converting their values to Perl booleans. >- foreach my $role (@roles) { >- foreach my $reason (@reasons) { >- my $key = "email$role$reason"; >- $prefs->{$key} = !exists($prefs->{$key}) || $prefs->{$key} eq "on"; >- } >- } >- >- $self->{email_prefs} = $prefs; >- >- return $self->{email_prefs}; >-} >- > 1; > > __END__ >Index: Bugzilla/BugMail.pm >=================================================================== >RCS file: /cvs/qa/hwcert/Bugzilla/BugMail.pm,v >retrieving revision 1.4 >diff -u -r1.4 BugMail.pm >--- Bugzilla/BugMail.pm 19 Jul 2007 19:31:53 -0000 1.4 >+++ Bugzilla/BugMail.pm 25 Apr 2008 01:53:57 -0000 >@@ -599,96 +599,7 @@ > push (@users, FetchOneColumn()) while MoreSQLData(); > } > >- # Initialize the list of recipients. >- my @recipients = (); >- >- USER: foreach my $user (@users) { >- next unless $user; >- >- # Get the user's unique ID, and if the user is not registered >- # (no idea why unregistered users should even be on this list, >- # but the code that was here before I re-wrote it allows this), >- # then we do not have any preferences for them, so assume the >- # default preference is to receive all mail. >- my $userid = DBname_to_id($user); >- if (!$userid) { >- push(@recipients, $user); >- next; >- } >- >- # Get the user's email preferences from the database. >- SendSQL("SELECT emailflags FROM profiles WHERE userid = $userid"); >- my $prefs = FetchOneColumn(); >- >- # If the user's preferences are empty, it means the user has not set >- # their mail preferences after the installation upgraded from a >- # version of Bugzilla without email preferences to one with them. In >- # this case, assume they want to receive all mail. >- if (!defined($prefs) || $prefs !~ /email/) { >- push(@recipients, $user); >- next; >- } >- >- # Write the user's preferences into a Perl record indexed by >- # preference name. We pass the value "255" to the split function >- # because otherwise split will trim trailing null fields, causing >- # Perl to generate lots of warnings. Any suitably large number >- # would do. >- my %prefs = split(/~/, $prefs, 255); >- >- # If this user is the one who made the change in the first place, >- # and they prefer not to receive mail about their own changes, >- # filter them from the list. >- if (lc($user) eq lc($nametoexclude) && $prefs{'ExcludeSelf'} eq 'on') { >- push(@excludedAddresses, $user); >- next; >- } >- >- # If the user doesn't want to receive email about unconfirmed >- # bugs, that setting overrides their other preferences, including >- # the preference to receive email when they are added to or removed >- # from a role, so remove them from the list before checking their >- # other preferences. >- if (grep(/Unconfirmed/, @$reasons) >- && exists($prefs{"email${role}Unconfirmed"}) >- && $prefs{"email${role}Unconfirmed"} eq '') >- { >- push(@excludedAddresses, $user); >- next; >- } >- >- # If the user was added to or removed from this role, and they >- # prefer to receive email when that happens, send them mail. >- # Note: This was originally written to send email when users >- # were removed from roles and was later enhanced for additions, >- # but for simplicity's sake the name "Removeme" was retained. >- if (grep($_ eq $user, @{$force{$role}}) >- && $prefs{"email${role}Removeme"} eq 'on') >- { >- push (@recipients, $user); >- next; >- } >- >- # If the user prefers to be included in mail about this change, >- # or they haven't specified a preference for it (because they >- # haven't visited the email preferences page since the preference >- # was added, in which case we include them by default), add them >- # to the list of recipients. >- foreach my $reason (@$reasons) { >- my $pref = "email$role$reason"; >- if (!exists($prefs{$pref}) || $prefs{$pref} eq 'on') { >- push(@recipients, $user); >- next USER; >- } >- } >- >- # At this point there's no way the user wants to receive email >- # about this change, so exclude them from the list of recipients. >- push(@excludedAddresses, $user); >- >- } # for each user on the unfiltered list >- >- return @recipients; >+ return @users; > } > > sub NewProcessOnePerson ($$$$$$$$$$$$$$) { >
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 443566
:
303411
|
303720
| 303788