index.pl 1.65 KB
Newer Older
1
2
#!/usr/bin/perl

Yadd's avatar
Yadd committed
3
use strict;
4
use Lemonldap::NG::Manager;
Yadd's avatar
Yadd committed
5
use HTML::Template;
6

Yadd's avatar
Yadd committed
7
my $manager = new Lemonldap::NG::Manager(
8
    {
Yadd's avatar
Yadd committed
9

10
11
        # ACCESS TO CONFIGURATION

Yadd's avatar
Yadd committed
12
        # By default, Lemonldap::NG uses the default storage.conf file to know
13
        # where to find is configuration
Yadd's avatar
Yadd committed
14
        # (generaly /etc/lemonldap-ng/storage.conf)
15
        # You can specify by yourself this file :
Clément OUDOT's avatar
   
Clément OUDOT committed
16
        #configStorage => { confFile => '/path/to/my/file' },
17
18
19
20
21

        # You can also specify directly the configuration
        # (see Lemonldap::NG::Handler::SharedConf(3))
        #configStorage => {
        #      type => 'File',
Clément OUDOT's avatar
   
Clément OUDOT committed
22
        #      directory => '/usr/local/lemonldap-ng/conf/'
23
24
        #},

25
    }
Yadd's avatar
Yadd committed
26
27
) or Lemonldap::NG::Common::CGI->abort('Unable to start manager');

Yadd's avatar
Yadd committed
28
29
our $skin     = $manager->{managerSkin};
our $skin_dir = 'skins';
30
our $main_dir = $manager->{managerHtdocsPath};
31

Yadd's avatar
Yadd committed
32
33
34
35
36
37
my $template = HTML::Template->new(
    filename          => "$main_dir/$skin_dir/$skin/manager.tpl",
    die_on_bad_params => 0,
    cache             => 0,
    filter            => sub { $manager->translate_template(@_) },
);
Yadd's avatar
Yadd committed
38
39
40
41
42
43
44
$template->param( SCRIPT_NAME    => $ENV{SCRIPT_NAME} );
$template->param( MENU           => $manager->menu() );
$template->param( DIR            => "$skin_dir/$skin" );
$template->param( CFGNUM         => $manager->{cfgNum} );
$template->param( TREE_AUTOCLOSE => $manager->{managerTreeAutoClose} );
$template->param( TREE_JQUERYCSS => $manager->{managerTreeJqueryCss} );
$template->param( CSS            => $manager->{managerCss} );
Clément OUDOT's avatar
   
Clément OUDOT committed
45
$template->param( CSS_THEME      => $manager->{managerCssTheme} );
Yadd's avatar
Yadd committed
46
47
print $manager->header('text/html; charset=utf-8');
print $template->output;
48