I'm trying to use Rules to send an email when anyone *except* me logs in to the site. I've installed the Rules module and have the action to execute set correctly. Apparently I'm messing something up in the Truth Value area, though. I've tried to use variations such as the following (one at a time, of course):
[account:user] == "bob"
[account:uid] == "bob"
[account:uid] == bob
[account:uid] == 'bob'
These always are evaluating to "true", even though I'm not logging in as bob. Looks like I'm totally messing up something. I can get it to evaluate to "false" by just putting a 0 in the Truth Value field, but no luck with an expression.
Can't find any documentation on this aspect. Can anyone help me?
Thanks!
Comments
operators
it kinda depends on what evaluator you are using. In Drupal 5, PHP evaluator was on by default. In 6 you have to enable the PHP Input module to make it work.
If you want to use PHP, you have to enclose both sides in quotes I believe, like "[account:user]"=="bob", since the token will be replaced. You need the quotes.
If it's not evaluating as PHP, it's just evaluating it as a string, not an expression, then ANY string (ie not NULL) will evaluate as TRUE. The entire string "[account:user] == "bob"" is a non-NULL string, therefore TRUE. I'm just guessing.
So, try turning PHP evaluation on as a module. Try putting both sides in quotes.
Thanks
I did try the quotes on both sides (forgot to list that variation); so I'll try turning on the PHP evaluation on...sounds like that might be the culprit. Thanks!
Ugh
Ugh! I've got PHP enabled now; but for the life of me can't come up with an expression that works to properly evaluate if user "bob" has logged in, including, I think, all of the following, and probably several more:
No luck...any more ideas about the expression to put in the Truth value field?
Thanks again!
Okay, looks like this works...
The only thing I could get to work was using a "Textual comparison" with "[account:user]" and "bob" as the two texts to compare. Looks like that did it! My eyes are getting crossed, so hopefully there are no exceptions to this working!
Thanks again!
I had same problem
solution at http://drupal.org/node/465506#comment-1961526