Sophie

Sophie

distrib > Mandriva > cooker > x86_64 > by-pkgid > a100f0997407ff82957e996a98fb9db2 > files > 229

lemonldap-ng-1.0-0.3.rc1mdv2011.0.noarch.rpm

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 7 December 2008), see www.w3.org" />

  <title>Lemonldap::NG documentation: 6.1-Accounting.html</title>
  <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
  <style type="text/css">
/*<![CDATA[*/
    body{
      background: #ddd;
      font-family: sans-serif;
      font-size: 11pt;
      padding: 0 50px;
    }
    div.main-content{
      padding: 10px;
      background: #fff;
      border: 2px #ccc solid;
    }
    a{
      text-decoration: none;
    }
    p.footer{
      text-align: center;
      margin: 5px 0 0 0;
    }
    .heading-1{
      text-align: center;
      color: orange;
      font-variant: small-caps;
      font-size: 20pt;
    }
    .heading-1-1{
      color: orange;
      font-size: 14pt;
      border-bottom: 2px #ccc solid;
    }
    pre{
      background: #eee;
      border: 2px #ccc solid;
      padding: 5px;
      border-left: 10px #ccc solid;
    }
    ul.star li{
      list-style-type: square;
    }
  /*]]>*/
  </style>
</head>

<body>
  <div class="main-content">
    <h2 class="heading-1"><span id="HAccountinganduserslogging">Accounting and
    users logging</span></h2>

    <p class="paragraph"></p>By default, Lemonldap::NG uses Apache logs to
    store user actions. It can be change easily. Examples bellow works for
    Lemonldap::NG version 0.9.4 and later.

    <h3 class="heading-1-1"><span id="HUserslogsonportal">Users logs on
    portal</span></h3>

    <p class="paragraph"></p>Lemonldap::NG portal logs :

    <ul class="star">
      <li>authentications (level "notice")</li>

      <li>logout (level "notice")</li>

      <li>bad user (level "warn")</li>

      <li>bad password (level "warn")</li>

      <li>session expired (level "debug")</li>
    </ul>To use syslog, you just have to set "syslog =&gt; '&lt;facility&gt;'"
    in the new() subroutine. Example to log user actions with the facility
    "auth" :

    <div class="code">
      <pre>
my $portal = Lemonldap::NG::Portal-&gt;<span class="java-keyword">new</span>({
              syslog =&gt; <span class="java-quote">"auth"</span>,
              &hellip;
});
</pre>
    </div>

    <p class="paragraph"></p>You can customize this by redefining userNotice()
    and userError() methods. Example&nbsp;:

    <div class="code">
      <pre>
my $portal = Lemonldap::NG::Portal-&gt;<span class="java-keyword">new</span>({
              userError =&gt; sub {
                  my ($self, $message) = @_;
                  # <span class=
"java-keyword">do</span> something with $message
                  # Note that username is stored in $self-&gt;{user}
                  # and password in $self-&gt;{password}
              },
              userNotice =&gt; sub {
                  my ($self, $message) = @_;
                  # <span class=
"java-keyword">do</span> something with $message
                  # Note that username is stored in $self-&gt;{user}
                  # and other datas are stored in $self-&gt;{sessionInfo}
              },
              &hellip;
});
</pre>
    </div>

    <h3 class="heading-1-1"><span id="HUserslogsonhandlers">Users logs on
    handlers</span></h3>

    <p class="paragraph"></p>Lemonldap::NG handlers logs :

    <ul class="star">
      <li>access forbidden (level "notice")</li>

      <li>access granted (level "debug")</li>
    </ul>To change logging, redefine the methods logForbidden() and
    logGranted().
  </div>

  <p class="footer"><a href="index.html">Index</a></p>
</body>
</html>