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