top.location.href='" . $auth_url . "'"); } else { // need to store this somewhere, if user_id = admin // and they've just granted permissions $access_token = $data["oauth_token"]; } /* should not store in user_meta - need to store as an option * If a wp_user id was passed in, that lets us know they came from wp * And they are the $target_admin of the FB app, so we should store their ID */ if ((isset($_REQUEST["wp_user"])) && ($data["user_id"] == $target_admin)) { update_option('wpbook_user_access_token',$access_token); } ?>