Facebook connect has a neat feature that alllows a user to login to a Drupal site without creating an account. However we are using the terms of use module with the checkbox validate and when it is turned on the FB connect gives an erro because of course it needs to be accepted Is there a way to make this work with FB connect, like add a pop up or something someone can accept The maintainer is helpful but he needs more info about this module. Would be happy to offer up so cash to get this to work.
Cheers

Comments

dmadruga’s picture

Hey venusrising,

did you find out a solution for this issue? I'm facing exactly the same problem.

cheers~~

kars-t’s picture

Priority: Normal » Major
Status: Active » Needs work

Hi,

this is a major thing to do. But currently I have no solution to offer...

kars-t’s picture

Status: Needs work » Postponed

Problem is time. This is a bad thing and a difficult task. But imo the facebook module should have some implemenation for this as well and two modules need to be fixed. Sadly I don't have enough time to organise that.

z.stolar’s picture

@Kars-T: will you accept a solution in which a test is added in each initialization of a user/page?
A user who hasn't check the terms of use, will have to do it post-login.

This means adding something like hook_user or hook_init, that checks the signature status and pops up a message/page to re-sign the terms of use.

kars-t’s picture

Hi z.stolar,

I accept anything that is cool ;)

But I can't follow you here. Doesn't this go into the direction of "If the terms change a user has to agree again"?

I don't see a direct connection to FB. Or do you mean to disable the checkbox at login?

z.stolar’s picture

I guess it does go into that category ("If the terms change a user has to agree again"). But if I'm not mistaken:

a. This is not implemented yet (thought planned - can we back port it from any dev version?)
b. when registering through FB, you immediately log in, so in fact you won't see the TOU until your next login, which can be weeks from "now".

venusrising’s picture

What if the Terms of Use Module could be made to pop up, that way it would need to be accepted to proceed and would not cause the login form to fail when using facebook connect

venusrising’s picture

Status: Postponed » Active

Anyone come up with any ideas? just checking back in.

z.stolar’s picture

We solved it this way:
Each user who's registering through the normal Drupal form is assigned to a certain role. A facebook user is not getting this role.
Our module uses hook_init to check this role, and pops up the TOU, until the FB user checks it.

Simple, but does the work

kars-t’s picture

Status: Active » Postponed

Hi,

please don't set this issue to active if there is no patch or work done.

Cheers,

Karsten

venusrising’s picture

Status: Postponed » Active

z.stolar would love to know how in more detail you got the above to work. We tried the legal module and it works with facebook connect as it does not add itself to the login form. It works well in that after you use Facebook Connect fast login it pops up the terms then allow you to proceed. The cool thing about the terms module though is it's light weight and simplicity. Be happy to test solutions if anyone has any ideas. I am not a coder but can test on a dev site.

venusrising’s picture

The legal module works with Facebook Connect. We are just having an issue with that as it creates the TOC page at /legal and we have a /legal page so it does an infinite loop. Wondering if the logic in legal would work with terms

venusrising’s picture

Status: Active » Closed (fixed)

Legal module works with Facebook connect being set to fast registration with auto login. Works with Manual

kars-t’s picture

Status: Closed (fixed) » Postponed

Okay nice the legal module does this but still this issue can be left open for terms of use.

venusrising’s picture

Sorry, didn't mean to close it. Also wondering if anything in legal would give a hint to terms as it is a great and nice module to use.

kars-t’s picture

Sure it would do but the greatest evil is always the lack of time -_-

venusrising’s picture

I hear ya.

ron2x80’s picture

this might work with fbconnect

function _terms_of_use_validate_checkbox($form, &$form_state) {
  if($_GET['q']=='user/register'){ // <-- add this condition 
    $value = $form_state['values']['terms_of_use'];
    if ($value == 0) {
      form_set_error('terms_of_use', t('You must agree with the !terms to get an account.', array('!terms' => filter_xss(tou_i18nstrings('fieldset_name', variable_get('terms_of_use_fieldset_name', t('Terms of Use')))))));
    }
  }
}

mvbrandi’s picture

Please #18, I am not a php coder. Can you tell me where I have do paste this code? And somebody have tested? It works?

jelo’s picture

Given all the Single Sign On developments, this problem will probably come up a lot more often. I work for a university and we make use of the university authentication procedures. Similarly to this issue, users never have to register because they will always have an account already which is not the Drupal account. However, they have to accept Terms of Use for different applications (that are build in Drupal) so that it would be great if this module could be extended to trigger upon registration OR first login OR changes to the terms.

Jens

chris_car’s picture

Subscribing

tpainton’s picture

There is a hook in Drupal for Facebook, hook_fb().. The implentation of it can be found in fb_user_fb() line 113 of fb_user.module. This hook can be called after a user account is created using the $op, FB_USER_OP_POST_USER.. I am going to implement this into my own module and see if it works.. If it does, I'll paste the code here and it should easily be able to be added as a hook to this module. I tried to do this with Legal module, but the drupal_goto() calls a rather elaborate url to get to the legal page, and I did not care to try and decrypt it.. This goto call will be very easy.. I'll be back soon hopefully with a simple working fix for Drupal for Facebook..

tpainton’s picture

Ah heck.. I knew this was too easy.. I now see how the module works.. using facebook connect, you don't ever get to the user registration page.... I had hoped you could redirect user to a dedicated page with the checkbox.. This should be quite possible though.. Simply create a form with the terms, and when checked it saves it to the appropriate profile record.. I may have to have a stab at this. If I get it working, I'll let you know.

tpainton’s picture

I just looked over the module.. A few things stick out to me. I could try a rewrite that would allow the module to interact with Drupal for Facebook.. It would be a major rewrite because we need a seperate page that users get redirected to if they use Facebook Connect. That is easy enough really. I REALLY need a Terms and Conditions for my Facebook Drupal App and noone is even entertaining it. I think I am going to start cracking at this.. If you like the outcome great.. if not, then at least I'll have something to use.

tpainton’s picture

I actually just tried the Agreement module and although not as feature rich, it works very smoothly with the Drupal For Facebook, Facebook Connect feature, so I will probably not pursue this.

kars-t’s picture

Status: Postponed » Closed (won't fix)