-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
35 lines (33 loc) · 1.02 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
<?php
function __autoload($class)
{
if (file_exists("$class.php")) {
require_once("$class.php");
} else {
die("Autoloader failed to load $class.php");
}
}
session_start();
$mondo = new mondo;
require_once 'config.php';
// everything above this line should be present in all pages
//this needs to be present on pages after the OAuth stage has completed
$mondo->loadSession();
if ($mondo->checkAuthStatus() === true){
header("Location: http://localhost/mondo/example.php");
exit('Already logged in, redirecting...');
}else {
$mondo->_state = $mondo->OAuthCSRF(50);
$_SESSION['state'] = $mondo->_state;
}
?><html>
<head>
<meta charset="UTF-8">
<title>Connect To Mondo</title>
</head>
<body>
<div class="container" style="text-align: center; padding: 25%;">
<p><a href="<?php echo $mondo->_authPageURI; ?>client_id=<?php echo $mondo->_clientID; ?>&redirect_uri=<?php echo $mondo->_redirectURI; ?>&response_type=code&state=<?php echo $mondo->_state; ?>">Click Here</a></p>
</div>
</body>
</html>