From 3d6790614bb0dc776e02a95835e5c274263d1d1a Mon Sep 17 00:00:00 2001
From: Luke Shumaker
Currently logged in as '.$_SESSION['user'].'.
+ + '; + } +} else { + // not already logged in + try { + if(!isset($_GET['openid_mode'])) { + if(isset($_POST['openid_identifier'])) { + $openid = new LightOpenID; + $openid->identity = $_POST['openid_identifier']; + header('Location: ' . $openid->authUrl()); + } + $auth_html.=' + + '; + } elseif($_GET['openid_mode'] == 'cancel') { + $auth_html.='User has canceled authentication!
'; + } else { + $openid = new LightOpenID; + if ($openid->validate()) { + // is logged in + global $users; + include_once('passwd.php'); + if (in_array($openid->identity,$users)) { + $_SESSION['user']=$openid->identity; + $auth_html.='Welcome, '.$_SESSION['user'].'!
'; + } else { + $auth_html.='Authentication was successful, but '.$openid->identity.' is not an authorized user.
'; + } + } else { + // is not logged in + $auth_html.='User '.$openid->identity.' is not logged in
'; + } + } + } catch(ErrorException $e) { + $auth_html.=$e->getMessage(); + } +} +// END AUTH CODE /////////////////////////////////////////////////////////////// -- cgit v1.2.3-2-g168b