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 290126 Details for
Bug 406211
3.11: XMLRPC method needed to disable sending of email to accounts that have been disabled.
[?]
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 to disable sending emails to account that has been disbaled
disabled_user_email.patch (text/plain), 9.58 KB, created by
Noura El hawary
on 2007-12-20 06:25:54 UTC
(
hide
)
Description:
patch to disable sending emails to account that has been disbaled
Filename:
MIME Type:
Creator:
Noura El hawary
Created:
2007-12-20 06:25:54 UTC
Size:
9.58 KB
patch
obsolete
>Index: whine.pl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_2_18/whine.pl,v >retrieving revision 1.3 >diff -u -r1.3 whine.pl >--- whine.pl 14 Sep 2007 17:43:46 -0000 1.3 >+++ whine.pl 10 Oct 2007 21:25:52 -0000 >@@ -341,6 +341,9 @@ > # subjective pronouns > $dbh = Bugzilla->switch_to_shadow_db(); > for my $target (@{$event->{'mailto'}}) { >+ # Do not send the whine event to disabled users >+ next if $target->{'disabledtext'} ne ""; >+ > my $args = { > 'subject' => $event->{'subject'}, > 'body' => $event->{'body'}, >Index: Bugzilla/BugMail.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_2_18/Bugzilla/BugMail.pm,v >retrieving revision 1.21 >diff -u -r1.21 BugMail.pm >--- Bugzilla/BugMail.pm 14 Sep 2007 09:07:12 -0000 1.21 >+++ Bugzilla/BugMail.pm 10 Oct 2007 21:25:52 -0000 >@@ -695,9 +695,15 @@ > > $logger->debug("Get the user's email preferences from the database"); > >- # Get the user's email preferences from the database. >- SendSQL("SELECT emailflags FROM profiles WHERE userid = $userid"); >- my $prefs = FetchOneColumn(); >+ # Get the user's email preference and disabledtext from the database. >+ SendSQL("SELECT emailflags, disabledtext FROM profiles WHERE userid = $userid"); >+ my ($prefs, $disabledtext) = FetchSQLData(); >+ >+ # If the user's account has been disabled, then we will not send to them >+ if ( defined $disabledtext and $disabledtext ne "" ) { >+ push(@excludedAddresses, $user); >+ next; >+ } > > # If the user's preferences are empty, it means the user has not set > # their mail preferences after the installation upgraded from a >Index: Bugzilla/Flag.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_2_18/Bugzilla/Flag.pm,v >retrieving revision 1.17 >diff -u -r1.17 Flag.pm >--- Bugzilla/Flag.pm 14 Sep 2007 17:43:46 -0000 1.17 >+++ Bugzilla/Flag.pm 10 Oct 2007 21:25:52 -0000 >@@ -326,6 +326,19 @@ > } > ); > } >+ >+ # Throw an error if the requestee is a disabled Bugzilla account >+ if ( $requestee->{'disabledtext'} ne "" ) { >+ ThrowUserError( >+ "flag_requestee_disabled", >+ { >+ flag_type => $flag->{'type'}, >+ requestee => $requestee, >+ bug_id => $bug_id, >+ attach_id => $flag->{target}->{attachment}->{id} >+ } >+ ); >+ } > } > } > >@@ -950,6 +963,10 @@ > if $flag->{'target'}->{'attachment'}->{'isprivate'} > && Param("insidergroup") > && !$ccuser->in_group( Param("insidergroup") ); >+ >+ # Do not send email to user if account is disabled >+ next if $ccuser->{'disabledtext'} ne ""; >+ > push( @new_cc_list, $cc ); > } > $flag->{'type'}->{'cc_list'} = join( ", ", @new_cc_list ); >Index: Bugzilla/FlagType.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_2_18/Bugzilla/FlagType.pm,v >retrieving revision 1.9 >diff -u -r1.9 FlagType.pm >--- Bugzilla/FlagType.pm 2 Apr 2007 16:32:58 -0000 1.9 >+++ Bugzilla/FlagType.pm 10 Oct 2007 21:25:52 -0000 >@@ -420,6 +420,15 @@ > bug_id => $bug_id, > attach_id => $attach_id }); > } >+ >+ # Throw an error if the requestee is a disabled Bugzilla account >+ if ( $requestee->{'disabledtext'} ne "" ) { >+ ThrowUserError("flag_requestee_disabled", >+ { flag_type => $flag_type, >+ requestee => $requestee, >+ bug_id => $bug_id, >+ attach_id => $attach_id }); >+ } > } > > my $throw_flag_error = 0; >Index: Bugzilla/Token.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_2_18/Bugzilla/Token.pm,v >retrieving revision 1.6 >diff -u -r1.6 Token.pm >--- Bugzilla/Token.pm 5 Jul 2007 15:57:15 -0000 1.6 >+++ Bugzilla/Token.pm 10 Oct 2007 21:25:52 -0000 >@@ -118,8 +118,7 @@ > # Retrieve the user's ID from the database. > my $quotedloginname = &::SqlQuote(&::clean_login_name($loginname)); > >- >- &::SendSQL("SELECT profiles.userid, tokens.issuedate FROM profiles >+ &::SendSQL("SELECT profiles.userid, profiles.disabledtext, tokens.issuedate FROM profiles > LEFT JOIN tokens > ON tokens.userid = profiles.userid > AND tokens.tokentype = 'password' >@@ -127,7 +126,11 @@ > Bugzilla::DB::Math_Date_Interval( > Bugzilla::DB::Now(),'-',10,'%i'). " > WHERE login_name = $quotedloginname"); >- my ($userid, $toosoon) = &::FetchSQLData(); >+ my ($userid, $disabledtext, $toosoon) = &::FetchSQLData(); >+ >+ if ( $disabledtext ne "" ) { >+ ThrowUserError("account_disabled_no_reason"); >+ } > > if ($toosoon) { > ThrowUserError('too_soon_for_new_token'); > >Index: template/en/default/global/user-error-messages.none.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_2_18/template/en/default/global/user-error-messages.none.tmpl,v >retrieving revision 1.27 >diff -u -r1.27 user-error-messages.none.tmpl >--- template/en/default/global/user-error-messages.none.tmpl 7 Sep 2007 05:25:01 -0000 1.27 >+++ template/en/default/global/user-error-messages.none.tmpl 10 Oct 2007 21:25:52 -0000 >@@ -53,8 +53,13 @@ > [% hr %] > If you believe your account should be restored, please > send email to [% Param("maintainer") %] explaining why. >- > >+ [% CASE "account_disabled_no_reason" %] >+ [% title = "Account Disabled" %] >+ The account entered is marked as disabled. >+ If you believe the account should be restored, please >+ send email to [% Param("maintainer") %] explaining why. >+ > [% CASE "stolen_session_cookie" %] > [% title = "Invalid Cookie Token. All Sessions Logged Out" %] > The session token on your cookie in invalid. It's possible someone >@@ -220,6 +225,15 @@ > Please choose someone else to ask, or make the [% terms.bug %] accessible to users > on its CC: list and add that user to the list. > >+ [% CASE "flag_requestee_disabled" %] >+ [% title = "Flag Requestee Account Not Available" %] >+ >+ You asked [% requestee.identity FILTER $filter %] >+ for [% flag_type.name FILTER $filter WRAPPER code %] on [% terms.bug %] >+ [% bug_id FILTER $filter -%] >+ [% IF attach_id %], attachment [% attach_id FILTER $filter %][% END %], >+ but that account is not available. >+ > [% CASE "flag_requestee_unauthorized_attachment" %] > [% title = "Flag Requestee Not Authorized" %] > >Index: Bugzilla/User.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_2_18/Bugzilla/User.pm,v >retrieving revision 1.22 >diff -u -r1.22 User.pm >--- Bugzilla/User.pm 26 Sep 2007 19:59:34 -0000 1.22 >+++ Bugzilla/User.pm 11 Oct 2007 04:41:49 -0000 >@@ -88,14 +88,16 @@ > my ($id, > $login, > $name, >- $mybugslink) = $dbh->selectrow_array(qq{SELECT userid, >- login_name, >- realname, >- mybugslink >- FROM profiles >- WHERE $cond}, >- undef, >- $val); >+ $mybugslink, >+ $disabledtext) = $dbh->selectrow_array(qq{SELECT userid, >+ login_name, >+ realname, >+ mybugslink, >+ disabledtext >+ FROM profiles >+ WHERE $cond}, >+ undef, >+ $val); > > return undef unless defined $id; > >@@ -103,6 +105,7 @@ > name => $name, > login => $login, > showmybugslink => $mybugslink, >+ disabledtext => $disabledtext, > }; > > bless ($self, $class); >@@ -210,6 +213,8 @@ > return {} unless $self->id; > > my $dbh = Bugzilla->dbh; >+ >+ > my $groups = $dbh->selectcol_arrayref(q{SELECT DISTINCT groups.name, group_id > FROM groups, user_group_map > WHERE groups.id=user_group_map.group_id >@@ -223,6 +228,7 @@ > my %groups = @$groups; > $self->{groups} = \%groups; > >+ > return $self->{groups}; > } > >@@ -552,6 +558,9 @@ > my $query = "SELECT userid, realname, login_name " . > "FROM profiles " . > "WHERE login_name = $sqlstr "; >+ $query .= "AND (disabledtext = '' " if $exclude_disabled; >+ $query .= "OR disabledtext IS NULL) " if $exclude_disabled; >+ > # Exact matches don't care if a user is disabled. > > &::PushGlobalSQLState();
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 Raw
Actions:
View
Attachments on
bug 406211
: 290126