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

Last change on this file since 2152 was 2152, checked in by nanardon, 6 years ago

Remove XMLRPC feature (unused)

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    I18N
26    /;
27
28our $VERSION = '5.2.29';
29
30# Configure the application.
31
32# Default value for active/inactive features
33__PACKAGE__->config(
34    features => {
35        # /services/mailing, mass mailing
36        mailing => 0,
37        # /summary/offices
38        offices_list => 0,
39        # /summary/department
40        departments_list => 0,
41        # users/address forms
42        user_addresses => 1,
43        # users/email form
44        user_email => 1,
45        # users/my form
46        user_my => 1,
47        # user status managed by employment
48        user_employment => 0,
49    }
50);
51
52__PACKAGE__->config(
53    objects => {
54        user => {
55            quick_search => [ qw(cn sn givenName description comment uidNumber) ],
56            list => [ qw(sn givenName mail) ],
57        },
58        group => {
59            quick_search => [ qw(cn description comment gidNumber) ],
60            list => [ qw(description) ],
61        },
62        nethost => {
63            quick_search => [ qw(cn description ip cname otherName macaddr serialNumber inventoryNumber) ],
64            list => [ qw(description owner) ],
65        },
66        netzone => {
67            quick_search => [ qw(cn description ip) ],
68            list => [ qw(type description) ],
69        },
70        site => {
71            quick_search => [ qw(cn l) ],
72            list => [ qw(l) ],
73        },
74        aliases => {
75            quick_search => [ qw(name) ],
76            list => [ qw() ],
77        },
78    },
79);
80
81my $config_file = '/etc/latmos-accounts/latmos-accounts-web.yml';
82if (-r $config_file ) {
83    __PACKAGE__->config( 'Plugin::ConfigLoader' => { 
84            file => $config_file 
85        } 
86    );
87}
88
89# http://stackoverflow.com/questions/1664816/is-there-a-way-to-force-c-urifor-in-catalyst-to-generate-a-uri-that-begins-wit
90__PACKAGE__->config( using_frontend_proxy => 1 );
91
92__PACKAGE__->config( name => 'LATMOS::Accounts::Web' );
93
94__PACKAGE__->config->{'Plugin::Authentication'} = {
95    default_realm => 'la',
96    realms => {
97        la => {
98            credential => {
99                class => 'La'
100            },
101            store => {
102                class => 'Null',
103            },
104        },
105    },
106};
107
108__PACKAGE__->config->{'Plugin::I18N'} = {
109    'maketext_options' => {
110        Decode => 0
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.