Closed (fixed)
Project:
Author Contact
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2009 at 14:42 UTC
Updated:
19 Nov 2009 at 00:10 UTC
How about logging the message that was sent from the form and to what user via watchdog() ?
Comments
Comment #1
ressaI second that, being able monitor the use of the contact form and spot potential abuse of the system is important.
Comment #2
JmsCrk commentedYou're right, it's a good idea. This feature is now in the dev version.
Comment #3
JmsCrk commentedComment #5
ressaHi James,
I have installed the latest 6.x-1.x-dev version -- datestamp = "1247486600", but I can't see the email messages under "Recent log entries" (/admin/reports/dblog)
I do see some email log entries, because I set Devel module to log mails in stead of sending them out. But none from author contact, if I disable and "go live", with actual mails being sent out.
Do you know what's going on, perhaps I need to tweak some settings in Drupal to activate email logging?
Thanks for making a great module!
Comment #6
ressaI couldn't wait, so I found some code in the devel.module, at 1764, which logs email messages in stead of sending them. I tweaked it to log email messages sent via Author Contact -- to start loggin':
Insert this code...
...after line 109 in authorcontact.module:
After that you should be able to see the messages sent via Author Contact under "Recent log entries" - /admin/reports/dblog
I am not sure what the process is... Maybe testing it and then including it in the latest dev release if it works?
Comment #7
JmsCrk commentedHi Ressa
This is already in the dev that I see on cvs checkout - I have the code as follows:
Placed before the drupal_set_message
I'll see if I can figure out why it's not in the dev download.
Comment #8
JmsCrk commented[edit] I found I had committed it to HEAD but not 6.x dev - this should now appear in the next 6.x dev snapshot. [/edit]
By the way - I had decided not to log the actual messages as I think is a privacy concern. As far as I know the normal contact form does not log the message itself.
Comment #9
JmsCrk commentedComment #10
ressaBeautiful! I think the snapshot just got in, but the latest 6.x dev (6.x-1.x-dev, 2009-Oct-30) is still the old version from 13th of July 2009.
Or do I have to wait a bit more for the latest version?
Comment #11
JmsCrk commentedHi Ressa, I've just downloaded the 6.x-1.x-dev version marked 30 Oct and at the top of the file it says:
// $Id: authorcontact.module,v 1.6.4.5 2009/10/30 03:21:43 justjamesaus Exp $And it has the latest changes in it. Can you confirm that's how it is for you?
Comment #12
ressaHi James,
The latest dev version online is now the correct one, from 2009-Oct-30.
There is a flood_register_event in the code, but no flood_is_allowed (which checks if the message limit is reached) so I inserted it two places in the authorcontact.module:
1. In the create block function, where I made two versions. They both alert the user that the message limit is reached, at the top of the form, but 1.2 also prevents the form fields from being shown.
I think I prefer 1.2, since it also makes the flood check in the authorcontact_form_validate function redundant, what do you think?
1.1 Alert user if the message limit is met:
1.2 Alert user if the message limit is met AND hide the form:
2. In the form validation function, which displays a warning at the top of the page. If version 1.2 is used, there is no need for it, since the form isn't being shown anyway.
Comment #13
ressaOops, I changed the title, I am changing it back 8o)
Comment #14
JmsCrk commentedHi Ressa, I've added this in as you've suggested in 1.2 above - although I'm still showing the title and description text for the block as I feel this is needed to give the contact note some context.
Thanks for your attention to this, it's greatly appreciated.