File: index.fcgi

package info (click to toggle)
lemonldap-ng 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 13,084 kB
  • ctags: 2,440
  • sloc: perl: 25,708; makefile: 622; sh: 176; php: 6; sql: 5
file content (66 lines) | stat: -rwxr-xr-x 2,139 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/perl

use Lemonldap::NG::Common::CGI qw(fastcgi);
use Lemonldap::NG::Portal::SharedConf;
use HTML::Template;
use strict;

LMAUTH:
while (
    my $portal = Lemonldap::NG::Portal::SharedConf->new(
        {

          # ACCESS TO CONFIGURATION
          # By default, Lemonldap::NG uses the default lemonldap-ng.ini file to
          # know where to find its configuration
          # (generaly /etc/lemonldap-ng/lemonldap-ng.ini)
          # You can specify by yourself this file :
          #configStorage => { confFile => '/path/to/my/file' },
          # or set explicitely parameters :
          #configStorage => {
          #  type => 'File',
          #  dirName => '/usr/local/lemonldap-ng/data//conf'
          #},
          # Note that YOU HAVE TO SET configStorage here if you've declared this
          # portal as SOAP configuration server in the manager

          # OTHERS
          # You can also overload any parameter issued from manager
          # configuration. Example:
          #globalStorage => 'Apache::Session::File',
          #globalStorageOptions => {
          #  'Directory' => '/var/lib/lemonldap-ng/sessions/',
          #  'LockDirectory' => '/var/lib/lemonldap-ng/sessions/lock/',
          #},
          # Note that YOU HAVE TO SET globalStorage here if you've declared this
          # portal as SOAP session server in the manager
        }
    )
  )
{

    # Get skin and template parameters
    my ( $templateName, %templateParams ) = $portal->display();

    # HTML template creation
    my $template = HTML::Template->new(
        filename          => "$templateName",
        die_on_bad_params => 0,
        cache             => 0,
        global_vars       => 1,
        loop_context_vars => 1,
        filter            => [
            sub { $portal->translate_template(@_) },
            sub { $portal->session_template(@_) }
        ],
    );

    # Give parameters to the template
    while ( my ( $k, $v ) = each %templateParams ) {
        $template->param( $k, $v );
    }

    # Display it
    print $portal->header('text/html; charset=utf-8');
    print $template->output;
}