From 3d6790614bb0dc776e02a95835e5c274263d1d1a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Nov 2011 11:22:36 -0500 Subject: This zip file was identified as ltshell-3.zip --- shell/login.php | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 shell/login.php (limited to 'shell/login.php') diff --git a/shell/login.php b/shell/login.php new file mode 100644 index 0000000..eff6eca --- /dev/null +++ b/shell/login.php @@ -0,0 +1,59 @@ +'.$_SESSION['user'].' is now logged out

'; + $_SESSION['user']=''; + } else { + $auth_html.=' +

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.=' +
+ OpenID: +
+ '; + } 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