NAME
Lemonldap::NG::Manager - Perl extension for managing Lemonldap::NG Web-SSO system.
SYNOPSIS
use Lemonldap::NG::Manager;
my $h=new Lemonldap::NG::Manager(
{
configStorage=>{
type=>'File',
dirName=>"/tmp/",
},
dhtmlXTreeImageLocation=> "/devel/img/",
# uncomment this only if lemonldap-ng-manager.js is not in the same
# directory than your script.
# jsFile => /path/to/lemonldap-ng-manager.js,
}
) or die "Unable to start, see Apache logs";
# Simple
$h->doall();
You can also peersonalize the HTML code instead of using doall()
:
print $self->header_public;
print $self->start_html ( # See CGI(3) for more about start_html
-style => "/location/to/my.css",
-title => "Example.com SSO configuration",
);
# optional HTML code for the top of the page
print "<img src=...";
print $self->main;
# optional HTML code for the footer of the page
print "<img src=...";
print $self->end_html;
DESCRIPTION
Lemonldap::NG::Manager provides a web interface to manage Lemonldap::NG Web-SSO system.
SUBROUTINES
new (constructor): new instanciates the manager object. It takes the following arguments:
configStorage (required): a hash reference to the description of the configuration database system. the key 'type' must be set. Example:
configStorage => { type => "DBI", dbiChain => "DBI:mysql:database=session;host=1.2.3.4", dbiUser => "lemonldap-ng", dbiPassword => "pass", }
See Lemonldap::Manager::NG::Manager::Conf::File or Lemonldap::Manager::NG::Manager::Conf::DBI to know which keys are required.
dhtmlXTreeImageLocation (required): the location of the directory containing dhtmlXTree images (provided in example/imgs). If this parameter isn't correct, the tree will not appear and you will have sone error in Apache error logs.
jsFile (optional): the path to the file
lemonldap-ng-manager.js
. It is required only if this file is not in the same directory than your script.
doall: subroutine that provide headers and the full html code. Il simply calls
header_public
,start_html
,main
andend_html
in this order.header: print HTTP headers. See CGI for more.
header_public: print HTTP headers and manage the
If-Modified-Since
HTTP header. If it match to the age of the file passed in first argument, it returnsHTTP 304 Not Modified
end exit. Else, it callsheader
with the other arguments. By default, all elements of the manager use this mecanism except the configuration itself.start_html: subroutine that print the HTML headers. you can add parameters to it; example;
print start_html(-title => 'My SSO configuration', -author => 'fred@capricorn.org', -target => '_blank', -meta => {'keywords'=>'pharaoh secret mummy', 'copyright' => 'copyright 1996 King Tut'}, -style => {'src'=>'/styles/style1.css'}, -BGCOLOR => 'blue');
See start_html description in CGI for more. Bee carefull with
-style
argument. You have to call it like the example above or simply like this: -style=> '/styles/style1.css', All other forms will not work.main: il produce the main HTML code needed to build the configuration interface.
end_html: close the HTML code by writing
'</body></html>'
Other subroutines manage the produce of CSS, Javascripts and of course the configuration tree (called with AJAX).
SEE ALSO
Lemonldap::NG::Handler, Lemonldap::NG::Portal, CGI
AUTHOR
Xavier Guimard, <x.guimard@free.fr>
COPYRIGHT AND LICENSE
Copyright (C) 2006 by Xavier Guimard
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.