maybe this is a stupid mistake (I'm new to this module) , but I cannot set simple rule redirecting user depending on his/her role.
1. I've created rule based on event "User has logged in", make it active
2. Added condition (without group): "User has role(s)", selected 2 roles, choose "match against any" and save
4. added redirect action, put "node/add" in the path (leaving parameters blank), checked "force redirecting"
5. save
6. logged as a user with one of the rules mentioned above,
... nothing happens
so I've removed condition, to check if redirection will work for anybody.
logged as the same user as above
...nothing happens, no redirecion
what am I missing?
Comments
Comment #1
cyc CreditAttribution: cyc commentedupdate:
rule doesn't work when logging in from "mysite/user" path, and works when logging in from standard drupal login block
So, I'm marking this a s a bug
(or this is a feature?..)
What I'm trying to achieve now is the following:
1. drupal login block is not visible in any region by default, on any page, except:
2. a custom login page, when this block is visible
Comment #2
cyc CreditAttribution: cyc commentedAs to my previous comment:
kind of workaround for my goal is to add page with 'login' alias, put login block in main page region and configure block t show only on 'login' page.
pro's:
The only method at this moment, but works
con's:
I won't be able to use login block on any other page
I cannot redirect admin (user no.1) to different page - condition is alowed only to roles, not to specific user
Should I open another issue related to 2nd con?
Comment #3
fagohm, I just gave it a try and it works fine for me. I tested user-login block + role condition + page redirect action with "Force redirecting to the given path, even if a destination parameter is given" enabled and "immediate" option off. So I'm sry, I cannot reproduce it.
Perhaps you could test if it works on another clean installation on your server? Are you using php4?
Comment #4
cyc CreditAttribution: cyc commented@fago
pls read my comment #1 again
"rule doesn't work when logging in from "mysite/user" path, and works when logging in from standard drupal login block"
and the php number is 5.2.6;-)
Comment #5
fagodamn, sry. If you turn on the debug log, do you see the debug of the rule evaluation? If not, probably mysite doesn't invoke hook_user op login.
Comment #6
cyc CreditAttribution: cyc commented@fago
debug log is shown when login action is taken from standard drupal login block, but is not visible at /user path page.
these forms are different.
standard login block is designed to work at left/right column (and works as it should), while /user path page is designed to be displayed at main content area, and 'by design' redirects users to their profiles. seems to me that 'rules' module cannot overwrite this.
problem is that in 95% posts found at drupal.org, you can find general advice: "to login, enter /user path"...
Comment #7
fagoWhen I log in through "/user" my rules get evaluated -> "# 0 ms "User has logged in" has been invoked.". ?
Comment #8
adamcarsonb CreditAttribution: adamcarsonb commentedI was having similar problems with setting up a login rule. The problem ended up being that I still had the Login Destination module enabled. I disabled it and my rules started working as expected. Hope this helps.
Comment #9
fagoAs written in #5, it looks mysite doesn't issue hook_user op = 'login' when a user logs in?
Comment #10
agentrickardMySite doesn't handle user logins in any way, so has no need to implement a 'login' op.
This module is no longer under active development. If you want paid services, drop me a note.
Comment #11
agentrickard