source: trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web.pm @ 2193

Last change on this file since 2193 was 2166, checked in by nanardon, 5 years ago

Release Bump

File size: 3.4 KB
Line 
1package LATMOS::Accounts::Web;
2
3use strict;
4use warnings;
5no utf8;
6
7use 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
17use Catalyst qw/
18    ConfigLoader
19    Static::Simple
20    Session
21    Session::State::Cookie
22    Session::Store::File
23    Authentication
24    I18N
25    /;
26
27our $VERSION = '5.2.34';
28
29# Configure the application.
30__PACKAGE__->config(
31    encoding => 'UTF-8',
32    'Plugin::I18N' => {
33        'maketext_options' => {
34            Decode => 1
35        }
36    }
37);
38
39# Default value for active/inactive features
40__PACKAGE__->config(
41    features => {
42        # /services/mailing, mass mailing
43        mailing => 0,
44        # /summary/offices
45        offices_list => 0,
46        # /summary/department
47        departments_list => 0,
48        # users/address forms
49        user_addresses => 1,
50        # users/email form
51        user_email => 1,
52        # users/my form
53        user_my => 1,
54        # user status managed by employment
55        user_employment => 0,
56    }
57);
58
59__PACKAGE__->config(
60    objects => {
61        user => {
62            quick_search => [ qw(cn sn givenName description comment uidNumber) ],
63            list => [ qw(sn givenName mail) ],
64        },
65        group => {
66            quick_search => [ qw(cn description comment gidNumber) ],
67            list => [ qw(description) ],
68        },
69        nethost => {
70            quick_search => [ qw(cn description ip cname otherName macaddr serialNumber inventoryNumber) ],
71            list => [ qw(description owner) ],
72        },
73        netzone => {
74            quick_search => [ qw(cn description ip) ],
75            list => [ qw(type description) ],
76        },
77        site => {
78            quick_search => [ qw(cn l) ],
79            list => [ qw(l) ],
80        },
81        aliases => {
82            quick_search => [ qw(name) ],
83            list => [ qw() ],
84        },
85    },
86);
87
88my $config_file = '/etc/latmos-accounts/latmos-accounts-web.yml';
89if (-r $config_file ) {
90    __PACKAGE__->config( 'Plugin::ConfigLoader' => { 
91            file => $config_file 
92        } 
93    );
94}
95
96# http://stackoverflow.com/questions/1664816/is-there-a-way-to-force-c-urifor-in-catalyst-to-generate-a-uri-that-begins-wit
97__PACKAGE__->config( using_frontend_proxy => 1 );
98
99__PACKAGE__->config( name => 'LATMOS::Accounts::Web' );
100
101__PACKAGE__->config->{'Plugin::Authentication'} = {
102    default_realm => 'la',
103    realms => {
104        la => {
105            credential => {
106                class => 'La'
107            },
108            store => {
109                class => 'Null',
110            },
111        },
112    },
113};
114
115# 1 week for session
116__PACKAGE__->config->{'Plugin::Session'} = {
117    expires => 3600 * 24 * 30
118};
119
120
121# Start the application
122__PACKAGE__->setup;
123
124
125=head1 NAME
126
127LATMOS::Accounts::Web - Catalyst based application
128
129=head1 SYNOPSIS
130
131    script/latmos_accounts_web_server.pl
132
133=head1 DESCRIPTION
134
135[enter your description here]
136
137=head1 SEE ALSO
138
139L<LATMOS::Accounts::Web::Controller::Root>, L<Catalyst>
140
141=head1 AUTHOR
142
143Thauvin Olivier
144
145=head1 LICENSE
146
147This library is free software, you can redistribute it and/or modify
148it under the same terms as Perl itself.
149
150=cut
151
1521;
Note: See TracBrowser for help on using the repository browser.