source: tags/6.0.0/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web.pm @ 2202

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