From 8ac6579f2dd3fe8e4739585dd24df51f3c54e7ac Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Wed, 4 Jul 2012 18:49:11 -0700 Subject: Added yahoo to OpenID logins Added debug email method. Now sending debug email on duplicate emails found in the DB --- pages/login.php | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'pages') diff --git a/pages/login.php b/pages/login.php index bfdf289..49847c4 100644 --- a/pages/login.php +++ b/pages/login.php @@ -5,6 +5,7 @@ if ($_SESSION['accepted'] == 1) { } require 'includes/openid.php'; +include_once 'globe.php'; try { $openid = new LightOpenID; @@ -14,7 +15,14 @@ try { //Are we not logged in? if(!$openid->mode) { - $openid->identity = 'https://www.google.com/accounts/o8/id'; + if (!$_GET['op']) + $openid->identity = 'https://www.google.com/accounts/o8/id'; + if ($_GET['op'] == 'yahoo') + $openid->identity = 'https://me.yahoo.com'; + if ($_GET['op'] == 'google') + $openid->identity = 'https://www.google.com/accounts/o8/id'; + + //$openid->identity = 'https://www.google.com/accounts/o8/id'; header('Location: ' . $openid->authUrl()); } //Did we try to log in, but then the user canceled it? elseif($openid->mode == 'cancel') { @@ -57,6 +65,21 @@ try { //Use the displayname we have on record. $display = mysql_result($result, 0, 'displayName'); + // + //Multiple accounts found? + if (mysql_num_rows($result) > 1) { + $d['page'] = "Login"; + $d['error'] = "Multiple results on lookup"; + $d['rows'] = mysql_num_rows($result); + $d['OpenIDProvider'] = $_GET['op']; + $d['userID'] = $userID; + $d['claimedid'] = $claimedid; + $d['email'] = $email; + $d['display'] = $display; + EmailError($d); + } + // + //TEMPORARY CODE //Check openID; and update it if necessary if (mysql_result($result, 0, 'openID') == $claimedid) { @@ -69,12 +92,13 @@ try { mysql_query($sql); } // - + //I last-see you now! $sql = "UPDATE `users` SET `dateLogin` = NOW() WHERE `ID` = '$userID'"; mysql_query($sql); + } //Well hello there new dude! else { @@ -121,7 +145,7 @@ try { $two = MD5($one.$salt); $three = MD5($pepper.$two); - $expire = time() + (31 * 24 * 60 * 60); + $expire = time() + (6 * 31 * 24 * 60 * 60); setcookie("userID", $userID, $expire); setcookie("doLogin", "yes", $expire); setcookie("auth", $three, $expire); -- cgit v1.2.3