X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fstemmaweb.pm;h=4a8f77a138844c63a0227e8ca428584bce759aa1;hb=7b5122b9d6798e0f9f4dab9f57e39979a15787c8;hp=94121c131ec1285705b981273326f4283972bef6;hpb=43ad4ba4f0fdb3d1375b6cc22f5001e8ec4b45a9;p=scpubgit%2Fstemmaweb.git diff --git a/lib/stemmaweb.pm b/lib/stemmaweb.pm index 94121c1..4a8f77a 100644 --- a/lib/stemmaweb.pm +++ b/lib/stemmaweb.pm @@ -4,6 +4,10 @@ use namespace::autoclean; use Catalyst::Runtime 5.80; +use Search::GIN::Extract::Class; +use Search::GIN::Extract::Attributes; +use Search::GIN::Extract::Multiplex; + # Set flags and add plugins for the application. # # Note that ORDERING IS IMPORTANT here as plugins are initialized in order, @@ -19,7 +23,12 @@ use Catalyst::Runtime 5.80; use Catalyst qw/ ConfigLoader Static::Simple - Unicode::Encoding + Authentication + Session + Session::Store::File + Session::State::Cookie + StatusMessage + StackTrace /; extends 'Catalyst'; @@ -39,6 +48,8 @@ __PACKAGE__->config( name => 'stemmaweb', # Disable deprecated behavior needed by old applications disable_component_resolution_regex_fallback => 1, + # Set Unicode as the default + encoding => 'UTF-8', default_view => 'TT', 'View::JSON' => { expose_stash => 'result', @@ -48,6 +59,66 @@ __PACKAGE__->config( stemmaweb->path_to( 'root', 'src' ), ], }, + ## kiokudb auth store testing + 'Plugin::Authentication' => { + default => { + credential => { + class => 'Password', + password_field => 'password', + password_type => 'self_check', + }, + store => { + class => 'Model::KiokuDB', + model_name => 'Directory', + }, + }, + openid => { + credential => { + class => 'OpenID', + extensions => ['http://openid.net/srv/ax/1.0' => + { + ns => 'ax', + uri => 'http://openid.net/srv/ax/1.0', + mode => 'fetch_request', + required => 'email', + 'type.email' => 'http://axschema.org/contact/email', + # type => { + # email => 'http://axschema.org/contact/email' + # } + } + ], + }, + store => { + class => 'Model::KiokuDB', + model_name => 'Directory', + }, + auto_create_user => 1, + }, + }, + ## Auth with CatalystX::Controller::Auth + 'Controller::Users' => { + model => 'User', + login_id_field => 'username', + login_db_field => 'username', + action_after_login => '/users/success', + action_after_register => '/users/success', + enable_sending_register_email => 0, + register_email_from => '"Stemmaweb" ', + register_email_subject => 'Registration to stemmaweb', + register_email_template_plain => 'register-plain.tt', + realm => 'default', + login_fields => { openid => [qw/openid_identifier/], + default => [qw/username password remember/], + }, + }, + 'View::Email::Template' => { + stash_key => 'email_template', + }, + + recaptcha => { + pub_key => '6LfR19MSAAAAACy2meHvLfZGRn3PM2rRYIAfh665', + priv_key => '6LfR19MSAAAAAMlQb8BdyecWNRE1bAL2YSgz2sah', + }, ); # Start the application