LDAPAccountManager/lam-web/developers/phpdoc/LDAP/Ldap.html

737 lines
21 KiB
HTML

<html>
<head>
<title>Docs For Class Ldap</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
<tr>
<td class="header_top">LDAP</td>
</tr>
<tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt="" /></td></tr>
<tr>
<td class="header_menu">
[ <a href="../classtrees_LDAP.html" class="menu">class tree: LDAP</a> ]
[ <a href="../elementindex_LDAP.html" class="menu">index: LDAP</a> ]
[ <a href="../elementindex.html" class="menu">all elements</a> ]
</td>
</tr>
<tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt="" /></td></tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="200" class="menu">
<div id="ric">
<p><a href="../ric_README.html">README</a></p>
<p><a href="../ric_INSTALL.html">INSTALL</a></p>
</div>
<b>Packages:</b><br />
<a href="../li_configuration.html">configuration</a><br />
<a href="../li_Help.html">Help</a><br />
<a href="../li_LDAP.html">LDAP</a><br />
<a href="../li_lib.html">lib</a><br />
<a href="../li_lists.html">lists</a><br />
<a href="../li_main.html">main</a><br />
<a href="../li_modules.html">modules</a><br />
<a href="../li_PDF.html">PDF</a><br />
<a href="../li_profiles.html">profiles</a><br />
<a href="../li_selfService.html">selfService</a><br />
<a href="../li_tests.html">tests</a><br />
<a href="../li_tools.html">tools</a><br />
<a href="../li_types.html">types</a><br />
<br /><br />
<b>Files:</b><br />
<div class="package">
<a href="../LDAP/_lib_ldap_inc.html"> ldap.inc
</a><br>
</div><br />
<b>Classes:</b><br />
<div class="package">
<a href="../LDAP/Ldap.html">Ldap</a><br />
</div>
</td>
<td>
<table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">
<h1>Class: Ldap</h1>
Source Location: /lib/ldap.inc<br /><br />
<table width="100%" border="0">
<tr><td valign="top">
<h3><a href="#class_details">Class Overview</a></h3>
<pre></pre><br />
<div class="description">Ldap manages connection to LDAP and includes several helper functions.</div><br /><br />
</td>
<td valign="top">
<h3><a href="#class_vars">Variables</a></h3>
<ul>
<li><a href="../LDAP/Ldap.html#var$attributes">$attributes</a></li>
<li><a href="../LDAP/Ldap.html#var$conf">$conf</a></li>
<li><a href="../LDAP/Ldap.html#var$objectClasses">$objectClasses</a></li>
<li><a href="../LDAP/Ldap.html#var$password">$password</a></li>
<li><a href="../LDAP/Ldap.html#var$rand">$rand</a></li>
<li><a href="../LDAP/Ldap.html#var$server">$server</a></li>
<li><a href="../LDAP/Ldap.html#var$supports_unix_hosts">$supports_unix_hosts</a></li>
<li><a href="../LDAP/Ldap.html#var$username">$username</a></li>
</ul>
</td>
<td valign="top">
<h3><a href="#class_methods">Methods</a></h3>
<ul>
<li><a href="../LDAP/Ldap.html#methodLdap">Ldap</a></li>
<li><a href="../LDAP/Ldap.html#methodclose">close</a></li>
<li><a href="../LDAP/Ldap.html#methodcmp_array">cmp_array</a></li>
<li><a href="../LDAP/Ldap.html#methodconnect">connect</a></li>
<li><a href="../LDAP/Ldap.html#methoddecrypt">decrypt</a></li>
<li><a href="../LDAP/Ldap.html#methoddecrypt_login">decrypt_login</a></li>
<li><a href="../LDAP/Ldap.html#methoddestroy">destroy</a></li>
<li><a href="../LDAP/Ldap.html#methodencrypt">encrypt</a></li>
<li><a href="../LDAP/Ldap.html#methodencrypt_login">encrypt_login</a></li>
<li><a href="../LDAP/Ldap.html#methodnew_rand">new_rand</a></li>
<li><a href="../LDAP/Ldap.html#methodsearch_units">search_units</a></li>
<li><a href="../LDAP/Ldap.html#methodserver">server</a></li>
<li><a href="../LDAP/Ldap.html#methodupdateCapabilities">updateCapabilities</a></li>
<li><a href="../LDAP/Ldap.html#methodupdateClasses">updateClasses</a></li>
<li><a href="../LDAP/Ldap.html#method__sleep">__sleep</a></li>
<li><a href="../LDAP/Ldap.html#method__wakeup">__wakeup</a></li>
</ul>
</td>
</tr></table>
<hr />
<table width="100%" border="0"><tr>
</tr></table>
<hr />
<a name="class_details"></a>
<h3>Class Details</h3>
<div class="tags">
[line 52]<br />
Ldap manages connection to LDAP and includes several helper functions.<br /><br /></div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />
<hr />
<a name="class_vars"></a>
<h3>Class Variables</h3>
<div class="tags">
<a name="var$attributes"></a>
<p></p>
<h4>$attributes = <span class="value"></span></h4>
<p>[line 68]</p>
Array with all attribute strings from the LDAP server<br /><br />
<br />
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>Type:</b>&nbsp;&nbsp;</td>
<td>mixed</td>
</tr>
</table>
</div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />
<a name="var$conf"></a>
<p></p>
<h4>$conf = <span class="value"></span></h4>
<p>[line 55]</p>
Object of Config to access preferences<br /><br />
<br />
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>Type:</b>&nbsp;&nbsp;</td>
<td>mixed</td>
</tr>
</table>
</div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />
<a name="var$objectClasses"></a>
<p></p>
<h4>$objectClasses = <span class="value"></span></h4>
<p>[line 66]</p>
Array with all objectClass strings from the LDAP server<br /><br />
<br />
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>Type:</b>&nbsp;&nbsp;</td>
<td>mixed</td>
</tr>
</table>
</div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />
<a name="var$password"></a>
<p></p>
<h4>$password = <span class="value"></span></h4>
<p>[line 63]</p>
LDAP password used for bind<br /><br />
<br />
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>Type:</b>&nbsp;&nbsp;</td>
<td>mixed</td>
</tr>
</table>
</div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />
<a name="var$rand"></a>
<p></p>
<h4>$rand = <span class="value"></span></h4>
<p>[line 75]</p>
Random number (changes on every page request)<br /><br />
<br />
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>Type:</b>&nbsp;&nbsp;</td>
<td>mixed</td>
</tr>
</table>
</div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />
<a name="var$server"></a>
<p></p>
<h4>$server = <span class="value"></span></h4>
<p>[line 58]</p>
Server handle<br /><br />
<br />
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>Type:</b>&nbsp;&nbsp;</td>
<td>mixed</td>
</tr>
</table>
</div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />
<a name="var$supports_unix_hosts"></a>
<p></p>
<h4>$supports_unix_hosts = <span class="value">&nbsp;false</span></h4>
<p>[line 72]</p>
Host attribute in inetOrgPerson<br /><br />
<br />
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>Type:</b>&nbsp;&nbsp;</td>
<td>mixed</td>
</tr>
</table>
</div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />
<a name="var$username"></a>
<p></p>
<h4>$username = <span class="value"></span></h4>
<p>[line 61]</p>
LDAP username used for bind<br /><br />
<br />
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>Type:</b>&nbsp;&nbsp;</td>
<td>mixed</td>
</tr>
</table>
</div><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br />
</div><br />
<hr />
<a name="class_methods"></a>
<h3>Class Methods</h3>
<div class="tags">
<hr />
<a name="methodLdap"></a>
<h3>constructor Ldap <span class="smalllinenumber">[line 80]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>Ldap Ldap(
object
$config)</code>
</td></tr></table>
</td></tr></table><br />
<br /><br />
<h4>Parameters:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">object&nbsp;&nbsp;</td>
<td><b>$config</b>&nbsp;&nbsp;</td>
<td>an object of class Config</td>
</tr>
</table>
</div><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodclose"></a>
<h3>method close <span class="smalllinenumber">[line 142]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>void close(
)</code>
</td></tr></table>
</td></tr></table><br />
Closes connection to server<br /><br /><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodcmp_array"></a>
<h3>method cmp_array <span class="smalllinenumber">[line 428]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>integer cmp_array(
string
$a, string
$b)</code>
</td></tr></table>
</td></tr></table><br />
Helper function to sort the unit DNs<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>return:</b>&nbsp;&nbsp;</td><td>0 if equal, 1 if $a is greater, -1 if $b is greater</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$a</b>&nbsp;&nbsp;</td>
<td>first argument to compare</td>
</tr>
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$b</b>&nbsp;&nbsp;</td>
<td>second argument to compare</td>
</tr>
</table>
</div><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodconnect"></a>
<h3>method connect <span class="smalllinenumber">[line 96]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>mixed connect(
string
$user, string
$passwd)</code>
</td></tr></table>
</td></tr></table><br />
Connects to the server using the given username and password<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>return:</b>&nbsp;&nbsp;</td><td>if connect succeeds the server handle is returned, else false</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$user</b>&nbsp;&nbsp;</td>
<td>user name</td>
</tr>
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$passwd</b>&nbsp;&nbsp;</td>
<td>password</td>
</tr>
</table>
</div><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methoddecrypt"></a>
<h3>method decrypt <span class="smalllinenumber">[line 371]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>string decrypt(
object
$data)</code>
</td></tr></table>
</td></tr></table><br />
Decrypts a string<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>return:</b>&nbsp;&nbsp;</td><td>decrypted string</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">object&nbsp;&nbsp;</td>
<td><b>$data</b>&nbsp;&nbsp;</td>
<td>string to decrypt</td>
</tr>
</table>
</div><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methoddecrypt_login"></a>
<h3>method decrypt_login <span class="smalllinenumber">[line 405]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>array decrypt_login(
)</code>
</td></tr></table>
</td></tr></table><br />
Decrypts username and password<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>return:</b>&nbsp;&nbsp;</td><td>array(user name, password)</td>
</tr>
</table>
</div>
<br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methoddestroy"></a>
<h3>method destroy <span class="smalllinenumber">[line 414]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>void destroy(
)</code>
</td></tr></table>
</td></tr></table><br />
Closes connection to LDAP server and deletes encrypted username/password<br /><br /><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodencrypt"></a>
<h3>method encrypt <span class="smalllinenumber">[line 350]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>object encrypted encrypt(
string
$data)</code>
</td></tr></table>
</td></tr></table><br />
Encrypts a string<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>return:</b>&nbsp;&nbsp;</td><td>string</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$data</b>&nbsp;&nbsp;</td>
<td>string to encrypt</td>
</tr>
</table>
</div><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodencrypt_login"></a>
<h3>method encrypt_login <span class="smalllinenumber">[line 394]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>void encrypt_login(
string
$username, string
$password)</code>
</td></tr></table>
</td></tr></table><br />
Encrypts username and password<br /><br /><br /><br />
<h4>Parameters:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$username</b>&nbsp;&nbsp;</td>
<td>LDAP user name</td>
</tr>
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$password</b>&nbsp;&nbsp;</td>
<td>LDAP password</td>
</tr>
</table>
</div><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodnew_rand"></a>
<h3>method new_rand <span class="smalllinenumber">[line 336]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>int new_rand(
)</code>
</td></tr></table>
</td></tr></table><br />
Calculates a new value for rand<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>return:</b>&nbsp;&nbsp;</td><td>New random value</td>
</tr>
</table>
</div>
<br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodsearch_units"></a>
<h3>method search_units <span class="smalllinenumber">[line 152]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>array search_units(
string
$suffix)</code>
</td></tr></table>
</td></tr></table><br />
Returns an array with all organizational units under the given suffix<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>return:</b>&nbsp;&nbsp;</td><td>DNs of organizational units</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$suffix</b>&nbsp;&nbsp;</td>
<td>search suffix</td>
</tr>
</table>
</div><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodserver"></a>
<h3>method server <span class="smalllinenumber">[line 295]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>object connection server(
)</code>
</td></tr></table>
</td></tr></table><br />
Returns the LDAP connection handle<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>return:</b>&nbsp;&nbsp;</td><td>handle</td>
</tr>
</table>
</div>
<br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodupdateCapabilities"></a>
<h3>method updateCapabilities <span class="smalllinenumber">[line 282]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>void updateCapabilities(
)</code>
</td></tr></table>
</td></tr></table><br />
Updates the capabilities values (var $supports_*)<br /><br /><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="methodupdateClasses"></a>
<h3>method updateClasses <span class="smalllinenumber">[line 179]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>void updateClasses(
)</code>
</td></tr></table>
</td></tr></table><br />
Reads the array of objectClasses from the LDAP server<br /><br /><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="method__sleep"></a>
<h3>method __sleep <span class="smalllinenumber">[line 300]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>void __sleep(
)</code>
</td></tr></table>
</td></tr></table><br />
Closes connection to LDAP server before serialization<br /><br /><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<hr />
<a name="method__wakeup"></a>
<h3>method __wakeup <span class="smalllinenumber">[line 308]</span></h3>
<div class="function">
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
<code>void __wakeup(
)</code>
</td></tr></table>
</td></tr></table><br />
Reconnects to LDAP server when deserialized<br /><br /><br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
</div><br />
<div class="credit">
<hr />
Documentation generated on Wed, 15 Nov 2006 18:00:50 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.2.3</a>
</div>
</td></tr></table>
</td>
</tr>
</table>
</body>
</html>