Closed (fixed)
Project:
CVS integration
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
3 Jun 2007 at 22:09 UTC
Updated:
23 Jun 2007 at 23:18 UTC
Jump to comment: Most recent file
When a user's CVS account access status is set to disabled, they are sent an e-mail message, but the message is blank. The reason is that cvs_mail_user() doesn't have a case for CVS_DISABLED.
There are a few ways to fix this. One would be to just not send an e-mail message when an account is disabled. Another would be to send a message, but to tell the user they have been disabled. That's the approach I took, with code below. In all cases, just add the code after the similar code for the CVS_DECLINED condition.
In cvs_mail_user(), add this code:
case CVS_DISABLED:
$extra = $extra ? t('Reason:'). "\n". $extra ."\n\n" : '';
$message = strtr($strings['cvs_disabled_email'], $message_variables);
break;
In cvs_settings_form(), add this code:
$form['cvs_email_form']['cvs_disabled_email'] = array(
'#title' => t('CVS account disabled e-mail message'),
'#type' => 'textarea',
'#default_value' => variable_get('cvs_disabled_email', $strings['cvs_disabled_email']),
'#description' => t('The message to send to users whose accounts have been disabled.'),
);
In _cvs_get_strings(), add this code:
$strings['cvs_disabled_email'] = t('%account-name,
We are sorry to inform you that your CVS account request has been disabled due to the reasons outlined below.
%cvs-admin-message
Please do not hesitate to contact us if you would like to discuss this further, as we can still review our position.
Kind regards,
%cvs-admin-name.
--------------------
User:
%user-account-url
Motivation message:
%motivation-message');
AC
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | cvslog_access_disabled.txt | 1.93 KB | aclight |
Comments
Comment #1
dwwseems like an email in this case is in order. actually, the slick thing would be a checkbox on the cvs account editing form to enable/disable the email notification, but that's feature creep. so, i think i'd be in favor of going with the approach you've started here. however, i'd really appreciate a patch that accomplished the changes you outline, instead of cut-and-pasted code. thanks.
Comment #2
aclight commentedIf you insist. :)
Here's the patch
AC
Comment #3
killes@www.drop.org commentedPatch looks good to me. Do we need an extra checkbox? Doesn't the one tht is already there apply here?
Comment #4
dwwoh yeah, right, we already have that checkbox, which controls if cvs_mail_user() gets called at all. ;) tee hee.
reviewed, tested, and committed a slightly modified version to HEAD. i just changed the wording of the default message to say "... CVS account has been disabled..." instead of "CVS account request has been disabled...". installed on d.o, too.
thanks!
-derek
Comment #5
(not verified) commented