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

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

Fix missing POD section

File size: 8.9 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.0.11';
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    'attrs' => {
82        'physicalDeliveryOfficeName' => {
83            'label' => 'Bureau'
84        },
85        'sutype' => {
86            'label' => 'Structure admin.'
87        },
88        'department' => {
89            'label' => "Departement"
90        },
91        'macaddr' => {
92            'label' => 'Adresse Ethernet'
93        },
94        'date' => {
95            'label' => "Modifié le"
96        },
97        'cn' => {
98            'label' => 'Nom'
99        },
100        'grade' => {
101            'label' => 'Grade'
102        },
103        'net' => {
104            'label' => "Réseau"
105        },
106        'cname' => {
107            'label' => 'Alias (CName)'
108        },
109        'netExclude' => {
110            'label' => "Réseau exclus"
111        },
112        'contratType' => {
113            'label' => 'Type de contrat'
114        },
115        'co' => {
116            'label' => 'Pays'
117        },
118        'template' => {
119            'label' => "ModÚle"
120        },
121        'uid' => {
122            'label' => 'Login'
123        },
124        'otherTelephone' => {
125            'label' => "Téléphone (autre)"
126        },
127        'name' => {
128            'label' => 'Nom'
129        },
130        'telephoneNumber' => {
131            'label' => "Téléphone"
132        },
133        'noDynamic' => {
134            'label' => 'Pas d\'adressage dyn.'
135        },
136        'st' => {
137            'label' => "Etat (US)"
138        },
139        'output' => {
140            'label' => 'Sortie'
141        },
142        'description' => {
143            'label' => 'Description'
144        },
145        'facsimileTelephoneNumber' => {
146            'label' => 'Fax'
147        },
148        'isMainAddress' => {
149            'label' => 'Adresse principale'
150        },
151        'streetAddress' => {
152            'label' => 'Rue'
153        },
154        'gidNumber' => {
155            'label' => 'GID'
156        },
157        'sn' => {
158            'label' => 'Nom'
159        },
160        'type' => {
161            'label' => 'Type'
162        },
163        'unexported' => {
164            'label' => "Caché"
165        },
166        'title' => {
167            'label' => 'Fonction'
168        },
169        'givenName' => {
170            'label' => "Prénom"
171        },
172        'loginShell' => {
173            'label' => 'Shell'
174        },
175        'uidNumber' => {
176            'label' => 'UID'
177        },
178        'gecos' => {
179            'label' => 'Gecos Unix'
180        },
181        'mail' => {
182            'label' => 'Mail'
183        },
184        'company' => {
185            'label' => "Société"
186        },
187        'owner' => {
188            'label' => "Propriétaire"
189        },
190        'create' => {
191            'label' => "Créé le"
192        },
193        'initials' => {
194            'label' => 'Initiales'
195        },
196        'locked' => {
197            'label' => "Verrouillé"
198        },
199        'nickname' => {
200            'label' => 'Nick'
201        },
202        'managedBy' => {
203            'label' => 'Responsable'
204        },
205        'homeDirectory' => {
206            'label' => 'Home'
207        },
208        'college' => {
209            'label' => 'College'
210        },
211        'manager' => {
212            'label' => 'Responsable'
213        },
214        'l' => {
215            'label' => 'Ville'
216        },
217        'managerContact' => {
218            'label' => 'Resp. direct'
219        },
220        'site' => {
221            'label' => 'Site'
222        },
223        'postOfficeBox' => {
224            'label' => 'BP'
225        },
226        'exported' => {
227            'label' => "Propagé"
228        },
229        'expire' => {
230            'label' => 'Expire le'
231        },
232        'endcircuit' => {
233            'label' => 'Fin de Circuit d\'entrée'
234        },
235        'postalCode' => {
236            'label' => 'Code postal'
237        },
238        user => {
239            'label' => 'Utilisateur',
240        },
241        snNative => {
242            'label' => 'Nom d\'origine',
243        },
244        givenNameNative => {
245            'label' => 'Prénom d\'origine',
246        },
247        wWWHomePage  => {
248            label => 'Page Web',
249        },
250        halReference  => {
251            label => 'Identifiant Hal',
252        },
253        siteNick => {
254            label => 'Nom court',
255        },
256        otherName => {
257            label => 'Autre nom (A)',
258        },
259        outputD => {
260            label => 'Fichier de sortie',
261        },
262        templateD => {
263            label => 'ModÚle',
264        },
265        allow_dyn => {
266            label => 'Avec DHCP dyn.',
267        },
268        dynFrom => {
269            label => 'HÃŽtes dyn. depuis',
270        },
271        domain => {
272            label => 'Domaine',
273        },
274        ipCount => {
275            label => 'Nb d\'IP',
276        },
277        freeIPCount => {
278            label => 'Nb d\'IP libres',
279        },
280        dnsRevision => {
281            label => 'Révision DNS',
282        },
283        lastUpdate => {
284            label => 'DerniÚre MAJ',
285        },
286        reverse => {
287            label => 'Nom inverse',
288        },
289        finalpoint => {
290            label => 'Destinataires',
291        },
292        parents => {
293            label => 'Alias parents',
294        },
295        forward => {
296            label => 'Renvois',
297        },
298        managedAlsoBy => {
299            label => 'Resp. Adj.',
300        },
301        autoMemberFilter => {
302            label => 'Filtre d\'appartenance',
303        },
304        comment => {
305            label => 'Commentaire',
306        },
307        related => {
308            label => 'Voir aussi:',
309        },
310        SerialNumber => {
311            label => 'Numéro de série',
312        },
313        firstday => {
314            label => 'Début',
315        },
316        lastday => {
317            label => 'Fin',
318        },
319        endEmployment => {
320            label => 'Fin d\'activité',
321        },
322        endLastEmployment => {
323            label => 'Fin dernier statut',
324        },
325        endStrictEmployment => {
326            label => 'Fin statuts contigus',
327        },
328    },
329);
330
331my $config_file = '/etc/latmos-accounts/latmos-accounts-web.yml';
332if (-r $config_file ) {
333    __PACKAGE__->config( 'Plugin::ConfigLoader' => { 
334            file => $config_file 
335        } 
336    );
337}
338
339# http://stackoverflow.com/questions/1664816/is-there-a-way-to-force-c-urifor-in-catalyst-to-generate-a-uri-that-begins-wit
340__PACKAGE__->config( using_frontend_proxy => 1 );
341
342__PACKAGE__->config( name => 'LATMOS::Accounts::Web' );
343
344__PACKAGE__->config->{'Plugin::Authentication'} = {
345    default_realm => 'la',
346    realms => {
347        la => {
348            credential => {
349                class => 'La'
350            },
351            store => {
352                class => 'Null',
353            },
354        },
355    },
356};
357
358# 1 week for session
359__PACKAGE__->config->{'Plugin::Session'} = {
360    expires => 3600 * 24 * 30
361};
362
363
364# Start the application
365__PACKAGE__->setup;
366
367
368=head1 NAME
369
370LATMOS::Accounts::Web - Catalyst based application
371
372=head1 SYNOPSIS
373
374    script/latmos_accounts_web_server.pl
375
376=head1 DESCRIPTION
377
378[enter your description here]
379
380=head1 SEE ALSO
381
382L<LATMOS::Accounts::Web::Controller::Root>, L<Catalyst>
383
384=head1 AUTHOR
385
386Thauvin Olivier
387
388=head1 LICENSE
389
390This library is free software, you can redistribute it and/or modify
391it under the same terms as Perl itself.
392
393=cut
394
3951;
Note: See TracBrowser for help on using the repository browser.