+ else {
+ if((x($_POST,'openid_url')) && strlen($_POST['openid_url'])) {
+
+ $noid = get_config('system','no_openid');
+
+ $openid_url = trim($_POST['openid_url']);
+
+ // validate_url alters the calling parameter
+
+ $temp_string = $openid_url;
+
+ // if it's an email address or doesn't resolve to a URL, fail.
+
+ if(($noid) || (strpos($temp_string,'@')) || (! validate_url($temp_string))) {
+ $a = get_app();
+ notice( t('Login failed.') . EOL);
+ goaway($a->get_baseurl());
+ // NOTREACHED
+ }
+
+ // Otherwise it's probably an openid.
+
+ require_once('library/openid.php');
+ $openid = new LightOpenID;
+ $openid->identity = $openid_url;
+ $_SESSION['openid'] = $openid_url;
+ $a = get_app();
+ $openid->returnUrl = $a->get_baseurl() . '/openid';