diff options
-rw-r--r-- | globe.php | 4 | ||||
-rw-r--r-- | index.php | 1 | ||||
-rw-r--r-- | js/scores.js | 1 | ||||
-rw-r--r-- | pages/feedback.php | 2 | ||||
-rw-r--r-- | pages/home.php | 1 | ||||
-rw-r--r-- | pages/login.php | 48 |
6 files changed, 34 insertions, 23 deletions
@@ -145,7 +145,7 @@ Function DoRedirect($message = "Thanks", $to = "http://www.pathery.com/", $durat <table>
<tr><td>
<center>$message
- <br />You are now being redirected.
+ <br />You are now being redirected to: $to
<br /><a href='$to'>Click here if not redirected in $duration seconds.</a>
</center>
</td></tr>
@@ -191,4 +191,4 @@ function EmailError($data, $subject = "Pathery Error Report") { Return $mail_sent;
}
-?> +?>
@@ -1,4 +1,5 @@ <?PHP
+ob_start("ob_gzhandler");
//globe will start the session.
include_once("globe.php");
include_once("./includes/header.php");
diff --git a/js/scores.js b/js/scores.js index 81bfa9c..0c1383f 100644 --- a/js/scores.js +++ b/js/scores.js @@ -69,6 +69,7 @@ function scoresShowPage(mapid, page) { //Signify some sort of loadingness?
//Request Page
scoresRequestPage(mapid, page);
+ return;
}
if (typeof(scorePages[mapid][page].html) === 'undefined') {
diff --git a/pages/feedback.php b/pages/feedback.php index 3e10cef..b98cba0 100644 --- a/pages/feedback.php +++ b/pages/feedback.php @@ -41,7 +41,7 @@ if (!$accepted) { echo "
<div class='wrapper'>
Sorry, you must be logged in to use this.
- <br />Please email us instead @ snap@pathery.com
+ <br />Please email us instead @ <a target='top' href='mailto:snap@pathery.com?Subject=Pathery%20Feedback'>snap@pathery.com</a>
</div>";
exit;
}
diff --git a/pages/home.php b/pages/home.php index a9c6b36..ac2518f 100644 --- a/pages/home.php +++ b/pages/home.php @@ -1,5 +1,4 @@ <?php
-ob_start("ob_gzhandler");
include_once ('./includes/maps.php');
include_once ('./includes/mapoftheday.php');
diff --git a/pages/login.php b/pages/login.php index 6918958..92b71fd 100644 --- a/pages/login.php +++ b/pages/login.php @@ -30,8 +30,6 @@ try { //echo 'User has canceled authentication!';
} //We logged in and it worked!
elseif ($openid->validate()) {
- //echo 'User has logged in.';
-
//What's in the goodie bag labeled "personal information"... hmmm
$tmp = $openid->getAttributes();
$display = $tmp['namePerson/first'];
@@ -40,6 +38,11 @@ try { $display = 'noname';
}
$email = $tmp['contact/email'];
+
+ if ($email == '') {
+ $tmp['op'] = $_GET['op'];
+ die(throwLoginError($tmp, "No email provided from OpenID Provider"));
+ }
//print_r ($tmp);
//exit;
$claimedid = $openid->__get('identity');
@@ -65,7 +68,6 @@ try { $display = mysql_result($result, 0, 'displayName');
$dateJoined = mysql_result($result, 0, 'dateJoined');
- // <DEBUG>
//Multiple accounts found?
if (mysql_num_rows($result) > 1) {
$d['page'] = "Login";
@@ -78,7 +80,7 @@ try { $d['display'] = $display;
EmailError($d);
}
- // </DEBUG>
+ // Continue Loging in; should be fine.
//TEMPORARY CODE
//Check openID; and update it if necessary
@@ -110,9 +112,8 @@ try { '".sql_clean($display)."',
'".sql_clean($email)."',
NOW(), NOW())";
- $result = mysql_query($sql) or die(mysql_error());
+ $result = mysql_query($sql);
//Allright, all set.
- //echo "$sql <br /> <br />";
if ($result) {
$userID = mysql_insert_id();
$dateJoined = date(DateTime::ISO8601);
@@ -124,19 +125,11 @@ try { onCompletedTutorial($userID);
}
}
-
- } //Oh crap?
- else {
- $errortext = "<br />new-user db register failure of unknown cause.\n
- <br />Also, there were no monkeys trained or otherwise sent to resolve this problem.\n
- <br />Sorry. youtube offered them more.\n
- <br />Is this issue repeating? Please email me: snap@pathery.com \n
- <br />Debug data:\n
- <br />Result: $result\n
- <br />SQL Used: $sql\n
- <br />MySQL Error:\n";
- $errortext .= mysql_error();
- DoRedirect($errortext, NULL, 10);
+ //Oh crap?
+ } else {
+ $d['sqlError'] = mysql_error();
+ $d['result'] = $result;
+ throwLoginError($d, "Unknown DB Registration failure");
exit;
}
}
@@ -175,4 +168,21 @@ try { } catch(ErrorException $e) {
echo $e->getMessage();
}
+
+function throwLoginError($data, $explination) {
+ $randCode = rand(10000, 99999);
+ $errortext = "<br />Error; $explination \n
+ <br />The error details have been emailed to the administrator.
+ <br />If this problem continues; please email me:
+ <a target='top' href='mailto:snap@pathery.com?Subject=Pathery%20Login%20Error%20$randCode'>
+ snap@pathery.com
+ </a>
+ <br />Your error code is: $randCode
+ <br />";
+ $errortext .= mysql_error();
+ DoRedirect($errortext, NULL, 500);
+ $data['explination'] = $explination;
+ $data['randCode'] = $randCode;
+ EmailError($data);
+}
?>
|