-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
57 lines (49 loc) · 1.73 KB
/
index.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
52
53
54
55
56
57
<!doctype html>
<html xmlns:fb="http://ogp.me/ns/fb#">
<html>
<meta property="og:url" content="http://routebook.pe.kr/" />
<head>
<meta charset="UTF-8">
<title>Routebook Login Page</title>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
//초기화
FB.init({
appId : '113773748780990', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
//페이지 로드 했을시 호출
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
FB.api('/me', function(user) {
if (user) {
location.href = "main.php?uId=" + user.id;
}
});
} else if (response.status === 'not_authorized') {
// the user is logged in to Facebook,
// but has not authenticated your app
location.href = "home.php";
} else {
// the user isn't logged in to Facebook.
location.href = "home.php";
}
});
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/ko_KR/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
//end Load the SDK Asynchronously
</script>
</body>
</html>