Hi to all!
I created "Display a tokenized message to the user" action which is triggered when user log in. Action is called "Link to edit account." and it goes:
Edit account: [site-url]/user/[user-id]/edit
Username: [user-name]
I have few accounts created standard way, and couple of accounts that are created through LDAP integration module.
When user with account created thru standard way log in he got message that is printed OK. E.g.:
Edit account: http://example.org/user/3/edit
Username: JohnBut, when any user created/authorized with LDAP integration module log in, he got always same message:
Edit account: http://example.org/user/0/edit
Username: AnonymousI examined "user" table with phpmyadmin in Drupal database and found only difference between data created thru standard way and with LDAP integration module in "data" cell, but I suppose that this is OK...
I really don't know is this token (actions) issue or LDAP integration (6.x-1.0-alpha2) module bug, so I would appreciate if somebody experienced take a look.
Tnx in advance.
Keyword: [user-name] [user-id] [user-mail]
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 294966_token_actions_missing_user_context.patch | 1.22 KB | greggles |
Comments
Comment #1
izkreny commentedHello again!
I did some additional test: I created (standard) "Display a message to the user" action with this message:
Username: %usernameAction is triggered after user log in, and it is displaying correct username for both users, one created standard way and one created through LDAP integration module.
This is obviously issue with Token (action) module...
Comment #2
gregglesUnfortunately I don't use the LDAP integration module so I'm afraid that I can't test this myself.
I did look at how the default "Display a message to the user" works and then at how the token actions one works and I believe that I've found a solution to it. Can you try the attached patch?
Comment #3
gregglesAlso thanks very much for your clear description of the problem and for your further investigation of the problem - that made it much easier to understand the problem.
Comment #4
izkreny commentedHi Greg.
Tnx for the patch, but it seems that patch doesn't fix the issue. I patched it this way (in case I did something wrong):
patch < 294966_token_actions_missing_user_context.patchAnd result is same: Anonymous ID and username output in message (for LDAP users). :(
You are welcome, this is not problem at all, probably mostly thanks to my professional deformation: helpdesk agent troubleshooting experience. ;)
And of course, another thing is this amazing community and amazing thing called Drupal. :P
Good luck with debugging,
--
m.m
Comment #5
greggles@mariomaric - well, since I don't use the LDAP module module it is unlikely that I'll be able to debug this. If you could add
drupal_set_message('<pre>'. print_r($context) .'</pre>');at the top of the function and then paste the results here that would be really helpful.Comment #6
izkreny commentedThanks for such quick response,
if I understood you right, I need to put function above in token_actions.module file? Like this:
After log in I got only this on white screen (I replaced sensitive company data like username, pass, mail and AD groups...):
Array ( [hook] => user [op] => login [form_values] => Array ( [name] => johndoe [pass] => johndoepass [op] => Log in [submit] => Log in [form_build_id] => form-ab6f8ffb0cb39e179da92969742fccae [form_id] => user_login_block ) [account] => stdClass Object ( [uid] => 24 [name] => johndoe [pass] => c6ae73705ca77372fad08fda742dfc25 [mail] => johndoemail [mode] => 0 [sort] => 0 [threshold] => 0 [theme] => [signature] => [created] => 1219006003 [access] => 1219007759 [login] => 1219008781 [status] => 1 [timezone] => [language] => [picture] => [init] => johndoemail [data] => a:4:{s:17:"ldap_authentified";b:1;s:7:"ldap_dn";s:97:"CN=John Doe,OU=Users,OU=Group 2,OU=Group 3,OU=Group 4,DC=example,DC=local";s:11:"ldap_config";s:1:"1";s:17:"ldap_drupal_roles";a:4:{i:0;s:5:"Users";i:1;s:18:"Group 2";i:2;s:19:"Group 3";i:3;s:6:"Group 4";}} [ldap_authentified] => 1 [ldap_dn] => CN=John Doe,OU=Users,OU=Group 2,OU=Group 3,OU=Group 4,DC=example,DC=local [ldap_config] => 1 [ldap_drupal_roles] => Array ( [0] => Users [1] => Group 2 [2] => Group 3 [3] => Group 4 ) [roles] => Array ( [2] => authenticated user [6] => Users [7] => Group 2 [8] => Group 3 [9] => Group 4 ) [profile_full_name] => John Doe [profile_first_name] => John [profile_last_name] => Doe ) [message] => Please edit: [site-url]/user/[user-id]/edit/Osobni%20podaci Your username: [user-name] )If there is anything else I can do to help please don't hesitate to ask.
Cheers.
Comment #7
izkreny commentedLDAP Integration will be probably replaced by Lightweight Directory Access Protocol
module - this issue is obsolete...