| 1 | #!/usr/bin/perl |
|---|
| 2 | use strict; |
|---|
| 3 | use warnings; |
|---|
| 4 | use CGI::Carp qw(fatalsToBrowser); |
|---|
| 5 | use lib qw( |
|---|
| 6 | /home/danjou/apps/openid4u/lib |
|---|
| 7 | /home/danjou/local/lib/perl5 |
|---|
| 8 | ); |
|---|
| 9 | use CGI; |
|---|
| 10 | use Openid4u::User; |
|---|
| 11 | |
|---|
| 12 | my $cgi = CGI->new; |
|---|
| 13 | my $user = Openid4u::User->new(identity => $ENV{REQUEST_URI}); |
|---|
| 14 | unless ($user) { |
|---|
| 15 | print $cgi->header(-status => 404); |
|---|
| 16 | print <<END; |
|---|
| 17 | <html> |
|---|
| 18 | <head> |
|---|
| 19 | <title>OpenID4U - 404 Not Found</title> |
|---|
| 20 | <meta http-equiv="Content-Style-Type" content="text/css"> |
|---|
| 21 | <meta http-equiv="Script-Style-Type" content="text/javascript"> |
|---|
| 22 | <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> |
|---|
| 23 | </script> |
|---|
| 24 | <script type="text/javascript"> |
|---|
| 25 | _uacct = "UA-2752563-1"; |
|---|
| 26 | urchinTracker(); |
|---|
| 27 | </script> |
|---|
| 28 | <link rel="stylesheet" href="/css/base.css" type="text/css" media="all"> |
|---|
| 29 | </head> |
|---|
| 30 | <body> |
|---|
| 31 | <h1><a href="/">openid4u</a></h1> |
|---|
| 32 | <div id="content"> |
|---|
| 33 | <div class="prompt"> |
|---|
| 34 | No ID seems to be associated with this URL. |
|---|
| 35 | </div> |
|---|
| 36 | </div> |
|---|
| 37 | <address><a href="http://soffritto.org/">Soffritto Inc.</a></address> |
|---|
| 38 | </body> |
|---|
| 39 | </html> |
|---|
| 40 | END |
|---|
| 41 | exit 0; |
|---|
| 42 | } |
|---|
| 43 | my $name = $user->name; |
|---|
| 44 | my $type = $user->type; |
|---|
| 45 | my $url = $user->url; |
|---|
| 46 | print $cgi->header; |
|---|
| 47 | print <<END; |
|---|
| 48 | <html> |
|---|
| 49 | <head> |
|---|
| 50 | <title>OpenID4U - ${name} from ${type}</title> |
|---|
| 51 | <link rel="openid.server" href="http://openid4u.net/server.cgi" /> |
|---|
| 52 | <link rel="openid2.provider" href="http://openid4u.net/server.cgi" /> |
|---|
| 53 | <meta http-equiv="X-XRDS-Location" content="http://openid4u.net/signon.xrds" /> |
|---|
| 54 | <meta http-equiv="Content-Style-Type" content="text/css"> |
|---|
| 55 | <meta http-equiv="Script-Style-Type" content="text/javascript"> |
|---|
| 56 | <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> |
|---|
| 57 | </script> |
|---|
| 58 | <script type="text/javascript"> |
|---|
| 59 | _uacct = "UA-2752563-1"; |
|---|
| 60 | urchinTracker(); |
|---|
| 61 | </script> |
|---|
| 62 | <link rel="stylesheet" href="/css/base.css" type="text/css" media="all"> |
|---|
| 63 | </head> |
|---|
| 64 | <body> |
|---|
| 65 | <h1><a href="/">openid4u</a></h1> |
|---|
| 66 | <div id="content"> |
|---|
| 67 | <div class="prompt"> |
|---|
| 68 | This is openid identity page for ${name} from ${type}.<br /> |
|---|
| 69 | More informations may be found at the url below. |
|---|
| 70 | </div> |
|---|
| 71 | <ul> |
|---|
| 72 | <li><a href="$url">$url</a> |
|---|
| 73 | </ul> |
|---|
| 74 | </div> |
|---|
| 75 | <address><a href="http://soffritto.org/">Soffritto Inc.</a></address> |
|---|
| 76 | </body> |
|---|
| 77 | </html> |
|---|
| 78 | END |
|---|