+
+use CGI;
+use Net::OpenID::Consumer;
+use VJournal::Session;
+
+sub verify {
+ my ($cgi,$consumer)=@_;
+ if (my $setup_url = $csr->user_setup_url) {
+ print $cgi->redirect(-location=>$setup_url);
+ return;
+ } elsif ($csr->user_cancel) {
+ show_error("OpenID server cancelled operation");
+ } elsif (my $vident= $csr->verified_identity) {
+ my $user = $vident->url();
+ # Getting OPENDID extensions from
+ my @extension =grep { defined } (
+ $vident->signed_extension_fields('http://openid.net/extensions/sreg/1.1'),
+ $vident->signed_extension_fields('http://openid.net/srv/ax/1.0'),
+
+ );
+
+ # getting foaf info;
+ my $foaf = $vident->declared_foaf();
+ my ($email,$avatar) = ($foaf?get_foaf($foaf):(undef,undef));
+ my $session = VJournal::Session->create(-cgi=>$cgi,
+ -name => $name, -idenity=>$user);
+ if (!$email) {
+ show_email_form);
+ }
+
+}
+