En cours

Drupal Permissions & Facebook

In my code snippets I am reading a set of variables that identify which roles the currently logged in user has.

If I log in locally, those permissions are properly set. If I log in via Facebook (using the drupal for facebook module), the permissions are not set even though the new permissions are properly recorded in the database.

I need a piece of code that will essentially read the permission information off of the disk and place it into memory. I expect it to be a few lines of php code. The hard part will be finding out exactly where the code should go (probably in the facebook connect module).

My snippet looks like this:

<?php if (in_array('team member', $GLOBALS['user']->roles)): ?>

Some html for team members

<?php elseif (in_array('facebook authorized user', $GLOBALS['user']->roles)): ?>

Some html for Facebook Authorized Users

<?php elseif (in_array('anonymous user', $GLOBALS['user']->roles)): ?>

Some html for Anonymous Users

<?php else : ?>

<p>Your roles are: <?php print_r( $GLOBALS['user']->roles); ?></p>

<?php endif; ?>

<?php print "Current Roles: " . join(":", $GLOBALS['user']->roles); ?>

So, basically, we need to read the permissions from the database (which are correct) into the GLOBALS['user']->roles variable.

The primary related modules that have been put in place are Drupal for Facebook (fb) and Node Access (nodeaccess).

Bob

Compétences : Drupal, MySQL, PHP

Voir plus : drupal globals user roles, drupal php snippets, facebook drupal permission, primary modules, team member roles, snippet, php drupal, globals, roles permissions, code disk, module drupal, drupal user module, permissions php, drupal print, team member, drupal user access, read memory, php user permission, connect node, join facebook, php elseif, php node, users currently logged, memory database, html snippet

Concernant l'employeur :
( 9 commentaires ) Roseville, United States

N° du projet : #1009628

Décerné à :

zgos

please check the pm.

30 $ USD en 0 jours
(13 Commentaires)
4.8

2 freelance ont fait une offre moyenne de 40 $ pour ce travail

zhaozw

hi I can do it for you!

50 $ USD en 1 jour
(11 Commentaires)
4.1