Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I added a rule to redirect after "user has logged in". However, when a user request a password reset, the user gets an email with a temp link, this link auto logs in the user. This will cause the rule to fire. Instead of getting the user account page (where password can be reset), it sends the page to the destination defined in the rule. The use is confused and doesn't know where to go to reset the password.
I'm trying to add a condition to check if a user has logged in via the normal login page, but I couldn't figure out what should be the condition. Can someone help? Thx!
Comment | File | Size | Author |
---|---|---|---|
#18 | rules_path_regexp.patch | 3.88 KB | neochief |
Comments
Comment #1
fagoYou could check the current path, however there is no special condition for this yet. You can use a textual comparion and compare it to a token (I'm not sure if there is such a token in 6.x?) or to the result of the php function arg: http://api.drupal.org/api/function/arg/6
Maybe we should do such a condition though.
Comment #2
amitaibufor this task I'm using a PHP condition + use menu_get_item(). Maybe we can add it as a variable:
Comment #3
newbuntu CreditAttribution: newbuntu commentedI added a php execution condition:
$url = drupal_get_path_alias($_GET['q']);
return strstr($url, 'user/login');
Comment #4
newbuntu CreditAttribution: newbuntu commentedComment #5
mrfelton CreditAttribution: mrfelton commentedAdding this as a condition that is configurable through the UI without the need for php coding would be a nice addition
Comment #6
cerup CreditAttribution: cerup commentedHow do you go about adding this as a condition, php or other? I'm not sure that it's explained above.
I'd like to have a check if the current page against a path.
Comment #7
mitchell CreditAttribution: mitchell commentedSetting this back to active as per fago's comment:
See #2 or #3 for current workarounds.
Comment #8
Bilmar CreditAttribution: Bilmar commented+1 subscribing
Comment #9
UNarmed CreditAttribution: UNarmed commentedHow do i add the PHP condition mentioned at #2 and #3 to my rule?
Comment #10
YK85 CreditAttribution: YK85 commentedHi,
I was wondering if there has been any further development on this?
Thanks!
Comment #11
mitchell CreditAttribution: mitchell commentedSee: Path Rules
@fago: Would you like to merge this module into 6.x-1.x-dev. It appears to be stable, so I doubt it will hold you up on 6.x-1.2.
Comment #12
YK85 CreditAttribution: YK85 commentedawesome, i tested http://drupal.org/project/pathrules and it would be great to see this in rules core module
Comment #13
fagoyep, imho that make sense. Feel free to roll a patch. However for 1.2 you need to hurry.. ;)
Comment #14
klausiComment #15
YK85 CreditAttribution: YK85 commentedwould anyone be able to kindly roll a patch to integrate the features of pathrules module into rules?
thank you!
Comment #16
mitchell CreditAttribution: mitchell commentedBig bump. This one issue is good cause for a new 6.x release for at least 618 rules users.
Comment #17
fagoLet's add this feature for 7.x first (this is where new features are added). By adding a new property in entity metadata ala system:current-path this should be rather easy. Then we need to ensure we have a good textual comparison that is capable of doing all operators off "starts with, ends with, contains, is equal to".
Comment #18
neochief CreditAttribution: neochief commentedHere's the one with regular expressions, I used for my project.
Comment #19
stella CreditAttribution: stella commentedsubscribe, willing to test any d6 patch
Comment #20
fagoWe really should do just an improved textual comparison condition, i.e. improve the data comparison condition.
Comment #21
perusio CreditAttribution: perusio commentedYes. But the fact remains that there's no condition for the current path, even if you extend the textual comparison condition o include the above mentioned operators. So I guess that the patch integrating pathrules is still useful. Is it not?
Comment #22
fagoIn the latest entity API, there is site:current-page:path or so, which you can use. So you probably don't need pathrules.
Comment #23
fagoad #20:
For 7.x, best I think this should be a separate condition that can focus on a textual comparisons and thus provide features like the regex match.
Comment #24
fagoI've implemented that as a "Text comparison" condition and committed it.