Skip to content

Instantly share code, notes, and snippets.

@colmdoyle
Created November 27, 2012 21:51
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 colmdoyle/4157347 to your computer and use it in GitHub Desktop.
Save colmdoyle/4157347 to your computer and use it in GitHub Desktop.
Don't allow other pages to install my tab app.
<?php
$app_secret = 'APPSECRET';
$signed_request = parse_signed_request($_REQUEST['signed_request'], $app_secret);
$page_whitelist = array(PAGEID1, PAGEID2);
if (in_array($signed_request['page']['id'], $page_whitelist)) {
// do stuff
} else {
// output some error message
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment