Lemonldap::NG::Manager(3) Perl extension for managing Lemonldap::NG Web-SSO

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( $ENV{SCRIPT_FILENAME} );
  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::Common::Conf::File or Lemonldap::Manager::NG::Common::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.
  • applyConfFile (optional): the path to a file containing parameters to make configuration reloaded by handlers. See "reload" function in Lemonldap::NG::Handler. The configuration file must contains lines like:

      # Comments if wanted
      host  http://virtual-host/reload-path
    
    

    When this parameter is set, an ``apply'' button is added to the manager menu.

  • doall: subroutine that provide headers and the full html code. Il simply calls "header_public", "start_html", "main" and "end_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 returns "HTTP 304 Not Modified" end exit. Else, it calls "header" 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     => '[email protected]',
                      -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).

AUTHOR

Xavier Guimard, <[email protected]>

BUG REPORT

Use OW2 system to report bug or ask for features: <http://forge.objectweb.org/tracker/?group_id=274>

DOWNLOAD

Lemonldap::NG is available at <http://forge.objectweb.org/project/showfiles.php?group_id=274>

COPYRIGHT AND LICENSE

Copyright (C) 2006-2007 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.