diff --git a/trunk/locale/en-us.xml b/trunk/locale/en-us.xml
index 2cbaf9d..2e3288a 100755
--- a/trunk/locale/en-us.xml
+++ b/trunk/locale/en-us.xml
@@ -60,6 +60,11 @@
You passed no query string.
Your browser does not support Ogg Theora video playback.
There is no video matching your request
+ The provided URL doesn't declare its OpenID identity server
+ No URL entered
+ Invalid URL
+ URL provided doesn't seem to have a head tag
+ Error fetching the provided URL
diff --git a/trunk/login.pl b/trunk/login.pl
index c0e7da9..f548b0f 100644
--- a/trunk/login.pl
+++ b/trunk/login.pl
@@ -25,7 +25,7 @@ elsif($userinfo->{'username'})
print output_page();
}
-#if password is empty and username begins with http:// or ret is specified, then it's an openid login
+#if password is empty and username begins with http:// then it's an openid login
elsif($query->param('pass') eq '' and $query->param('user')=~m/^http:\/\//)
{
#create our openid consumer object
@@ -43,23 +43,17 @@ elsif($query->param('pass') eq '' and $query->param('user')=~m/^http:\/\//)
$claimed = $con->claimed_identity($query->param('user'));
if(!defined($claimed))
{
- print $session->header();
- print "claim failed: ", $con->err;
+ print $query->redirect("/index.pl?error=error_openid_".$con->errcode);
}
-
- #try to set the check_url
- eval
+ else
{
+ #try to set the check_url
$check_url = $claimed->check_url(
return_to => "$domain/login.pl?action=openid", #on success return to this address
trust_root => $domain); #this is the string the user will be asked to trust
#redirect to openid server to check claim
print $query->redirect($check_url);
- };
- #if this fails
- if ($@) {
- print $query->redirect("/index.pl?error=error_202c");
}
}
else
@@ -89,8 +83,7 @@ elsif($query->param('action') eq 'openid')
elsif ($con->user_cancel)
{
#cancelled - redirect to login form
- print $session->header();
- print "cancelled";
+ print $query->redirect("index.pl");
}
elsif ($vident = $con->verified_identity)
{
@@ -117,7 +110,7 @@ elsif($query->param('action') eq 'openid')
{
#an error occured
print $session->header();
- print "error validating identity: ", $con->err;
+ print "error validating identity: ", $con->errcode;
}
}
#else it's a normal login