From 596c0b3a70550801b413f0a77168462cbfd4f801 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Mon, 1 Dec 2008 21:08:42 +0100 Subject: added dependencies --- Build.PL | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Build.PL b/Build.PL index a7c1ff5..7221c81 100644 --- a/Build.PL +++ b/Build.PL @@ -6,16 +6,16 @@ use 5.010; my $builder = Module::Build->new( module_name => 'PAUSE-OpenID', license => 'perl', - dist_author => 'Thomas Klausner', + dist_author => 'Vienna.pm', dist_version_from => 'lib/PAUSE/OpenID.pm', - build_requires => { - 'Test::More' => 0, + build_requires => { 'Test::More' => 0, }, + requires => { + 'perl' => '5.010', + 'Catalyst::Runtime' => '5.7014', + 'Net::OpenID::Server' => '1.02', }, - requires => { - 'perl' => '5.010', - }, - add_to_cleanup => ['PAUSE-OpenID-*'], - create_makefile_pl => 'passthrough', + add_to_cleanup => ['PAUSE-OpenID-*'], + create_makefile_pl => 'passthrough', recursive_test_files => 1, ); -- cgit v1.2.3 From 952ba98235a81ba25c7efc66b274753ddc809839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Kr=F6ll?= Date: Mon, 1 Dec 2008 21:12:27 +0100 Subject: Dummy XSLT view --- .project | 22 +++++++++++++++++++ lib/PAUSE/OpenID/View/XSLT.pm | 50 +++++++++++++++++++++++++++++++++++++++++++ t/view_XSLT.t | 6 ++++++ 3 files changed, 78 insertions(+) create mode 100644 .project create mode 100644 lib/PAUSE/OpenID/View/XSLT.pm create mode 100644 t/view_XSLT.t diff --git a/.project b/.project new file mode 100644 index 0000000..be204ee --- /dev/null +++ b/.project @@ -0,0 +1,22 @@ + + + PAUSE-OpenID + + + + + + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, + + + LaunchConfigHandle + <project>/.externalToolBuilders/org.epic.perleditor.perlbuilder (2).launch + + + + + + org.epic.perleditor.perlnature + + diff --git a/lib/PAUSE/OpenID/View/XSLT.pm b/lib/PAUSE/OpenID/View/XSLT.pm new file mode 100644 index 0000000..4e2ab2a --- /dev/null +++ b/lib/PAUSE/OpenID/View/XSLT.pm @@ -0,0 +1,50 @@ +package PAUSE::OpenID::View::XSLT; + +use strict; +use base 'Catalyst::View::XSLT'; + +# example configuration + +__PACKAGE__->config( + # relative paths to the directories with templates + INCLUDE_PATH => [ + MyApp->path_to( 'root', 'xslt' ), + MyApp->path_to( 'templates', 'xsl' ), + ], + TEMPLATE_EXTENSION => '.xsl', # default extension when getting template name from the current action + DUMP_CONFIG => 1, # use for Debug. Will dump the final (merged) configuration for XSLT view + #LibXSLT => { # XML::LibXSLT specific parameters + # register_function => [ + # { + # uri => 'urn:catalyst', + # name => 'Hello', + # subref => sub { return $_[0] }, + # } + # ], + #}, +); + +=head1 NAME + +PAUSE::OpenID::View::XSLT - XSLT View Component + +=head1 SYNOPSIS + + See L + +=head1 DESCRIPTION + +Catalyst XSLT View. + +=head1 AUTHOR + +Michael Kr�ll,,, + +=head1 LICENSE + +This library is free software . You can redistribute it and/or modify it under +the same terms as perl itself. + +=cut + +1; diff --git a/t/view_XSLT.t b/t/view_XSLT.t new file mode 100644 index 0000000..e7802be --- /dev/null +++ b/t/view_XSLT.t @@ -0,0 +1,6 @@ +use strict; +use warnings; +use Test::More tests => 1; + +BEGIN { use_ok 'PAUSE::OpenID::View::XSLT' } + -- cgit v1.2.3 From 6afb6f4f0e7daaace34204f00f42c9caead72169 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Mon, 1 Dec 2008 21:32:40 +0100 Subject: added openid server stuff, taken straight from the Net::OpenID::Server docs --- lib/PAUSE/OpenID/Controller/OpenID.pm | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 lib/PAUSE/OpenID/Controller/OpenID.pm diff --git a/lib/PAUSE/OpenID/Controller/OpenID.pm b/lib/PAUSE/OpenID/Controller/OpenID.pm new file mode 100644 index 0000000..1082c20 --- /dev/null +++ b/lib/PAUSE/OpenID/Controller/OpenID.pm @@ -0,0 +1,53 @@ +package PAUSE::OpenID::Controller::OpenID; + +use strict; +use warnings; +use parent 'Catalyst::Controller'; +use Net::OpenID::Server; + + +# taken straight from Net::OpenID::Server +# http://search.cpan.org/src/MART/Net-OpenID-Server-1.02/doc/catalyst_sample +sub index : Local { + my ( $self, $c ) = @_; + + my $server = Net::OpenID::Server->new( + post_args => $c->req->params, + get_args => $c->req->params, + endpoint_url => $c->uri_for('/server'), + setup_url => $c->uri_for('/login'), + get_user => sub { + return $c->user_exists ? $c->user : undef; + }, + get_identity => sub { + my ( $u, $identity ) = @_; + return $identity unless $u; + return $c->uri_for( sprintf( '/user/%s', $u->username ) ); + }, + is_identity => sub { + my ( $u, $identity ) = @_; + return $u && $u->username eq ( split '/', $identity )[-1]; + }, + is_trusted => sub { + my ( $u, $trust_root, $is_identity ) = @_; + return $is_identity; + } + ); + + my ( $type, $data ) = $server->handle_page(); + + if ( $type eq 'redirect' ) { + return $c->res->redirect($data); + } + elsif ( $type eq 'setup' ) { + my $uri = $c->uri_for( '/login', $data ); + return $c->res->redirect($uri); + } + else { + $c->res->content_type($type); + $c->res->body($data); + } + +} + +1; -- cgit v1.2.3 From 3e94bd580a427eb32ccf82a23392e7f4bfc890fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Kr=F6ll?= Date: Mon, 1 Dec 2008 21:35:51 +0100 Subject: Initial version of login page --- root/static/css/default.css | 0 root/templates/index.xsl | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 root/static/css/default.css create mode 100644 root/templates/index.xsl diff --git a/root/static/css/default.css b/root/static/css/default.css new file mode 100644 index 0000000..e69de29 diff --git a/root/templates/index.xsl b/root/templates/index.xsl new file mode 100644 index 0000000..adca9c6 --- /dev/null +++ b/root/templates/index.xsl @@ -0,0 +1,36 @@ + + + + + + + + + + + Sign in with OpenID + + + + +

The website '' wants to verify your PAUSE identity.

+
+
+ + + + + + +
+
+ + +
+
-- cgit v1.2.3