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

Last change on this file since 1707 was 1707, checked in by nanardon, 8 years ago

5.1.7

File size: 3.3 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    Prototype
25    XMLRPC
26    I18N
27    /;
28
29our $VERSION = '5.1.7';
30
31# Configure the application.
32
33# Default value for active/inactive features
34__PACKAGE__->config(
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,
48        # user status managed by employment
49        user_employment => 0,
50    }
51);
52
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);
82
83my $config_file = '/etc/latmos-accounts/latmos-accounts-web.yml';
84if (-r $config_file ) {
85    __PACKAGE__->config( 'Plugin::ConfigLoader' => { 
86            file => $config_file 
87        } 
88    );
89}
90
91# http://stackoverflow.com/questions/1664816/is-there-a-way-to-force-c-urifor-in-catalyst-to-generate-a-uri-that-begins-wit
92__PACKAGE__->config( using_frontend_proxy => 1 );
93
94__PACKAGE__->config( name => 'LATMOS::Accounts::Web' );
95
96__PACKAGE__->config->{'Plugin::Authentication'} = {
97    default_realm => 'la',
98    realms => {
99        la => {
100            credential => {
101                class => 'La'
102            },
103            store => {
104                class => 'Null',
105            },
106        },
107    },
108};
109
110__PACKAGE__->config->{'Plugin::I18N'} = {
111    'maketext_options' => {
112        Decode => 0
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.