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

Last change on this file since 1509 was 1509, checked in by nanardon, 9 years ago

Add employment's attributes labels

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