-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfetch_pane_data.php
More file actions
executable file
·46 lines (44 loc) · 1.79 KB
/
fetch_pane_data.php
File metadata and controls
executable file
·46 lines (44 loc) · 1.79 KB
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
<?php
require_once('social_network.php');
if (isset($_GET['id']) && isset($_GET['pane'])) {
$id = $_GET['id'];
$pane = $_GET['pane'];
$_SESSION["pane{$pane}"] = $id;
$sn = sn($id);
if (!isset($_SESSION[$sn->session_variable()])) {
$oauth_url = $sn->oauth_url();
$sign_in_button = $sn->sign_in_button();
$name = $sn->name();
$wstr = "";
$wstr .= "<br/><br/>";
$wstr .= "<a href=\"{$oauth_url}\">";
$wstr .= "<img src=\"{$sign_in_button}\" alt=\"Sign in to {$name}\"/>";
$wstr .= "</a>";
$wstr .= "<br/><br/>";
$wstr .= "We won't access/store your password. You will be redirected to {$name}'s website where you can authenticate Social Photos to give access to your data.";
$wstr .= "<br/><br/><br/>";
$config = array(
"networkId" => $id,
"networkName" => $sn->name(),
"paneId" => $pane,
"albumId" => "-1",
"isWritable" => $sn->is_writable() ? 1 : 0,
"hasAlbums" => $sn->has_albums() ? 1 : 0,
"loggedIn" => 0
);
$retval = array("logged_in" => 0, "data" => $wstr, "config" => $config);
} else {
$config = array(
"networkId" => $id,
"networkName" => $sn->name(),
"paneId" => $pane,
"albumId" => "-1",
"isWritable" => $sn->is_writable() ? 1 : 0,
"hasAlbums" => $sn->has_albums() ? 1 : 0,
"loggedIn" => 1
);
$retval = array("logged_in" => 1, "config" => $config);
}
echo json_encode($retval);
}
?>