You are here

function fb_user_nodeapi in Drupal for Facebook 5

File

./fb_user.module, line 544
This module allows Drupal user records to be associated with Facebook user ids. It can create local user accounts when Facebook users visit an application's canvas pages.

Code

function fb_user_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  if ($op == 'view' && $node->type == 'fb_app') {

    //dpm(func_get_args(), 'fb_user_nodeapi');
    if (user_access('administer fb apps')) {
      $fb_app = $node->fb_app;
      $add_url = fb_user_get_map_url($fb_app);
      $output = theme('dl', array(
        t('Post-add URL') => "http://apps.facebook.com/{$fb_app->canvas}/" . FB_USER_POST_ADD_PATH . "?redirect=",
        t('Post-remove URL') => url(FB_SETTINGS_APP_NID . '/' . $node->nid . '/' . FB_USER_POST_REMOVE_PATH, NULL, NULL, TRUE),
        t('Add URL') => $add_url ? $add_url . '<br/>' . t('(Send an authenticated user to this URL so that local account will be authmapped to facebook account.)') : t('none'),
      ));
      $node->content['fb_user'] = array(
        '#value' => $output,
        '#weight' => 2,
      );
    }
  }
}