Created
November 7, 2013 10:25
-
-
Save anonymous/7352410 to your computer and use it in GitHub Desktop.
Processwire Facebook Login Module permission mod.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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