Closed (fixed)
Project:
Mailhandler
Version:
6.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2010 at 15:08 UTC
Updated:
18 Jan 2011 at 13:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
dagmarOk, now that #921774: Support CCK creation using Feeds and Mailhandler is in, I have modified the patch to use an exception to avoid the node creation. Also this fix the @TODO introduced in the patch committed in #921774.
Comment #2
mark trappTagging.
Comment #3
mark trappThe patch looks good, but I have a question about the exception thrown:
What handles that exception?
Comment #4
Ian Ward commentedAttached is a patch which gets MailhandlerNodeProcessor::authenticate working again, which is the mailhandler authentication plugin system. It now works by mapping the 'authenticate' source to the 'authenticate' target. I'm thinking FeedsNodeProcessor should somehow offer a way to bail out of node creation again, instead of defaulting to anonymous author. This could be a setting on the processor which says "allow anon. node creation or require access check."
It may actually be possible to use hook_node_presave to get around doing this hacky mapping stuff in this patch... but will post what I have for now.
Comment #5
Ian Ward commentedNoting that hook_node_presave won't work because it's then too late to halt node creation. What may work, and I think dagmar mentioned this on [xxxxx] is to:
* Run authentication in the parser, and if authentication fails, skip over the message so it never gets processed (need to look at feasibility of this)
* Do the mapping, like in the patch above.
This wouldn't get around this hackish way of needing to create a mapping to actually authenticate and map the found uid to the node object, but, it would at least prevent node creation.
Another option is a patch to FeedsNodeProcessor so that the $node can be altered before the node_save is run, and then have the node_save check whether there's still actually a $node or whether its been set to FALSE. I like this third option best because it makes setting up the mapping unnecessary and simplifies how to halt node processing.
Comment #6
Ian Ward commentedI meant #921774: Support CCK creation using Feeds and Mailhandler where i had "[xxxxx]"
Comment #7
dagmarI have reviewed the patch attached in #4. I'm afraid Authentication plugin is not being loaded at all. After some research, I think the problem is MailboxNode class is not adding the settings as Mailbox class does, and therefore,
$mailbox->getSettings('authenticateplugin', $mailbox)never loads the Authentication plugin.This patch includes the necessary changes to load the correct Auth plugin, and also provide a UI to define what to do if the Authentication fails.
@Mark Trapp, related to your question, the exception is handled by FeedsProcessor in process() function. I have added a comment explaining this.
@Ian Ward, I think the exception is enough to avoid the creation of the new node. At least it works in my tests.
Comment #8
danepowell commentedPatch in #7 worked for me- it prevented non-authorized users from creating nodes, and assigned the correct author to created nodes
Comment #9
Ian Ward commentedThanks everyone. I committed a combo of #4 and #7. @dagmar I did not see the issue of the authentication plugin not getting loaded. If you see that issue again you can open a new ticket for it. Closing this one.