2008-05-10 20:05:46 +02:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
use Lemonldap::NG::Portal::SharedConf;
|
|
|
|
use HTML::Template;
|
2010-01-11 17:04:36 +01:00
|
|
|
use strict;
|
2008-05-10 20:05:46 +02:00
|
|
|
|
|
|
|
my $portal = Lemonldap::NG::Portal::SharedConf->new(
|
|
|
|
{
|
2008-12-25 21:06:23 +01:00
|
|
|
|
|
|
|
# ACCESS TO CONFIGURATION
|
2010-01-11 17:04:36 +01:00
|
|
|
# By default, Lemonldap::NG uses the default lemonldap-ng.ini file to
|
|
|
|
# know where to find its configuration
|
2009-12-04 10:59:21 +01:00
|
|
|
# (generaly /etc/lemonldap-ng/lemonldap-ng.ini)
|
2008-12-25 21:06:23 +01:00
|
|
|
# You can specify by yourself this file :
|
2009-06-29 13:29:52 +02:00
|
|
|
#configStorage => { confFile => '/path/to/my/file' },
|
2009-02-24 18:53:59 +01:00
|
|
|
# or set explicitely parameters :
|
|
|
|
#configStorage => {
|
2009-12-04 10:59:21 +01:00
|
|
|
# type => 'File',
|
|
|
|
# dirName => '/usr/local/lemonldap-ng/data//conf'
|
2009-02-24 18:53:59 +01:00
|
|
|
#},
|
|
|
|
# Note that YOU HAVE TO SET configStorage here if you've declared this
|
|
|
|
# portal as SOAP configuration server in the manager
|
2008-12-25 21:06:23 +01:00
|
|
|
|
|
|
|
# OTHERS
|
|
|
|
# You can also overload any parameter issued from manager
|
|
|
|
# configuration. Example:
|
2009-02-24 18:53:59 +01:00
|
|
|
#globalStorage => 'Apache::Session::File',
|
2008-12-25 21:06:23 +01:00
|
|
|
#globalStorageOptions => {
|
2009-07-20 17:18:12 +02:00
|
|
|
# 'Directory' => '/var/lib/lemonldap-ng/sessions/',
|
|
|
|
# 'LockDirectory' => '/var/lib/lemonldap-ng/sessions/lock/',
|
|
|
|
#},
|
2009-02-24 18:53:59 +01:00
|
|
|
# Note that YOU HAVE TO SET globalStorage here if you've declared this
|
|
|
|
# portal as SOAP session server in the manager
|
2008-05-10 20:05:46 +02:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2010-09-28 12:30:57 +02:00
|
|
|
# Get skin and template parameters
|
|
|
|
my ( $templateName, %templateParams ) = $portal->display();
|
2008-09-18 10:34:17 +02:00
|
|
|
|
2010-01-13 13:46:19 +01:00
|
|
|
# HTML template creation
|
2010-01-13 13:19:55 +01:00
|
|
|
my $template = HTML::Template->new(
|
2010-09-28 12:30:57 +02:00
|
|
|
filename => "$templateName",
|
2010-01-13 13:19:55 +01:00
|
|
|
die_on_bad_params => 0,
|
|
|
|
cache => 0,
|
2010-09-05 15:57:07 +02:00
|
|
|
global_vars => 1,
|
2012-12-04 17:31:12 +01:00
|
|
|
loop_context_vars => 1,
|
2011-11-04 16:30:24 +01:00
|
|
|
filter => [
|
|
|
|
sub { $portal->translate_template(@_) },
|
|
|
|
sub { $portal->session_template(@_) }
|
|
|
|
],
|
2010-01-13 13:19:55 +01:00
|
|
|
);
|
|
|
|
|
2010-01-13 13:46:19 +01:00
|
|
|
# Give parameters to the template
|
2010-01-13 13:19:55 +01:00
|
|
|
while ( my ( $k, $v ) = each %templateParams ) {
|
|
|
|
$template->param( $k, $v );
|
2008-05-10 20:05:46 +02:00
|
|
|
}
|
|
|
|
|
2010-01-13 13:46:19 +01:00
|
|
|
# Display it
|
2010-01-13 13:19:55 +01:00
|
|
|
print $portal->header('text/html; charset=utf-8');
|
|
|
|
print $template->output;
|
|
|
|
|