diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2013-06-03 02:02:15 -0700 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2013-06-03 02:02:15 -0700 |
commit | 9d7111eb41c77083bff3842e895000d8e4028827 (patch) | |
tree | 804e21a3a878d813e30b4b3344978c4d89443a90 /pages/login.php | |
parent | 1ce392d19fed4b9bb022e4a881c0c385cea2bcdc (diff) | |
download | pathery-9d7111eb41c77083bff3842e895000d8e4028827.tar.xz |
Yahoo gone full-retard patch.
Diffstat (limited to 'pages/login.php')
-rw-r--r-- | pages/login.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/pages/login.php b/pages/login.php index 5bb1d64..d277cb7 100644 --- a/pages/login.php +++ b/pages/login.php @@ -20,8 +20,8 @@ include_once('./includes/HybridAuth/Auth.php'); $hybrid_config_file = 'includes/HybridAuth/HybridAuthConfig.php';
try {
- //Use OpenID for Google/Yahoo
- if (!$_GET['op'] || $_GET['op'] == 'google' || $_GET['op'] == 'yahoo' || $_GET['op'] == 'steam') {
+ //OpenID Method
+ if (!$_GET['op'] || $_GET['op'] == 'google' || $_GET['op'] == 'steam' || $_GET['op'] == 'yahoo') {
$openid = new LightOpenID;
//Require Email, and first name.
@@ -54,6 +54,10 @@ try { $email = $openIdAttributes['contact/email'];
$claimedid = $openid->__get('identity');
+ if ($claimedid == "https://open.login.yahooapis.com/openid20/user_profile/xrds") {
+ die(throwLoginError($openIdAttributes, "Yahoo went full retard, and didn't send any way for me to identify you..."));
+ }
+
if ($email == '') {
$openIdAttributes['op'] = $_GET['op'];
die(throwLoginError($openIdAttributes, "No email provided by OpenID provider - please try a different provider"));
@@ -86,11 +90,23 @@ try { //TODO: This will always fail for Twitter - we need to reconsider our needs...
if($email == '')
{
- $userProfile['op'] = $_GET['op']; //TODO This isn't valid, whoops - but, plan on deleting anyways...
+ //$userProfile['op'] = $_GET['op']; //TODO This isn't valid, whoops - but, plan on deleting anyways...
die(throwLoginError($userProfile, "No email provided by {$authenticator->id} - please try a different provider"));
}
createNewUser($claimedid, $display, $email);
return;
+
+ //HybridAuth's OpenID Method
+// } else if ($_GET['op'] == 'yahoo') {
+// $config = array(
+// "base_url" => $mydomain . "HybridAuth/",
+// "providers" => array ( "OpenID" => array ( "enabled" => true ) )
+// );
+// $ha = new Hybrid_Auth( $config );
+//
+// // Authenticate with Yahoo! then grab the user profile
+// $adapter = $ha->authenticate( "OpenID", array( "openid_identifier" => "https://me.yahoo.com/"));
+// $user_profile = $adapter->getUserProfile();
}
//Unknown provider
|