-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
96 lines (83 loc) · 2.32 KB
/
login.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
require 'header.php';
require_once 'fb-phpsdk/facebook.php';
?>
<!DOCTYPE html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>FriendzOnMap</title>
<link rel="stylesheet" href="media/css/style.css" type="text/css" media=screen>
<style type="text/css">
.fbButton {
display:block;
width:392px;
height:53px;
/*text-indent:-9999px;*/
background:url('media/img/facebook_login_button.png') no-repeat top left;
outline:none;
}/*
.fbButton a{
display:block;
width:100%;
height:100%;
}
.fbButton a:hover {
background-position:0 -50px;
}*/
</style>
</head>
<body>
<div class="header">
Friendz on Map
</div>
<div class="content">
<?php if ($user){ ?>
<?php //echo $_SERVER['HTTP_HOST']; ?>
<script type="text/javascript">
window.location = '<?php echo $loginUrl ?>';//'http://<?php echo $_SERVER["HTTP_HOST"];?>/main.php';//"http://friendz.con:5000/fbfomdev/main.php";
</script>
<?php }else{ ?>
<div class= "innercontent">
<p class="writcontent">Track your friends on Facebook</p>
<br/>
<br/>
<p class="fbButton" onClick="fbLogin()"></p>
</div>
<!--<img src='media/img/facebook_login_button.png'/> -->
<?php } ?>
</div>
<div class="footer">
Friendz on Map
</div>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: '<?php echo $facebook->getAppID() ?>',
cookie: true,
xfbml: true,
oauth: true
});
FB.Event.subscribe('auth.login', function(response) {
window.location.reload();
});
FB.Event.subscribe('auth.logout', function(response) {
window.location.reload();
});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
<script type="text/javascript">
function fbLogin(){
window.location ='<?php echo $loginUrl; ?>';
}
</script>
</body>
</html>