source: branches/4.0/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web.pm @ 1259

Last change on this file since 1259 was 1259, checked in by nanardon, 10 years ago
  • 4.0.1
File size: 8.0 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 = '4.0.1';
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) ],
54            list => [ qw(sn givenName mail) ],
55        },
56        group => {
57            quick_search => [ qw(cn description) ],
58            list => [ qw(description) ],
59        },
60        nethost => {
61            quick_search => [ qw(cn description ip cname otherName) ],
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' => 'Contact'
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        'postalCode' => {
230            'label' => 'Code postal'
231        },
232        user => {
233            'label' => 'Utilisateur',
234        },
235        snNative => {
236            'label' => 'Nom d\'origine',
237        },
238        givenNameNative => {
239            'label' => 'Prénom d\'origine',
240        },
241        wWWHomePage  => {
242            label => 'Page Web',
243        },
244        halReference  => {
245            label => 'Identifiant Hal',
246        },
247        siteNick => {
248            label => 'Nom court',
249        },
250        otherName => {
251            label => 'Autre nom (A)',
252        },
253        outputD => {
254            label => 'Fichier de sortie',
255        },
256        templateD => {
257            label => 'ModÚle',
258        },
259        allow_dyn => {
260            label => 'Avec DHCP dyn.',
261        },
262        dynFrom => {
263            label => 'HÃŽtes dyn. depuis',
264        },
265        domain => {
266            label => 'Domaine',
267        },
268        ipCount => {
269            label => 'Nb d\'IP',
270        },
271        freeIPCount => {
272            label => 'Nb d\'IP libres',
273        },
274        dnsRevision => {
275            label => 'Révision DNS',
276        },
277        lastUpdate => {
278            label => 'DerniÚre MAJ',
279        },
280        reverse => {
281            label => 'Nom inverse',
282        },
283        finalpoint => {
284            label => 'Destinataires',
285        },
286        parents => {
287            label => 'Alias parents',
288        },
289        forward => {
290            label => 'Renvois',
291        },
292        managedAlsoBy => {
293            label => 'Resp. Adj.',
294        },
295        autoMemberFilter => {
296            label => 'Filtre d\'appatenance',
297        },
298    },
299);
300
301my $config_file = '/etc/latmos-accounts/latmos-accounts-web.yml';
302if (-r $config_file ) {
303    __PACKAGE__->config( 'Plugin::ConfigLoader' => { 
304            file => $config_file 
305        } 
306    );
307}
308
309# http://stackoverflow.com/questions/1664816/is-there-a-way-to-force-c-urifor-in-catalyst-to-generate-a-uri-that-begins-wit
310__PACKAGE__->config( using_frontend_proxy => 1 );
311
312__PACKAGE__->config( name => 'LATMOS::Accounts::Web' );
313
314__PACKAGE__->config->{'Plugin::Authentication'} = {
315    default_realm => 'la',
316    realms => {
317        la => {
318            credential => {
319                class => 'La'
320            },
321            store => {
322                class => 'Null',
323            },
324        },
325    },
326};
327
328
329# Start the application
330__PACKAGE__->setup;
331
332
333=head1 NAME
334
335LATMOS::Accounts::Web - Catalyst based application
336
337=head1 SYNOPSIS
338
339    script/latmos_accounts_web_server.pl
340
341=head1 DESCRIPTION
342
343[enter your description here]
344
345=head1 SEE ALSO
346
347L<LATMOS::Accounts::Web::Controller::Root>, L<Catalyst>
348
349=head1 AUTHOR
350
351Thauvin Olivier
352
353=head1 LICENSE
354
355This library is free software, you can redistribute it and/or modify
356it under the same terms as Perl itself.
357
358=cut
359
3601;
Note: See TracBrowser for help on using the repository browser.