[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 | |
---|
[1295] | 28 | our $VERSION = '4.0.5'; |
---|
[94] | 29 | |
---|
| 30 | # Configure the application. |
---|
| 31 | |
---|
[1148] | 32 | # Default value for active/inactive features |
---|
[923] | 33 | __PACKAGE__->config( |
---|
[1148] | 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( |
---|
[1081] | 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 | }, |
---|
[923] | 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' => { |
---|
[1240] | 134 | 'label' => "Etat (US)" |
---|
[923] | 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' => { |
---|
[1126] | 194 | 'label' => "Verrouillé" |
---|
[923] | 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 | }, |
---|
[925] | 280 | reverse => { |
---|
| 281 | label => 'Nom inverse', |
---|
| 282 | }, |
---|
[929] | 283 | finalpoint => { |
---|
| 284 | label => 'Destinataires', |
---|
| 285 | }, |
---|
| 286 | parents => { |
---|
| 287 | label => 'Alias parents', |
---|
| 288 | }, |
---|
| 289 | forward => { |
---|
| 290 | label => 'Renvois', |
---|
| 291 | }, |
---|
[1252] | 292 | managedAlsoBy => { |
---|
| 293 | label => 'Resp. Adj.', |
---|
| 294 | }, |
---|
| 295 | autoMemberFilter => { |
---|
[1290] | 296 | label => 'Filtre d\'appartenance', |
---|
[1252] | 297 | }, |
---|
[1292] | 298 | comment => { |
---|
| 299 | label => 'Commentaire', |
---|
| 300 | }, |
---|
[923] | 301 | }, |
---|
| 302 | ); |
---|
| 303 | |
---|
[861] | 304 | my $config_file = '/etc/latmos-accounts/latmos-accounts-web.yml'; |
---|
| 305 | if (-r $config_file ) { |
---|
| 306 | __PACKAGE__->config( 'Plugin::ConfigLoader' => { |
---|
| 307 | file => $config_file |
---|
| 308 | } |
---|
| 309 | ); |
---|
| 310 | } |
---|
| 311 | |
---|
[605] | 312 | # http://stackoverflow.com/questions/1664816/is-there-a-way-to-force-c-urifor-in-catalyst-to-generate-a-uri-that-begins-wit |
---|
| 313 | __PACKAGE__->config( using_frontend_proxy => 1 ); |
---|
| 314 | |
---|
[94] | 315 | __PACKAGE__->config( name => 'LATMOS::Accounts::Web' ); |
---|
| 316 | |
---|
[229] | 317 | __PACKAGE__->config->{'Plugin::Authentication'} = { |
---|
[889] | 318 | default_realm => 'la', |
---|
[229] | 319 | realms => { |
---|
| 320 | la => { |
---|
| 321 | credential => { |
---|
| 322 | class => 'La' |
---|
| 323 | }, |
---|
| 324 | store => { |
---|
| 325 | class => 'Null', |
---|
| 326 | }, |
---|
| 327 | }, |
---|
| 328 | }, |
---|
| 329 | }; |
---|
| 330 | |
---|
| 331 | |
---|
[94] | 332 | # Start the application |
---|
| 333 | __PACKAGE__->setup; |
---|
| 334 | |
---|
| 335 | |
---|
| 336 | =head1 NAME |
---|
| 337 | |
---|
| 338 | LATMOS::Accounts::Web - Catalyst based application |
---|
| 339 | |
---|
| 340 | =head1 SYNOPSIS |
---|
| 341 | |
---|
| 342 | script/latmos_accounts_web_server.pl |
---|
| 343 | |
---|
| 344 | =head1 DESCRIPTION |
---|
| 345 | |
---|
| 346 | [enter your description here] |
---|
| 347 | |
---|
| 348 | =head1 SEE ALSO |
---|
| 349 | |
---|
| 350 | L<LATMOS::Accounts::Web::Controller::Root>, L<Catalyst> |
---|
| 351 | |
---|
| 352 | =head1 AUTHOR |
---|
| 353 | |
---|
| 354 | Thauvin Olivier |
---|
| 355 | |
---|
| 356 | =head1 LICENSE |
---|
| 357 | |
---|
| 358 | This library is free software, you can redistribute it and/or modify |
---|
| 359 | it under the same terms as Perl itself. |
---|
| 360 | |
---|
| 361 | =cut |
---|
| 362 | |
---|
| 363 | 1; |
---|