Skip to content

Instantly share code, notes, and snippets.

Created November 7, 2013 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7352410 to your computer and use it in GitHub Desktop.
Save anonymous/7352410 to your computer and use it in GitHub Desktop.
Processwire Facebook Login Module permission mod.
// previous code
...
public function execute() {
$app_id = $this->facebookAppId;
$app_secret = $this->facebookAppSecret;
$my_url = $this->page->httpUrl;
$permissions= 'read_friendlists, publish_actions, publish_stream'; // ADDED THIS LINE TO ADD PERMISSIONS
//session_start();
$code = $_REQUEST["code"];
if(empty($code)) {
$_SESSION['state'] = md5(uniqid(rand(), TRUE)); //CSRF protection
$dialog_url = "http://www.facebook.com/dialog/oauth?client_id="
. $app_id . "&redirect_uri=" . urlencode($my_url) . "&state="
. $_SESSION['state'] . "&scope=" . $permissions; // CHAININ PERMISSIONS HERE
...
// code continues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment