[94] | 1 | package LATMOS::Accounts::Web; |
---|
| 2 | |
---|
| 3 | use strict; |
---|
| 4 | use warnings; |
---|
[923] | 5 | no utf8; |
---|
[94] | 6 | |
---|
| 7 | use Catalyst::Runtime '5.70'; |
---|
| 8 | |
---|
| 9 | # Set flags and add plugins for the application |
---|
| 10 | # |
---|
| 11 | # -Debug: activates the debug mode for very useful log messages |
---|
| 12 | # ConfigLoader: will load the configuration from a YAML file in the |
---|
| 13 | # application's home directory |
---|
| 14 | # Static::Simple: will serve static files from the application's root |
---|
| 15 | # directory |
---|
| 16 | |
---|
[221] | 17 | use Catalyst qw/ |
---|
| 18 | ConfigLoader |
---|
| 19 | Static::Simple |
---|
| 20 | Session |
---|
| 21 | Session::State::Cookie |
---|
[1157] | 22 | Session::Store::File |
---|
[229] | 23 | Authentication |
---|
[272] | 24 | Prototype |
---|
[870] | 25 | XMLRPC |
---|
[1546] | 26 | I18N |
---|
[221] | 27 | /; |
---|
[94] | 28 | |
---|
[1580] | 29 | our $VERSION = '5.0.15'; |
---|
[1435] | 30 | |
---|
[94] | 31 | # Configure the application. |
---|
| 32 | |
---|
[1148] | 33 | # Default value for active/inactive features |
---|
[923] | 34 | __PACKAGE__->config( |
---|
[1148] | 35 | features => { |
---|
| 36 | # /services/mailing, mass mailing |
---|
| 37 | mailing => 0, |
---|
| 38 | # /summary/offices |
---|
| 39 | offices_list => 0, |
---|
| 40 | # /summary/department |
---|
| 41 | departments_list => 0, |
---|
| 42 | # users/address forms |
---|
| 43 | user_addresses => 1, |
---|
| 44 | # users/email form |
---|
| 45 | user_email => 1, |
---|
| 46 | # users/my form |
---|
| 47 | user_my => 1, |
---|
[1500] | 48 | # user status managed by employment |
---|
| 49 | user_employment => 0, |
---|
[1148] | 50 | } |
---|
| 51 | ); |
---|
| 52 | |
---|
[861] | 53 | my $config_file = '/etc/latmos-accounts/latmos-accounts-web.yml'; |
---|
| 54 | if (-r $config_file ) { |
---|
| 55 | __PACKAGE__->config( 'Plugin::ConfigLoader' => { |
---|
| 56 | file => $config_file |
---|
| 57 | } |
---|
| 58 | ); |
---|
| 59 | } |
---|
| 60 | |
---|
[605] | 61 | # http://stackoverflow.com/questions/1664816/is-there-a-way-to-force-c-urifor-in-catalyst-to-generate-a-uri-that-begins-wit |
---|
| 62 | __PACKAGE__->config( using_frontend_proxy => 1 ); |
---|
| 63 | |
---|
[94] | 64 | __PACKAGE__->config( name => 'LATMOS::Accounts::Web' ); |
---|
| 65 | |
---|
[229] | 66 | __PACKAGE__->config->{'Plugin::Authentication'} = { |
---|
[889] | 67 | default_realm => 'la', |
---|
[229] | 68 | realms => { |
---|
| 69 | la => { |
---|
| 70 | credential => { |
---|
| 71 | class => 'La' |
---|
| 72 | }, |
---|
| 73 | store => { |
---|
| 74 | class => 'Null', |
---|
| 75 | }, |
---|
| 76 | }, |
---|
| 77 | }, |
---|
| 78 | }; |
---|
| 79 | |
---|
[1534] | 80 | # 1 week for session |
---|
| 81 | __PACKAGE__->config->{'Plugin::Session'} = { |
---|
| 82 | expires => 3600 * 24 * 30 |
---|
| 83 | }; |
---|
[229] | 84 | |
---|
[1534] | 85 | |
---|
[94] | 86 | # Start the application |
---|
| 87 | __PACKAGE__->setup; |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | =head1 NAME |
---|
| 91 | |
---|
| 92 | LATMOS::Accounts::Web - Catalyst based application |
---|
| 93 | |
---|
| 94 | =head1 SYNOPSIS |
---|
| 95 | |
---|
| 96 | script/latmos_accounts_web_server.pl |
---|
| 97 | |
---|
| 98 | =head1 DESCRIPTION |
---|
| 99 | |
---|
| 100 | [enter your description here] |
---|
| 101 | |
---|
| 102 | =head1 SEE ALSO |
---|
| 103 | |
---|
| 104 | L<LATMOS::Accounts::Web::Controller::Root>, L<Catalyst> |
---|
| 105 | |
---|
| 106 | =head1 AUTHOR |
---|
| 107 | |
---|
| 108 | Thauvin Olivier |
---|
| 109 | |
---|
| 110 | =head1 LICENSE |
---|
| 111 | |
---|
| 112 | This library is free software, you can redistribute it and/or modify |
---|
| 113 | it under the same terms as Perl itself. |
---|
| 114 | |
---|
| 115 | =cut |
---|
| 116 | |
---|
| 117 | 1; |
---|