summaryrefslogtreecommitdiffstats
path: root/pages
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2012-07-04 18:49:11 -0700
committerPatrick Davison <snapwilliam@gmail.com>2012-07-04 18:49:11 -0700
commit8ac6579f2dd3fe8e4739585dd24df51f3c54e7ac (patch)
tree2359be44118816bca335e7b2cd055eae982602d9 /pages
parentc531d9d66d430df9c9a043ddc3f7c4c10fcfaab4 (diff)
downloadpathery-8ac6579f2dd3fe8e4739585dd24df51f3c54e7ac.tar.xz
Added yahoo to OpenID logins
Added debug email method. Now sending debug email on duplicate emails found in the DB
Diffstat (limited to 'pages')
-rw-r--r--pages/login.php30
1 files changed, 27 insertions, 3 deletions
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');
+ // <DEBUG>
+ //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);
+ }
+ // </DEBUG>
+
//TEMPORARY CODE
//Check openID; and update it if necessary
if (mysql_result($result, 0, 'openID') == $claimedid) {
@@ -69,12 +92,13 @@ try {
mysql_query($sql);
}
// </TEMPORARY CODE>
-
+
//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);