From be3111dc6f3d0a4a6ee5662d3551c7fb8e9bac58 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Fri, 6 Sep 2013 12:22:53 -0400 Subject: [PATCH 1/2] add error control for openid on registration. fix #729 --- include/user.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/user.php b/include/user.php index 6f4ab30215..220d3d8c8b 100644 --- a/include/user.php +++ b/include/user.php @@ -60,7 +60,13 @@ function create_user($arr) { $openid->returnUrl = $a->get_baseurl() . '/openid'; $openid->required = array('namePerson/friendly', 'contact/email', 'namePerson'); $openid->optional = array('namePerson/first','media/image/aspect11','media/image/default'); - goaway($openid->authUrl()); + try { + $authurl = $openid->authUrl(); + } catch (Exception $e){ + $result['message'] .= t('Error:').$e->getMessage() . EOL . t('Check your OpenID url') . EOL; + return $result; + } + goaway($authurl); // NOTREACHED } From 3ebc5d1c80bac252030bcad662713a9b39af8ee6 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Fri, 6 Sep 2013 12:30:10 -0400 Subject: [PATCH 2/2] update error message to login one --- include/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/user.php b/include/user.php index 220d3d8c8b..23023abd65 100644 --- a/include/user.php +++ b/include/user.php @@ -63,7 +63,7 @@ function create_user($arr) { try { $authurl = $openid->authUrl(); } catch (Exception $e){ - $result['message'] .= t('Error:').$e->getMessage() . EOL . t('Check your OpenID url') . EOL; + $result['message'] .= t("We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID."). EOL . EOL . t("The error message was:") . $e->getMessage() . EOL; return $result; } goaway($authurl);