As i understand, this module takes user info from selected providers and save it to tokens.

Later, it's possible to use this info with realinfo module.

but, that about prepopulate FIELDS with this token info?

for example, in my profile, i already have BIRTHDAY field (date field). now, i want to take user birthday from his social network account and save it in this field.

how can i do it?

p.d. check the link to Realname module in your module description page. it's wrong.

CommentFileSizeAuthor
#7 rules_ulogin.png18.77 KBduozersk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dimetrius’s picture

+1 good question!

duozersk’s picture

Assigned: Unassigned » duozersk

Hi!

Yep, it definitely sounds like a reasonable feature and the next step.

Actually, the module saves information from uLogin to the user object ($user->data['ulogin']) and then provides tokens to use this info in any place the tokens are available (like Realname or Rules). So it sounds like we can have a submodule that could use this data to populate some profile fields. So you can use these tokens in Rules and populate profile fields on user creation/registration/login or any other event. I didn't actually try it out myself yet - but hey, this is what the Tokens integration should allow us to do!

Hope it helps. Please let me know if it works for you or not.

Thanks
AndyB

P.S. thanks for the hint about the link - fixed.

Dimetrius’s picture

Yes! Rules work for populating profile fields, but I find it difficult to select a condition for that rule...
If don't do that - all another account fields refilled in empty tokens

dgastudio’s picture

agree, must exist any "distinction" for rules on create new user account.

for example: register new user and register new user via uLogin.

Dimetrius

all another account fields refilled in empty tokens

u can check before refill.

if token !empty, fill.

duozersk’s picture

My own code checks for $user->data['ulogin'] not being empty to determine if this user was created using information from uLogin.

It is strange (at least to me) that the ulogin tokens are not available in the Data comparison condition... so that I could check for [user:ulogin:uid] not being empty. Rules DATA SELECTOR just doesn't show the whole ulogin group tokens for conditions.

What is your experience with that? Looks like I would need to write some more code...

AndyB

Dimetrius’s picture

AndyB, yes Rules DATA SELECTOR doesn't show the whole ulogin group tokens for conditions.
I entered them manually

duozersk’s picture

FileSize
18.77 KB

Dmitry,

Do they actually work after you enter them manually? Cause I'm getting an error message from Rules like this:
"Data selector account:ulogin:uid for parameter data is invalid." - this is when using the "Data comparison" condition on the "Data to compare" step.

However, I found a way to determine if account was created from uLogin - you can set the "Data comparison" condition on user name that it contains "ulogin_":

Rules uLogin

Thanks
AndyB

Dimetrius’s picture

AndyB, yes it works fine for me

My events:

Before saving a user account
User has logged in	
User account page is viewed

Conditions:

Path has URL alias
Parameter: Existing system path: [account:ulogin]

Actions:

Set a data value
Parameter: Data: [account:field-first-name], Value: [account:ulogin:first_name]
 
Set a data value
Parameter: Data: [account:field-last-name], Value: [account:ulogin:last_name]
 
Set a data value
Parameter: Data: [account:field-network], Value: [account:ulogin:network]
duozersk’s picture

Dmitry,

If it works fine for you - then it is good, but I just don't understand what the condition "Path has URL alias" does here. It looks that I would still need to write the custom Rules condition to check if account was created by uLogin or not.

AndyB

Dimetrius’s picture

AndyB, I changed condition to

Data comparison
Parameter: Data to compare: [account:name], Operator: contains, Data value: ulogin_

and it works fine too :) Thanx

Dimetrius’s picture

Interesting....
Is it possible to get password for new user after registration with uLogin?
Users got a login like ulogin_twitter_xxxxxxxx and want to change it, but can't - did not get account password

Any suggestions how to solve it?

duozersk’s picture

Well... it is definitely another topic and should be discussed in a separate issue :) So please file a new issue next time.

The idea of this module is to simplify registration and not to force users to set their usernames and remember passwords. This username is machine-generated and shouldn't be changed (if it does changes - then there might be some technical issues). So they should continue logging in through the same social network they used to create the account (or any other they connected to their account). And there is no any reason to change this user name - if there is one, I would love to know it.

As for the password - it is also generated by Drupal on the first login (when the account is created) and there is no good way to expose this password to the user. If they really want to know their password - they should use the forgot password functionality (then they will get a link in the email to change their password, if I remember it correctly).

So any reason to change the username? Ideally, they shouldn't even see their username.

Thanks
AndyB

duozersk’s picture

Component: Code » Documentation
Status: Active » Closed (works as designed)

Closing this one.