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

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

Use same version between backgrounnd and web-app

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