1

This is the case:

  • Anonymous user can create nodes
  • Anonymous user will leave their email address
  • Anonymous user must register with the same email to "claim" the contents they created
  • When that user logs in, the contents with anonymous author but same email address will update then the author will change from "anonymous" to current user.

I created a rule:

enter image description here

I've read some posts that I just need to add events on rules, there are no "AND" "OR" to events then rules will trigger that event but I noticed that it doesn't trigger the event "user logged in".

I tried testing this rule. changing Action, setting the value of author to ="1" ("admin") and removing condition of data comparison.

It does change the author to "admin" when saving new content either logged in or not.

When I saw that was working I returned the data comparison for the email.

Then If a user with the same email address logged in it does not change/update the author.

I tried placing the when user logged in first before the event after saving new content, as a result I wasn't able to use the [node:etc] on comparison and action. I also tried creating a rule with just one event = "User logged in". same result, I can't find the necessary token/arg I need.

Is there something wrong with my settings? Anyone here could point me to the right direction and steps?

Thank you very much!

0

Try using the trigger 'after saving a new user account'. You don't want to check for content every time they log in, just when they create an account that matches email addresses with those node.

For security purposes you should probably prevent people from being able to change their email address too or they might somehow steal someone else's content.

As for people who create content when they already have an account but are not logged in: create a rule that checks for accounts when a new node is saved. So in summary:

  1. New users should claim existing content when the 'after saving a new user account' is triggered.
  2. New content by existing users (that are not logged in) should be automatically claimed by the user account upon saving the node.

Neither of these events require you to check when a user logs in.

4
  • thank you for your answer, I will prevent people from changing email address. The problem with just after registering, they won't be able to "claim" other posts they did when they are not logged in but already registered..? maybe I will try to create a rule that will send the url of the content to that user for "verification" purposes (they need to be logged in when they click the link) , then use a rule "content is viewed" and condition of data comparison for the email, so that they could "claim" that content.
    – Danz
    Mar 6 '15 at 6:27
  • Hm, ok I see your problem, updating answer.
    – Darvanen
    Mar 6 '15 at 6:59
  • Thanks! Your summary was exactly what I needed, I tried to do that before but sadly I wasn't successful. I tried creating a rule with an event/s under User first but I can't find the data selector for node on the comparison and action after that. I don't know if I'm missing something but all it shows are just the "site:etc" and "account:etc" data selector. I also need to get the [node:field-anonymous-email] for comparison and [node:author] for the action.
    – Danz
    Mar 9 '15 at 3:19
  • As it says on the add condition page: "To make entity fields appear in the data selector, you may have to use the condition 'entity has field' (or 'content is of type')."
    – Darvanen
    Mar 9 '15 at 4:52
-1

I used the updated Anonymous Publishing in the end.

1
  • I wonder who down voted this? Do you mind telling me what's wrong with this answer/module? I wasn't able to get it working on just rules so I looked for an alternative. This module is perfect FOR ME since it does whatever I need in MY CASE.
    – Danz
    Apr 10 '15 at 1:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.