The title says all.
I attached files contact.module and contact.pages.inc.
for newbies: they are in .txt format because attachment of .inc and .module files arent allowed...just rename the file
I didn't check out how to use patch because im pressed for time to finish the site, but thought it would be useful for people out there who want this feature and i think it could be included in future releases... the only 'dirty' part of the code was that when an anonymous user uses the personal contact form, in drupal_mail i used 'page_mail' as they key parameter instead of 'user_mail' .. maybe this issue can be sorted by adding 'user_mail_anon' for e.g. to make the code neither..
tellah:)
Comment | File | Size | Author |
---|---|---|---|
#23 | contact_anonymous.tgz | 7.6 KB | crikeymiles |
#20 | contact_anonymous_d615.patch | 8.78 KB | roderik |
#5 | contact_anonymous_d613.patch | 8.48 KB | roderik |
#3 | contact.pages_.inc_.txt | 9.13 KB | davbusu |
#3 | contact.module.txt | 11.87 KB | davbusu |
Comments
Comment #1
davbusu CreditAttribution: davbusu commentedforgot to mention.. i used 'page_mail' so when the email is sent it, rather then receiving:
one would receive:
Comment #2
davbusu CreditAttribution: davbusu commentedthe issue to be solved at stated is to create a function for e.g. user_mail_anon which basically is the same as page_mail but this part would also appear:
Also it would be great if the url is enclosed in brackets like in user_mail to have more consistency
Comment #3
davbusu CreditAttribution: davbusu commentedok i managed to do it...find attached new contact.module and contact.pages.inc
I added key user_mail_anon which is basically the same as user_mail but doesn't displays user's page (user/0)..here is an example of the received email:
furthermore i modified a bit page_mail so it displays subject as [SITENAME/CATEGORY] SUBJECT rather then [CATEGORY] SUBJECT and the content of the mail is of the format:
Comment #4
Dave ReidPlease post your 6.x patches in this issue #58224: Allow anonymous users access to a members personal contact form. Also note there is the Anonymous Contact module that could use help being ported to 6.x since it is unlikely this issue will be something backported to 6.x from HEAD.
Comment #5
roderikHey, I know something.... How about posting 6.x patches here and not in #58224: Allow anonymous users access to a members personal contact form?
That way the people in #58224 won't have to complain about the D6 patches obstructing D7 development. And I bet we won't confuse the testing robot either.
I did look in #58224 for patches, took the files posted in comment #193, incorporated two changes from the patch in #148
(fixed the watchdog message; made a separate form validate function) and modified things so it applies cleanly to Drupal 6.13 again. So this should work for some people who want to patch the newest D6 instead of using the contact_anon module.
Comment #6
jurgenhaasGreat idea, I'll give it a try and report back on it here.
Comment #7
jurgenhaasPerfect work.
I've downloaded and applied the patch, adjusted the permissions for anonymous users and I got the personal contact links and forms straight away. Just exactly what was required.
I wonder if that could make it's way into 6.x core?
Comment #8
binford2k CreditAttribution: binford2k commentedThis patch doesn't seem to help. I get this message:
"You need to provide a valid e-mail address to contact other users. Please update your user information and try again."
and nothing I do seems to change it. I'm actually quite flummoxed right now.
Comment #9
roderik@jurgenhaas: This topic has been beaten to death, and there's hardly any possibility it will get included into D6 core. (I believe most people were against it because it would open up too much possibility for people to spam your site users. But there may have been other reasons - I didn't read up on every detail.)
So it looks like the faith of this patch is to live forever in this thread marked 'duplicate', until it eventually dies out along with D6 installations, a few years from now. I know no better place for it.
@binford2k: it looks like you can only get that message when you are logged on already, i.e. not an anonymous user. (In which case the patch does not have any effect; you should also get that same message without having patched the module.)
And it looks like you need to need to check your account settings to see that you really have specified a valid e-mail address. If your e-mail address IS valid... I have no clue what's going on.
Comment #10
binford2k CreditAttribution: binford2k commentedNo, the anonymous user gets this error message. Works fine for the authenticated user. Without this patch, the anonymous user gets the usual auth error.
Comment #11
roderikI don't know what to tell you without more info (and don't really know what info to ask for, to be able to trace the error). It works for me...
Comment #12
Damien Tournoud CreditAttribution: Damien Tournoud commentedDrupal 6 is feature frozen.
Comment #13
binford2k CreditAttribution: binford2k commentedI don't understand it. Here is my contact_user_page function:
With that
die
in there, it should crap itself on every run. Yet it has absolutely no effect. If I change thecontact_mail_user
function just a few lines down in the file, it's reflected immediately.It's like
contact_user_page
isn't being called at all; or it's being cached in a really weird way. Anyone know what's going on?Comment #14
binford2k CreditAttribution: binford2k commentedTracked down the problem. Realname conflicts. Hack patch below:
Comment #15
mariusz.slonina CreditAttribution: mariusz.slonina commented#5 patch works ok, thank You:)
Comment #16
NickTech CreditAttribution: NickTech commentedI would very much like to use the patch from #5 but I too have RealName module installed. Every time I try using the hack patch from #14 I get the error: **** malformed patch at line 5: function realname_contact_user($account) {
Could someone point me in the right direction?
Thanks!
Comment #17
binford2k CreditAttribution: binford2k commentedJust do it by hand. Go to line #206 and find the text
if (!valid_email_address($user->mail)) {
Replace it with
if ($user->uid && !valid_email_address($user->mail)) {
Btw, the first line wasn't actually part of the patch, it was the command I used to generate it. I'll go edit that post and fix it!
Comment #18
marcushenningsen CreditAttribution: marcushenningsen commentedSorry for being a newbie, I don't understand which file I need to patch against.
Comment #19
Chad_Dupuis CreditAttribution: Chad_Dupuis commented#5 no longer applies to the latest d6 (6.15 at this point) - looks like some changes in how they show the form to users. Anyone have an updated version? I'm working on it but if someone is done already that would be helpful....
(This might be #10's problem?)
UPDATE - the patch fails because of the commit in 6.15 from http://drupal.org/node/525504. The majority of the patch is fine except for the section that controls contact tab access:
@@ -118,9 +118,9 @@
$account->contact = FALSE;
}
return
- $account && $user->uid &&
+ $account &&
(
- ($user->uid != $account->uid && $account->contact) ||
+ (user_access('access personal contact form') && ($user->uid != $account->
uid) && $account->contact) ||
user_access('administer users')
);
}
This should now add the following section:
+ // Anonymous users can access the contact form with proper permissions
+ if (user_access('access personal contact form')) {
+ return TRUE;
+ }
as the first if statement under
function _contact_user_tab_access($account) {
global $user;
and before
// Anonymous users cannot use or have contact forms.
if (!$user->uid || !$account->uid) {
return FALSE;
}
If this seems correct and someone can roll a new patch with this it would be great. I would but I have other changes in my contact module that I don't want to accidentally incorporate into the patch....
Comment #20
roderikOh. Right. Forgot about this. Well, here's a diff between d6.15 and my current working tree... Seems OK.
Comment #21
Dave ReidI'll be putting this feature backport into http://drupal.org/project/contact.
Comment #22
Marticus CreditAttribution: Marticus commentedThank you. I just finished hacking a backport from the D7 version of this thread, but I'm glad to see something being done for those who aren't as techno savvy. Thanks for the correction on the d7 thread, dave and roderik. I'll try to find d6 threads and reply to them hence forth so as to not hinder d7 development. Again, thanks for the prompt solutions.
Comment #23
crikeymiles CreditAttribution: crikeymiles commentedHi roderik,
This patch seems to work fine against 6.16 as well, although I patched contact, duplicated it, and renamed every 'contact_' to 'contact_anonymous_' and every 'contact. to 'contact_anonymous.' so I could separate the patched module, and update to core at any time without losing the changes. Of course, I don't know what will happen if I have both enabled, as they share menu item, so I don't!
Thanks for your patch, it works great.
Comment #24
jvieille CreditAttribution: jvieille commentedThis module does not work for me.
I get the new permission, but
1) I get database errors when switching from core "contact" to the new "contact _anonymous"
2) the Views field "Link to contact page" has gone
Side question:
What is the difference between this module and this one?
http://drupal.org/project/contact/
Thanks
Comment #25
GoldDamn. Hopefully I've not stepped on anyones toes with this.
I've just contributed a module to do this. It's quick and dirty and could do with a decent amount of enhancement but it scratched the itch my client had and didn't require hacking core files.
http://drupal.org/project/anonymous_contact
If people want to add to this project I'm happy to offer cvs access for a couple of co-maintainers.
Comment #26
feltwebel CreditAttribution: feltwebel commented#23 works perfectly for drupal 6.19. Thanks.
Comment #27
vcrkid CreditAttribution: vcrkid commentedI am also using 6.19 but #23 doesn't work for me and I'm not sure why (and I'd really really really like it to work for me).
I get the following error:
Any help would be very appreciated :-)
Comment #28
manoloka CreditAttribution: manoloka commentedNot sure what shall I do with #23
Substitute it from the modules/contact or only add it to that folder?
or shall I add it like any other contributed module?
Thanks
Comment #29
jvieille CreditAttribution: jvieille commentedForget #23
Use #25
http://drupal.org/project/anonymous_contact
Comment #30
sean porter CreditAttribution: sean porter commented#23 worked for me, running 6.22
I think from an amateur developer point of view its a bit more elegant than #25 because it uses the standard contact form found in user's profile pages.
I do, however, miss the view's links - not sure why those went away, but it appears as though the "User: link to contact form" is missing from the User fields... any way to add this back in?
Thanks,