--- a/include/common-auth.inc.php +++ b/include/common-auth.inc.php @@ -1,33 +1,32 @@ mode) { - $openid->required = array('contact/email'); - $openid->identity = 'https://www.google.com/accounts/o8/id'; - header('Location: ' . $openid->authUrl()); - } - } + +function login() { + global $openid; + if (!$openid->mode) { + $openid->required = array('contact/email'); + $openid->identity = 'https://www.google.com/accounts/o8/id'; + 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(); - } - } -