Since version 0.9.4, LemonLDAP::NG can be used to notify some messages to users: if a user has a message, the message will be displayed when he will access to the portal. If the message contains check boxes, the user has to check all of them else he can not access to the portal and get his session cookie.
</p>
<p>
Since 1.1.0, a notification explorer is available in Manager, and notifications can be done for all users, with the possibility to display conditions. When the user accept the notification, the reference is stored in his persistent session.
You just have to activate Notifications in the Manager (General Parameters > Advanced Parameters > Notifications > Activation) or in lemonldap-ng.ini:
By default, notifications will be stored in the same database as configuration:
</p>
<ul>
<liclass="level1"><divclass="li"> if you use “File” system and your “dirName” is set to /usr/local/lemonldap-ng/conf/, the notifications will be stored in /usr/local/lemonldap-ng/notifications/</div>
<liclass="level1"><divclass="li"> if you use “CDBI” or “RDBI” system, the notifications will be stored in the same database as configuration and in a table called “notifications”.</div>
<liclass="level1"><divclass="li"> if you use “LDAP” system, the notifications will be stored in the same directory as configuration and in a branch called “notifications”.</div>
You can change default parameters using the “notificationStorage” and “notificationStorageOptions” parameters with the same syntax as configuration storage parameters. To do this in Manager, go in General Parameters > Advanced Parameters > Notifications.
Parameters for File backend are the same as <ahref="../../documentation/2.0/fileconfbackend.html"class="wikilink1"title="documentation:2.0:fileconfbackend">File configuration backend</a>.
<p><divclass="notetip">The file name default separator is <code>_</code>, this can be a problem if you register notifications for users having <code>_</code> in their login. You can change the separator with the <code>fileNameSeparator</code> option, and set another value, for example <code>@</code>.
</div></p>
</p>
<p>
To summary available options:
</p>
<ul>
<liclass="level1"><divclass="li"><strong>dirName</strong>: directory where notifications are stored.</div>
</li>
<liclass="level1"><divclass="li"><strong>fileNameSeparator</strong>: file name separator.</div>
Parameters for <abbrtitle="Database Interface">DBI</abbr> backend are the same as <ahref="../../documentation/2.0/sqlconfbackend.html"class="wikilink1"title="documentation:2.0:sqlconfbackend">DBI configuration backend</a>.
Parameters for LDAP backend are the same as <ahref="../../documentation/2.0/ldapconfbackend.html"class="wikilink1"title="documentation:2.0:ldapconfbackend">LDAP configuration backend</a>.
The notifications module uses a wildcard to manage notifications for all users. The default value of this wilcard is <code>allusers</code>, but you can change it if <code>allusers</code> is a known identifier in your system.
</p>
<p>
To change it, go in General Parameters > Advanced Parameters > Notifications > Wildcard for all users, and set for example <code>alluserscustom</code>.
</p>
<p>
Then creating a notification for <code>alluserscustom</code> will display the notification for all users.
The transformation between notification XML content and <abbrtitle="HyperText Markup Language">HTML</abbr> display is done with XSLT. The default XSLT file is in portal/skins/common/notification.xsl. You can create your own XSLT file and store in another place, for example /etc/lemonldap-ng. Then just configure the new XSLT file path in Manager, go in General Parameters > Advanced Parameters > Notifications > Custom XSLT file and set for example <code>/etc/lemonldap-ng/notification.xsl</code>.
<liclass="level3"><divclass="li"> date: creation date (format YYYY-MM-DD)</div>
</li>
<liclass="level3"><divclass="li"> ref: a reference that can be used later to know what has been notified and when</div>
</li>
<liclass="level3"><divclass="li"> uid: the user login (it must correspond to the attribute set in whatToTrace parameter, uid by default), or the wildcard string (by default: <code>allusers</code>) if the notification should be displayed for every user.</div>
<liclass="level3"><divclass="li"><title>: title to display: will be inserted in <abbrtitle="HyperText Markup Language">HTML</abbr> page enclosed in <h2 class=“notifText”>…</h2></div>
<liclass="level3"><divclass="li"><subtitle>: subtitle to display: will be inserted in <abbrtitle="HyperText Markup Language">HTML</abbr> page enclosed in <h2 class=“notifText”>…</h2></div>
<liclass="level3"><divclass="li"><text>: paragraph to display: will be inserted in <abbrtitle="HyperText Markup Language">HTML</abbr> page enclosed in <p class=“notifText”>…</p></div>
<liclass="level3"><divclass="li"><check>: paragraph to display with a checkbox: will be inserted in <abbrtitle="HyperText Markup Language">HTML</abbr> page enclosed in <p class=“notifCheck”><input type=“checkbox” />…</p></div>
<spanclass="sc3"><spanclass="re1"><title<spanclass="re2">></span></span></span>You have new authorizations<spanclass="sc3"><spanclass="re1"></title<spanclass="re2">></span></span></span>
<spanclass="sc3"><spanclass="re1"><text<spanclass="re2">></span></span></span>You have been granted to access to appli-1<spanclass="sc3"><spanclass="re1"></text<spanclass="re2">></span></span></span>
<spanclass="sc3"><spanclass="re1"><text<spanclass="re2">></span></span></span>You have been granted to access to appli-2<spanclass="sc3"><spanclass="re1"></text<spanclass="re2">></span></span></span>
<spanclass="sc3"><spanclass="re1"><check<spanclass="re2">></span></span></span>I know that I can access to appli-1 <spanclass="sc3"><spanclass="re1"></check<spanclass="re2">></span></span></span>
<spanclass="sc3"><spanclass="re1"><check<spanclass="re2">></span></span></span>I know that I can access to appli-2 <spanclass="sc3"><spanclass="re1"></check<spanclass="re2">></span></span></span>
<spanclass="sc3"><spanclass="re1"><title<spanclass="re2">></span></span></span>This is your first access on this system<spanclass="sc3"><spanclass="re1"></title<spanclass="re2">></span></span></span>
<spanclass="sc3"><spanclass="re1"><text<spanclass="re2">></span></span></span>Be a nice user and do not break it please.<spanclass="sc3"><spanclass="re1"></text<spanclass="re2">></span></span></span>
<spanclass="sc3"><spanclass="re1"><check<spanclass="re2">></span></span></span>Of course I am not evil!<spanclass="sc3"><spanclass="re1"></check<spanclass="re2">></span></span></span>
<ahref="http://perldoc.perl.org/functions/print.html"><spanclass="kw3">print</span></a><spanclass="st0">"$res notification(s) have been inserted<spanclass="es0">\n</span>"</span><spanclass="sy0">;</span>
<ahref="http://perldoc.perl.org/functions/print.html"><spanclass="kw3">print</span></a><spanclass="st0">"$res notification(s) have been deleted<spanclass="es0">\n</span>"</span><spanclass="sy0">;</span>