aboutsummaryrefslogtreecommitdiffstats
path: root/mod/rmagic.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/rmagic.php')
-rw-r--r--mod/rmagic.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/mod/rmagic.php b/mod/rmagic.php
index 093ccd328..946277327 100644
--- a/mod/rmagic.php
+++ b/mod/rmagic.php
@@ -23,12 +23,20 @@ function rmagic_init(&$a) {
function rmagic_post(&$a) {
$address = trim($_REQUEST['address']);
- $other = intval($_REQUEST['other']);
- if($other) {
+ if(strpos($address,'@') === false) {
$arr = array('address' => $address);
call_hooks('reverse_magic_auth', $arr);
+ try {
+ require_once('library/openid/openid.php');
+ $openid = new LightOpenID(z_root());
+ $openid->identity = $address;
+ $openid->returnUrl = z_root() . '/openid';
+ goaway($openid->authUrl());
+ } catch (Exception $e) {
+ notice( t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.').'<br /><br >'. t('The error message was:').' '.$e->getMessage());
+ }
// if they're still here...
notice( t('Authentication failed.') . EOL);