Skip to content

Instantly share code, notes, and snippets.

@dorkitude
Created July 12, 2011 23:38
Show Gist options
  • Select an option

  • Save dorkitude/1079432 to your computer and use it in GitHub Desktop.

Select an option

Save dorkitude/1079432 to your computer and use it in GitHub Desktop.
<?
public function getOAuthUrl($currentUrl = null, $permissions = array()) {
if ($currentUrl == null) {
$currentUrl = $this->getCurrentUrl();
}
$perm_string = '';
if (!empty($permissions)) {
$perm_string = '&scope='.implode(',',$permissions);
}
return "http://www.facebook.com/dialog/oauth?client_id="
. $this->getAppId()
. $perm_string
. "&redirect_uri=" . urlencode($currentUrl);
}
//and we usually ask for email,stream permissions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment