[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 | |
---|
[1952] | 29 | our $VERSION = '5.2.10'; |
---|
[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 | |
---|
[1586] | 53 | __PACKAGE__->config( |
---|
| 54 | objects => { |
---|
| 55 | user => { |
---|
| 56 | quick_search => [ qw(cn sn givenName description comment uidNumber) ], |
---|
| 57 | list => [ qw(sn givenName mail) ], |
---|
| 58 | }, |
---|
| 59 | group => { |
---|
| 60 | quick_search => [ qw(cn description comment gidNumber) ], |
---|
| 61 | list => [ qw(description) ], |
---|
| 62 | }, |
---|
| 63 | nethost => { |
---|
| 64 | quick_search => [ qw(cn description ip cname otherName macaddr serialNumber) ], |
---|
| 65 | list => [ qw(description owner) ], |
---|
| 66 | }, |
---|
| 67 | netzone => { |
---|
| 68 | quick_search => [ qw(cn description ip) ], |
---|
| 69 | list => [ qw(type description) ], |
---|
| 70 | }, |
---|
| 71 | site => { |
---|
| 72 | quick_search => [ qw(cn l) ], |
---|
| 73 | list => [ qw(l) ], |
---|
| 74 | }, |
---|
| 75 | aliases => { |
---|
| 76 | quick_search => [ qw(name) ], |
---|
| 77 | list => [ qw() ], |
---|
| 78 | }, |
---|
| 79 | }, |
---|
| 80 | ); |
---|
| 81 | |
---|
[861] | 82 | my $config_file = '/etc/latmos-accounts/latmos-accounts-web.yml'; |
---|
| 83 | if (-r $config_file ) { |
---|
| 84 | __PACKAGE__->config( 'Plugin::ConfigLoader' => { |
---|
| 85 | file => $config_file |
---|
| 86 | } |
---|
| 87 | ); |
---|
| 88 | } |
---|
| 89 | |
---|
[605] | 90 | # http://stackoverflow.com/questions/1664816/is-there-a-way-to-force-c-urifor-in-catalyst-to-generate-a-uri-that-begins-wit |
---|
| 91 | __PACKAGE__->config( using_frontend_proxy => 1 ); |
---|
| 92 | |
---|
[94] | 93 | __PACKAGE__->config( name => 'LATMOS::Accounts::Web' ); |
---|
| 94 | |
---|
[229] | 95 | __PACKAGE__->config->{'Plugin::Authentication'} = { |
---|
[889] | 96 | default_realm => 'la', |
---|
[229] | 97 | realms => { |
---|
| 98 | la => { |
---|
| 99 | credential => { |
---|
| 100 | class => 'La' |
---|
| 101 | }, |
---|
| 102 | store => { |
---|
| 103 | class => 'Null', |
---|
| 104 | }, |
---|
| 105 | }, |
---|
| 106 | }, |
---|
| 107 | }; |
---|
| 108 | |
---|
[1601] | 109 | __PACKAGE__->config->{'Plugin::I18N'} = { |
---|
| 110 | 'maketext_options' => { |
---|
| 111 | Decode => 0 |
---|
| 112 | } |
---|
| 113 | }; |
---|
| 114 | |
---|
| 115 | |
---|
[1534] | 116 | # 1 week for session |
---|
| 117 | __PACKAGE__->config->{'Plugin::Session'} = { |
---|
| 118 | expires => 3600 * 24 * 30 |
---|
| 119 | }; |
---|
[229] | 120 | |
---|
[1534] | 121 | |
---|
[94] | 122 | # Start the application |
---|
| 123 | __PACKAGE__->setup; |
---|
| 124 | |
---|
| 125 | |
---|
| 126 | =head1 NAME |
---|
| 127 | |
---|
| 128 | LATMOS::Accounts::Web - Catalyst based application |
---|
| 129 | |
---|
| 130 | =head1 SYNOPSIS |
---|
| 131 | |
---|
| 132 | script/latmos_accounts_web_server.pl |
---|
| 133 | |
---|
| 134 | =head1 DESCRIPTION |
---|
| 135 | |
---|
| 136 | [enter your description here] |
---|
| 137 | |
---|
| 138 | =head1 SEE ALSO |
---|
| 139 | |
---|
| 140 | L<LATMOS::Accounts::Web::Controller::Root>, L<Catalyst> |
---|
| 141 | |
---|
| 142 | =head1 AUTHOR |
---|
| 143 | |
---|
| 144 | Thauvin Olivier |
---|
| 145 | |
---|
| 146 | =head1 LICENSE |
---|
| 147 | |
---|
| 148 | This library is free software, you can redistribute it and/or modify |
---|
| 149 | it under the same terms as Perl itself. |
---|
| 150 | |
---|
| 151 | =cut |
---|
| 152 | |
---|
| 153 | 1; |
---|