<?php |
<?php |
require $basePath.'lib/openid.php'; |
|
$openid = new LightOpenID($_SERVER['HTTP_HOST']); |
require ROOT . '/../lib/openid.php'; |
|
$openid = new LightOpenID($_SERVER['HTTP_HOST']); |
function login() |
|
{ |
function login() { |
global $openid; |
global $openid; |
if(!$openid->mode) { |
if (!$openid->mode) { |
$openid->required = array('contact/email'); |
$openid->required = array('contact/email'); |
$openid->identity = 'https://www.google.com/accounts/o8/id'; |
$openid->identity = 'https://www.google.com/accounts/o8/id'; |
header('Location: ' . $openid->authUrl()); |
header('Location: ' . $openid->authUrl()); |
} |
} |
} |
} |
|
|
|
function auth() { |
|
if ($_SESSION['authed'] == true) |
|
return true; |
|
global $openid; |
|
|
|
if ($openid->mode) { |
|
$attr = $openid->getAttributes(); |
|
if ($attr['contact/email'] != 'maxious@gmail.com') { |
|
die('Access Denied'); |
|
} else { |
|
$_SESSION['authed'] = true; |
|
} |
|
} else { |
|
login(); |
|
} |
|
} |
|
|
|
|
function auth() |
|
|
|
{ |
|
if ($_SESSION['authed'] == true) return true; |
|
global $openid; |
|
|
|
if($openid->mode) { |
|
$attr = $openid->getAttributes(); |
|
if ($attr["contact/email"] != "maxious@gmail.com") { |
|
die("Access Denied"); |
|
} else { |
|
$_SESSION['authed'] = true; |
|
} |
|
} else { |
|
login(); |
|
} |
|
} |
|
?> |
|