summaryrefslogtreecommitdiffstats
path: root/pages/login.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2011-09-09 16:55:14 -0700
committerPatrick Davison <snapwilliam@gmail.com>2011-09-09 16:55:14 -0700
commitc37113c2666d65015f967b6cf1a5d2e8836d920d (patch)
treef99cdc2b52e87741cb08d1fcc7ecec729a9cfab5 /pages/login.php
parentf9333b70547ae514ecc848fb195011a11897ee68 (diff)
downloadpathery-c37113c2666d65015f967b6cf1a5d2e8836d920d.tar.xz
changes to pathery.com
Diffstat (limited to 'pages/login.php')
-rw-r--r--pages/login.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/pages/login.php b/pages/login.php
index c730846..1c16fe8 100644
--- a/pages/login.php
+++ b/pages/login.php
@@ -39,7 +39,9 @@ try {
//I know just where to put this stuff!
require './includes/db.inc.php';
//Unless I already have this information...
- $sql = "SELECT `ID`, `isAdmin` FROM `users` WHERE `openID` = '$claimedid'";
+ //* Modify this to WHERE `email`
+ $sql = "SELECT `ID`, `isAdmin`, `openID` FROM `users` WHERE `email` = '$email'";
+ //$sql = "SELECT `ID`, `isAdmin` FROM `users` WHERE `openID` = '$claimedid'";
$result = mysql_query($sql);
$_SESSION['isAdmin'] = false;
@@ -51,6 +53,19 @@ try {
if (mysql_result($result, 0, 'isAdmin') == 1)
$_SESSION['isAdmin'] = true;
+ //TEMPORARY CODE
+ //Check openID; and update it if necessary
+ if (mysql_result($result, 0, 'openID') == $claimedid) {
+ //Don't need to do anything
+ } else {
+ //Update the OpenID Code
+ $sql = "UPDATE `users`
+ SET `openID` = '$claimedid'
+ WHERE `ID` = '$userID'";
+ mysql_query($sql);
+ }
+ // </TEMPORARY CODE>
+
//I last-see you now!
$sql = "UPDATE `users`
SET `dateLogin` = NOW()
@@ -96,7 +111,7 @@ try {
$two = MD5($one.$salt);
$three = MD5($pepper.$two);
- $expire = time() + (7 * 24 * 60 * 60);
+ $expire = time() + (31 * 24 * 60 * 60);
setcookie("userID", $userID, $expire);
setcookie("doLogin", "yes", $expire);
setcookie("auth", $three, $expire);