added ldap.inc

This commit is contained in:
Roland Gruber 2004-09-11 16:44:16 +00:00
parent 73fa74620d
commit 32e319da6a
2 changed files with 121 additions and 21 deletions

View File

@ -9,28 +9,73 @@
<h1>LDAP Account Manager - Code overview</h1> <h1>LDAP Account Manager - Code overview</h1>
<img src="images/lam_overview.png" width="877" height="620" border="0" <img src="images/lam_overview.png" width="877" height="620" border="0"
align="middle" alt="overview"><br> align="middle" alt="overview"><br>
<div style="text-align: left;">
<h2>Web pages:</h2>
<ul>
<li>Login<br>
</li>
<li><a href="config_pages.htm">Configuration</a></li>
<li><a href="lists.htm">Account lists</a><br>
</li>
<li>Account pages<br>
</li>
</ul>
<br> <br>
<h2>Libraries:</h2> <div style="text-align: left;">
<ul> <table style="text-align: left; width: 100%;" border="0" cellspacing="2"
<li>Account modules</li> cellpadding="2">
<li>PDF</li> <tbody>
<li>Account profiles</li> <tr>
<li>Configuration</li> <td style="vertical-align: top; width: 33%;">
<li>LDAP</li> <h2>Web pages:</h2>
<li>other libraries<br> <ul>
</li> <li>Login<br>
</ul> </li>
<li><a href="file:///daten/cvs/lam/docs/devel/config_pages.htm">Configuration</a></li>
<li><a href="file:///daten/cvs/lam/docs/devel/lists.htm">Account
lists</a><br>
</li>
<li>Account pages</li>
<li>Tools</li>
<ul>
<li>Profile editor</li>
<li>Samba 3 domains</li>
<li>File upload</li>
<li>OU editor</li>
<li>PDF editor<br>
</li>
</ul>
</ul>
</td>
<td style="vertical-align: top; width: 33%;">
<h2>Libraries:</h2>
<ul>
<li>Account modules (modules.inc)<br>
</li>
<li>PDF (pdf.inc)<br>
</li>
<li>Account profiles (profiles.inc)<br>
</li>
<li>Configuration (config inc)<br>
</li>
<li><a href="file:///daten/cvs/lam/docs/devel/ldap.htm">LDAP
(ldap.inc)</a><br>
</li>
<li>other libraries</li>
<ul>
<li>Blowfish</li>
<li>Cache</li>
<li>Lists</li>
<li>Status messages<br>
</li>
</ul>
</ul>
</td>
<td style="vertical-align: top; width: 33%;">
<h2>Configuration files:</h2>
<ul>
<li>Base module<br>
</li>
<li>Account modules</li>
<li>PDF templates</li>
<li>Account profiles</li>
<li>Configuration profiles<br>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
<br>
</div> </div>
</div> </div>
</body> </body>

55
lam/docs/devel/ldap.htm Normal file
View File

@ -0,0 +1,55 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="content-type">
<title>ldap.inc</title>
<link rel="stylesheet" type="text/css" href="style/layout.css">
</head>
<body>
<h1 style="text-align: center;">ldap.inc</h1>
<br>
<br>
This library provides the access to the LDAP server and its content.<br>
The <span style="font-weight: bold; font-style: italic;">$_SESSION['ldap']</span>
object reconnects automatically to the LDAP server on every page load.<br>
<br>
<br>
<h2>1. Server handle</h2>
All PHP functions which access LDAP require a server handle as
parameter. This is managed by ldap.inc.<br>
You can access it with <span
style="font-weight: bold; font-style: italic;">$_SESSION['ldap']-&gt;server</span>.<br>
<br>
<br>
<h2>2. Object classes</h2>
Account modules may want to check if the current LDAP server supports
all required object classes.<br>
<span style="font-weight: bold; font-style: italic;">$_SESSION['ldap']-&gt;objectClasses
</span>contains a list of object classes and their attributes which is
read from the LDAP server.<br>
<br>
<br>
<h2>3. En-/Decryption</h2>
For security reasons sensitive data like user passwords should be
encrypted before storing in session.<br>
<span style="font-weight: bold; font-style: italic;">$_SESSION['ldap']-&gt;encrypt(&lt;string&gt;)</span>
encrypts a string and returns a binary object. This can be decrypted
with <span style="font-weight: bold; font-style: italic;">$_SESSION['ldap']-&gt;decrypt(&lt;object&gt;)</span><br>
<br>
Ldap.inc will take care for the crypotographic key and if Blowfish or
MCrypt/AES is used.<br>
<br>
<br>
<h2>4. Random values</h2>
Ldap.inc contains a random integer value which is much more secure than
calling <span style="font-style: italic;">mt_rand()</span>. The value
changes on every page load and is accessible in <span
style="font-weight: bold; font-style: italic;">$_SESSION['ldap']-&gt;rand</span><span
style="font-style: italic;">.</span><br>
If you need multiple values you can get a new value by calling <span
style="font-weight: bold; font-style: italic;">$_SESSION['ldap']-&gt;new_rand()</span><span
style="font-style: italic;">.</span><br>
<br>
</body>
</html>