Hello again,

I noticed that you have committed some code and I was wondering if it was far enough along to try and maybe use.

Obviously it is still a work in progress, but I was wondering if it was stable enough to use for limited functionality? While there is a whole laundry list of things I would like to see, the main items I am looking for at this point, would be logging in via Drupal's built-in, Facebook, and maybe Twitter. (Google + LinkedIn would be great, but FB + Twitter would be enough to get me started. The next important item would be importing some of the profile data and using it to populate some of my Profile2 Fields with that data.

Comments

rwohleb’s picture

Assigned: Unassigned » rwohleb
Status: Active » Postponed

There is still a lot to be done on this module. Now that the holidays are over I'll be working on it again.

MacRonin’s picture

Thanks for the update.
Looking forward to experimenting when appropriate.

nicholasyonko’s picture

I have already started using it and it is working pretty well. Currently, I am working on getting the 'Linked Accounts' page functioning. If you need a co-maintainer, I would love to help.

rwohleb’s picture

The code works, but is still very much in flux. I've been working on a big rewrite of the UI code for example.

@nicholasyonko: Please post any patches that you make. I'm still trying to figure out who is going to be working on what (ie. @vishun and @ericduran). We'll likely need you as a maintainer. I guess you'd be working on the D7 side.

rwohleb’s picture

Version: » 7.x-1.x-dev

I've created a 7.x branch and scheduled a dev release to be created.

henrijs.seso’s picture

Testing. Works well with Google, even thou some errors, will open issues. Thanks for the effort. If you are working on UI, don't use tables, keep it simple, utilize templates and allow icon override (or better yet, define them in css, so we can override in theme :)

rwohleb’s picture

I just pushed some changes to the 7.x-1.x dev branch. This includes fixes to the popup/overlay logic and JS, as well as cleaning up the layout of the popup/overlay.

I changed up the widget styles. Now you have provider icon list, single button, and single link. The provider list will skip the overlay and load the provider login popup directly. It makes a lot more sense now.

The other two styles will bring up the popup/overlay provider list. When someone selects a provider their selection is stored in a cookie. The next time they hit the button/link they will get a prompt for that provider in the popup/overlay (with option to see entire list).

Please test the latest code and see what you think. If you haven't already, install the Libraries module and the ColorBox plugin. It makes the popup/overlay stuff a lot nicer.

henrijs.seso’s picture

-dev version looks good, no huge issues so far. How about brief roadmap? Do you have any?

rwohleb’s picture

Sorry for the delay in response. I started a new job this week and I'm having to hit the ground running.

I have some ideas for a roadmap, but nothing is fleshed out. I'm open to suggestions.

azin’s picture

Reading through HybridAuth code, I see a lot of good things under Hybrid_User_Profile, wondering if it is in scope for this model to provide Drupal tokens for each field, somewhat like the Janrain/RPX module http://drupal.org/project/rpx, but available to anything that uses Tokens.

MacRonin’s picture

Thinking of RPX as a starting point, it might also be possible to borrow some of the code for field matching function. Obviously the source fields may be different, but the mapping function and user profile logic in the module might be reusable.

azin’s picture

@MacRonin, field matching may not be required as all one needs is http://drupal.org/project/token_filter and put the token as a default value in your type and then adjust CCK Fields permissions.

rwohleb’s picture

Supporting a JanRain style profile import is definitely on the list. I actually already have some code from the RPX module that I need to finish massaging.

@architexturez: I'll have to check, but I think profiles handled through modules like Profile2 will not get the entities properly created when just using token_filter.

azin’s picture

@rwohleb, Tokens work for me with a limited set suggested here: http://drupal.org/node/1402730#comment-5503636 and some custom tokens. I am using HybridAuth on two dev sites, and can check more extensively if you have some cases in mind once tokens are available.

MacRonin’s picture

@architexturez: From my read of the link http://drupal.org/node/1402730#comment-5503636 this works if the user goes to Profile2 page where the user would normally create their profile themselves since those fields would then get filled in via the tokens when the data entry page is displayed.

