lemonldap-ng/modules/lemonldap-ng-manager/example/index.pl

57 lines
1.9 KiB
Perl
Raw Normal View History

#!/usr/bin/perl
2009-12-11 19:17:00 +01:00
use strict;
use Lemonldap::NG::Manager;
2009-12-11 19:17:00 +01:00
use HTML::Template;
2009-12-11 19:17:00 +01:00
my $manager = new Lemonldap::NG::Manager(
{
# MANAGER CUSTOMIZATION
#managerSkin => 'default',
#managerCss => 'manager.css',
#managerTreeAutoClose => 'false',
#managerTreeJqueryCss => 'false',
# ACCESS TO CONFIGURATION
2009-12-11 19:17:00 +01:00
# By default, Lemonldap::NG uses the default storage.conf file to know
# where to find is configuration
2009-12-11 19:17:00 +01:00
# (generaly /etc/lemonldap-ng/storage.conf)
# You can specify by yourself this file :
2009-12-11 19:17:00 +01:00
#configStorage => { type => 'File', dirName => '/path/to/my/file' },
# You can also specify directly the configuration
# (see Lemonldap::NG::Handler::SharedConf(3))
#configStorage => {
# type => 'File',
2009-12-11 19:17:00 +01:00
# directory => '/usr/local/lemonlda-ng/conf/'
#},
# CUSTOM FUNCTION
# If you want to create customFunctions in rules, declare them here:
#customFunctions => 'function1 function2',
#customFunctions => 'Package::func1 Package::func2',
}
2009-12-11 19:17:00 +01:00
) or Lemonldap::NG::Common::CGI->abort('Unable to start manager');
our $skin = $manager->{managerSkin};
our $skin_dir ='skins';
our $main_dir = $ENV{DOCUMENT_ROOT};
2009-12-11 19:17:00 +01:00
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(@_) },
);
2009-12-11 20:22:37 +01:00
$template->param(SCRIPT_NAME => $ENV{SCRIPT_NAME});
2009-12-11 19:17:00 +01:00
$template->param(MENU => $manager->menu());
$template->param(DIR => "$skin_dir/$skin");
2010-01-07 17:03:20 +01:00
$template->param(CFGNUM => $manager->{cfgNum});
$template->param(TREE_AUTOCLOSE => $manager->{managerTreeAutoClose});
$template->param(TREE_JQUERYCSS => $manager->{managerTreeJqueryCss});
$template->param(CSS => $manager->{managerCss});
2009-12-11 19:17:00 +01:00
print $manager->header('text/html; charset=utf-8');
print $template->output;