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

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