Only login to website using Facebook, except admin
Hello, new here!
I have Drupal 6.x with the Facebook stuff setup and working. I can associate Facebook accounts with Drupal accounts and such. I have an app setup too. The question I have is probably a Drupal hook question, but I thought I would ask here first.
I want to make it so that if you go to the website (not in Facebook) and you are a "user" then the page would direct you to the facebook portal on login. If you are a developer then it would let you login in either location. That way the developer/admin can use all the features of the interface on my website, but if it is a user then it would automagically put them in facebook. I am guessing there is a hook of some sort my module needs to attach to for this behaviour. I know I can do this in php on each page, but I want global behaviour.
Thanks,
Frank
- Forums:

I think I'd write a module
I think I'd write a module implementing hook_fb, with some code vaguely like...
/**
* Implementation of hook_fb.
*/
function example_fb($op, $data, &$return) {
if ($op == FB_OP_POST_INIT) {
if (!fb_is_canvas()) {
drupal_goto('http://apps.facebook.com/' . $data['fb_app']->canvas . '/' . $_GET['q']);
}
}
}
No idea if that will work. But please share what you end up using.