[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 |
---|
[221] | 26 | /; |
---|
[94] | 27 | |
---|
| 28 | # Configure the application. |
---|
| 29 | |
---|
[1148] | 30 | # Default value for active/inactive features |
---|
[923] | 31 | __PACKAGE__->config( |
---|
[1148] | 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( |
---|
[1081] | 49 | objects => { |
---|
| 50 | user => { |
---|
[1422] | 51 | quick_search => [ qw(cn sn givenName description comment uidNumber) ], |
---|
[1081] | 52 | list => [ qw(sn givenName mail) ], |
---|
| 53 | }, |
---|
| 54 | group => { |
---|
[1422] | 55 | quick_search => [ qw(cn description comment gidNumber) ], |
---|
[1081] | 56 | list => [ qw(description) ], |
---|
| 57 | }, |
---|
| 58 | nethost => { |
---|
[1329] | 59 | quick_search => [ qw(cn description ip cname otherName macaddr serialNumber) ], |
---|
[1081] | 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 | }, |
---|
[923] | 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' => { |
---|
[1240] | 132 | 'label' => "Etat (US)" |
---|
[923] | 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' => { |
---|
[1126] | 192 | 'label' => "Verrouillé" |
---|
[923] | 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' => { |
---|
[1365] | 213 | 'label' => 'Resp. direct' |
---|
[923] | 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 | }, |
---|
[1348] | 227 | 'endcircuit' => { |
---|
| 228 | 'label' => 'Fin de Circuit d\'entrée' |
---|
| 229 | }, |
---|
[923] | 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 | }, |
---|
[925] | 281 | reverse => { |
---|
| 282 | label => 'Nom inverse', |
---|
| 283 | }, |
---|
[929] | 284 | finalpoint => { |
---|
| 285 | label => 'Destinataires', |
---|
| 286 | }, |
---|
| 287 | parents => { |
---|
| 288 | label => 'Alias parents', |
---|
| 289 | }, |
---|
| 290 | forward => { |
---|
| 291 | label => 'Renvois', |
---|
| 292 | }, |
---|
[1247] | 293 | managedAlsoBy => { |
---|
| 294 | label => 'Resp. Adj.', |
---|
| 295 | }, |
---|
| 296 | autoMemberFilter => { |
---|
[1289] | 297 | label => 'Filtre d\'appartenance', |
---|
[1247] | 298 | }, |
---|
[1291] | 299 | comment => { |
---|
| 300 | label => 'Commentaire', |
---|
| 301 | }, |
---|
[1302] | 302 | related => { |
---|
| 303 | label => 'Voir aussi:', |
---|
| 304 | }, |
---|
[1329] | 305 | SerialNumber => { |
---|
| 306 | label => 'Numéro de série', |
---|
| 307 | }, |
---|
[923] | 308 | }, |
---|
| 309 | ); |
---|
| 310 | |
---|
[861] | 311 | my $config_file = '/etc/latmos-accounts/latmos-accounts-web.yml'; |
---|
| 312 | if (-r $config_file ) { |
---|
| 313 | __PACKAGE__->config( 'Plugin::ConfigLoader' => { |
---|
| 314 | file => $config_file |
---|
| 315 | } |
---|
| 316 | ); |
---|
| 317 | } |
---|
| 318 | |
---|
[605] | 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 | |
---|
[94] | 322 | __PACKAGE__->config( name => 'LATMOS::Accounts::Web' ); |
---|
| 323 | |
---|
[229] | 324 | __PACKAGE__->config->{'Plugin::Authentication'} = { |
---|
[889] | 325 | default_realm => 'la', |
---|
[229] | 326 | realms => { |
---|
| 327 | la => { |
---|
| 328 | credential => { |
---|
| 329 | class => 'La' |
---|
| 330 | }, |
---|
| 331 | store => { |
---|
| 332 | class => 'Null', |
---|
| 333 | }, |
---|
| 334 | }, |
---|
| 335 | }, |
---|
| 336 | }; |
---|
| 337 | |
---|
| 338 | |
---|
[94] | 339 | # Start the application |
---|
| 340 | __PACKAGE__->setup; |
---|
| 341 | |
---|
| 342 | |
---|
| 343 | =head1 NAME |
---|
| 344 | |
---|
| 345 | LATMOS::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 | |
---|
| 357 | L<LATMOS::Accounts::Web::Controller::Root>, L<Catalyst> |
---|
| 358 | |
---|
| 359 | =head1 AUTHOR |
---|
| 360 | |
---|
| 361 | Thauvin Olivier |
---|
| 362 | |
---|
| 363 | =head1 LICENSE |
---|
| 364 | |
---|
| 365 | This library is free software, you can redistribute it and/or modify |
---|
| 366 | it under the same terms as Perl itself. |
---|
| 367 | |
---|
| 368 | =cut |
---|
| 369 | |
---|
| 370 | 1; |
---|