How about the use case where we want to just automatically copy the user profile data from the Social site directly into the Profile2 fields without having the user go thru that page? (ie. the user creates an account and that data is pre-populated in the Profile2 records at registration time) They could of course go back later and update the info if they wish.

MacRonin’s picture

@rwohleb Glad to hear you already have it on your radar. It's one of the advantages of open-source code, you don't have to reinvent the wheel.

henrijs.seso’s picture

Good to hear discussion on tokens and profiles. They are must have second step for this module. My question is - how good is groundwork currently? If we could get basics rock solid (actual HybridAuth integration and safe, reliable CRUD of user data) and tokens integration, that would mean module is ready for alpha/beta. Lets not focus now on UI and less important features. Let's stay focused and ship solid foundation.

azin’s picture

@MacRonin, as Profile2 profile is created the first time user logs in from as social network and tokens will fill the profile on save.

MacRonin’s picture

@architexturez: Good to know. I had figured that if you had the Profile2's profile data entry on their own pages, that the records would only be created when you went to those pages, and that if you hadn't gone to those pages yet they wouldn't have been created yet.

So since this happens when the use account is saved, this would appear to create all the profile type records even if creating multiple profile types

henrijs.seso’s picture

Here is a little tutorial on getting core profile fields filled.

1. I use Email Registration which will generate core usernames for me and hide username field as well as allow login with email. I am not sure how well HybridAuth Social Sign-on deals with duplicate usernames, so I will use this module.

2. Now, I added field_profile_name for users real name, I also enabled and configured RealName module to use this field.

3. In my custom module I added following function. What you need to know about it, is that it will insert users nickname as default value in field_user_name and hide it in registration form. First I copied some code from hybridauth_form_user_register_form_alter() which seemed needed. Last if statement contains code that does the trick.

$form['field_user_name']['#language'] is field language code, you need to use it everywhere, where you see language code or 'und' which is undefined language. $form['field_user_name'][$form['field_user_name']['#language']]['#cardinality'] (notice field language code as one of keys) is cardinality setting, which for single value fields is '1' and unlimited value fields '-1'. I check if cardinality is '1', because i don't want to write fancy code for multivalued fields and use [0] key in this example.

/**
 * Implements hook_form_FORM_ID_alter().
 *
 * Prefills the registration form with values acquired via HybridAuth.
 */
function MODULENAME_form_user_register_form_alter(&$form, &$form_state) {
  // Only alter if the user is signing in using HybridAuth (the HybridAuth session may
  // still be set if admin has signed in using HybridAuth and is adding a user, so
  // check that this is not the case).
  if (!isset($_SESSION) || !isset($_SESSION['hybridauth']) || $_SESSION['hybridauth']['stat'] != 'ok' || user_access('administer users')) {
    return;
  }

  $profile = $_SESSION['hybridauth']['profile'];

  if ($form['field_user_name'][$form['field_user_name']['#language']]['#cardinality'] == '1' && isset($profile['displayName'])) {
    $form['field_user_name'][$form['field_user_name']['#language']][0]['value']['#default_value'] = $profile['displayName'];
    hide($form['field_user_name']);
  }
}
rwohleb’s picture

I'm not dead, I swear. I've just been super busy. I'll try to get some work done on this module this weekend.

duozersk’s picture

Hey guys and ladies!

Try this stuff - http://drupal.org/node/1799416 , it is good enough to use ;)

Thanks
AndyB

duozersk’s picture

Please try the 7.x-2.x-dev release - it is working fine and has many tasty features, see #1802840: HybridAuth 7.x-2.x for details.

Thanks
AndyB

henrijs.seso’s picture

me gusta

duozersk’s picture

Status: Postponed » Closed (fixed)

Guys and ladies,

As we have just agreed with Robert (rwohleb) the 7.x-1.x branch is deprecated, please use the 7.x-2.x branch.

Thanks
AndyB