-
Notifications
You must be signed in to change notification settings - Fork 3
/
showcase_data.php
51 lines (45 loc) · 1.59 KB
/
showcase_data.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
include 'init.php';
include 'header.php';
$cookie = get_facebook_cookie($session->instance['fb_app_id'], $session->instance['fb_app_secret']);
?>
<div id="content">
<h1>Which data I can get from the App-Arena Session?</h1>
<h2>Decoded Signed Request ($session->fb_api)</h2>
<?php Zend_Debug::dump($session->fb_api, "FB API: "); ?>
<h2>Fanpage Data ($session->fb_page)</h2>
<?php Zend_Debug::dump($session->fb_page, "Page: "); ?>
<h2>User Data ($session->user)</h2>
<?php Zend_Debug::dump($session->user, "User: "); ?>
<h2>Data about the Instance ($session->instance)</h2>
<?php Zend_Debug::dump($session->instance, "Instance: ");?>
<h2>All config values ($session->config)</h2>
<?php Zend_Debug::dump($session->config, "Config: ");?>
<h2>All the Design data ($session->design)</h2>
<?php Zend_Debug::dump($session->design, "Design: ");?>
<h2>All the content ($session->content)</h2>
<?php Zend_Debug::dump($session->content, "Content: ");?>
<h2>Facebook Cookie</h2>
<?php Zend_Debug::dump($cookie, "Facebook-Cookie: ");?>
</div>
<?
//Get Facebook Cookie
function get_facebook_cookie($app_id, $app_secret) {
$args = array();
if (!isset($_COOKIE['fbs_' . $app_id]))
return NULL;
parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args);
ksort($args);
$payload = '';
foreach ($args as $key => $value) {
if ($key != 'sig') {
$payload .= $key . '=' . $value;
}
}
if (md5($payload . $app_secret) != $args['sig']) {
return null;
}
return $args;
}
include 'footer.php';
?>