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

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