LDAPAccountManager/lam-web/developers/phpdoc/lib/_lib_account_inc.html

623 lines
20 KiB
HTML

<html>
<head>
<title>Docs for page account.inc</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">lib</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_lib.html" class="menu">class tree: lib</a> ]
[ <a href="../elementindex_lib.html" class="menu">index: lib</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="../lib/_lib_account_inc.html"> account.inc
</a><br>
<a href="../lib/_lib_cache_inc.html"> cache.inc
</a><br>
<a href="../lib/_lib_schema_inc.html"> schema.inc
</a><br>
<a href="../lib/_lib_security_inc.html"> security.inc
</a><br>
<a href="../lib/_lib_status_inc.html"> status.inc
</a><br>
</div><br />
<b>Classes:</b><br />
<div class="package">
<a href="../lib/AttributeType.html">AttributeType</a><br />
<a href="../lib/cache.html">cache</a><br />
<a href="../lib/MatchingRule.html">MatchingRule</a><br />
<a href="../lib/MatchingRuleUse.html">MatchingRuleUse</a><br />
<a href="../lib/ObjectClass.html">ObjectClass</a><br />
<a href="../lib/ObjectClassAttribute.html">ObjectClassAttribute</a><br />
<a href="../lib/SchemaItem.html">SchemaItem</a><br />
<a href="../lib/Syntax.html">Syntax</a><br />
</div>
</td>
<td>
<table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">
<h1>Procedural File: account.inc</h1>
Source Location: /lib/account.inc<br /><br />
<br>
<br>
<div class="contents">
<h2>Classes:</h2>
<dt><a href="../modules/samba3domain.html">samba3domain</a></dt>
<dd>Represents a Samba 3 domain entry</dd>
</div><br /><br />
<h2>Page Details:</h2>
This provides several helper function for the account modules.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>author:</b>&nbsp;&nbsp;</td><td>Roland Gruber</td>
</tr>
<tr>
<td><b>author:</b>&nbsp;&nbsp;</td><td>Tilo Lutz</td>
</tr>
</table>
</div>
<br /><br />
<h4>Includes:</h4>
<div class="tags">
include_once(<a href="../modules/_lib_createntlm_inc.html">"createntlm.inc"</a>) [line 34]<br />
Needed to calculate Samba passwords<br /><br /></div>
<br /><br />
<br /><br />
<br />
<hr />
<a name="functionarray_delete"></a>
<h3>array_delete <span class="smalllinenumber">[line 71]</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 array_delete(
array $values, array $array)</code>
</td></tr></table>
</td></tr></table><br />
This function will return all values from $array without values of $values.<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>list of remaining values</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters</h4>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">array&nbsp;&nbsp;</td>
<td><b>$values</b>&nbsp;&nbsp;</td>
<td>list of values which should be removed</td>
</tr>
<tr>
<td class="type">array&nbsp;&nbsp;</td>
<td><b>$array</b>&nbsp;&nbsp;</td>
<td>list of original values</td>
</tr>
</table>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functioncmp_domain"></a>
<h3>cmp_domain <span class="smalllinenumber">[line 421]</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_domain(
string $a, string $b)</code>
</td></tr></table>
</td></tr></table><br />
Helper function to sort the domains<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>
<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 class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functiongenpasswd"></a>
<h3>genpasswd <span class="smalllinenumber">[line 104]</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 genpasswd(
)</code>
</td></tr></table>
</td></tr></table><br />
This function will return a password with max. 8 characters.<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>password</td>
</tr>
</table>
</div>
<br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functiongetdays"></a>
<h3>getdays <span class="smalllinenumber">[line 165]</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>number getdays(
)</code>
</td></tr></table>
</td></tr></table><br />
This function will return the days from 1.1.1970 until now.<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>of days</td>
</tr>
</table>
</div>
<br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functiongetshells"></a>
<h3>getshells <span class="smalllinenumber">[line 42]</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 getshells(
)</code>
</td></tr></table>
</td></tr></table><br />
Returns a list of shells listed in config/shells.<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>list of shell names</td>
</tr>
</table>
</div>
<br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functionget_preg"></a>
<h3>get_preg <span class="smalllinenumber">[line 464]</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>boolean get_preg(
string $argument, string $regexp)</code>
</td></tr></table>
</td></tr></table><br />
Checks if a given value matches the selected regular expression.<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>true if matches, otherwise false</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters</h4>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$argument</b>&nbsp;&nbsp;</td>
<td>value to check</td>
</tr>
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$regexp</b>&nbsp;&nbsp;</td>
<td>pattern name</td>
</tr>
</table>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functionin_array_ignore_case"></a>
<h3>in_array_ignore_case <span class="smalllinenumber">[line 87]</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 in_array_ignore_case(
mixed $needle, mixed $haystack)</code>
</td></tr></table>
</td></tr></table><br />
Checks if a string exists in an array, ignoring case.<br /><br /> <br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functionlmPassword"></a>
<h3>lmPassword <span class="smalllinenumber">[line 200]</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 lmPassword(
string $password)</code>
</td></tr></table>
</td></tr></table><br />
Generates the LM hash of a 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>password hash</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters</h4>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$password</b>&nbsp;&nbsp;</td>
<td>password original password</td>
</tr>
</table>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functionntPassword"></a>
<h3>ntPassword <span class="smalllinenumber">[line 211]</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 ntPassword(
string $password)</code>
</td></tr></table>
</td></tr></table><br />
Generates the NT hash of a 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>password hash</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters</h4>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$password</b>&nbsp;&nbsp;</td>
<td>password original password</td>
</tr>
</table>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functionpwd_disable"></a>
<h3>pwd_disable <span class="smalllinenumber">[line 345]</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 pwd_disable(
string $hash)</code>
</td></tr></table>
</td></tr></table><br />
Marks an password hash as disabled and returns the new hash 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>disabled hash value</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters</h4>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$hash</b>&nbsp;&nbsp;</td>
<td>hash value to disable</td>
</tr>
</table>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functionpwd_enable"></a>
<h3>pwd_enable <span class="smalllinenumber">[line 320]</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 pwd_enable(
string $hash)</code>
</td></tr></table>
</td></tr></table><br />
Marks an password hash as enabled and returns the new hash 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>enabled password hash</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters</h4>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$hash</b>&nbsp;&nbsp;</td>
<td>hash value to enable</td>
</tr>
</table>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functionpwd_hash"></a>
<h3>pwd_hash <span class="smalllinenumber">[line 228]</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 pwd_hash(
string $password, [boolean $enabled = true], [string $hashType = &#039;SSHA&#039;])</code>
</td></tr></table>
</td></tr></table><br />
Returns the hash value of a plain text password the hash algorithm depends on the configuration file<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>the password hash</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters</h4>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$password</b>&nbsp;&nbsp;</td>
<td>the password string</td>
</tr>
<tr>
<td class="type">boolean&nbsp;&nbsp;</td>
<td><b>$enabled</b>&nbsp;&nbsp;</td>
<td>marks the hash as enabled/disabled (e.g. by prefixing &quot;!&quot;)</td>
</tr>
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$hashType</b>&nbsp;&nbsp;</td>
<td>password hash type (CRYPT, SHA, SSHA, MD5, SMD5, PLAIN)</td>
</tr>
</table>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functionpwd_is_enabled"></a>
<h3>pwd_is_enabled <span class="smalllinenumber">[line 370]</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>boolean pwd_is_enabled(
string $hash)</code>
</td></tr></table>
</td></tr></table><br />
Checks if a password hash is enabled/disabled<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>true if the password is marked as enabled</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters</h4>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$hash</b>&nbsp;&nbsp;</td>
<td>password hash to check</td>
</tr>
</table>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functionRndInt"></a>
<h3>RndInt <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>integer RndInt(
string $Format)</code>
</td></tr></table>
</td></tr></table><br />
THIS FUNCTION GENERATES A RANDOM NUMBER THAT WILL BE USED TO RANDOMLY SELECT CHARACTERS.<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>random number</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters</h4>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">string&nbsp;&nbsp;</td>
<td><b>$Format</b>&nbsp;&nbsp;</td>
<td>&quot;letter&quot; or &quot;number&quot;</td>
</tr>
</table>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functionsearch_domains"></a>
<h3>search_domains <span class="smalllinenumber">[line 387]</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_domains(
)</code>
</td></tr></table>
</td></tr></table><br />
Returns an array with all Samba 3 domain entries 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>list of samba3domain objects</td>
</tr>
</table>
</div>
<br /><br />
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<hr />
<a name="functionsmbflag"></a>
<h3>smbflag <span class="smalllinenumber">[line 177]</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 smbflag(
array $input)</code>
</td></tr></table>
</td></tr></table><br />
Takes a list of Samba flags and creates the corresponding flag 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>Samba flag string</td>
</tr>
</table>
</div>
<br /><br />
<h4>Parameters</h4>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="type">array&nbsp;&nbsp;</td>
<td><b>$input</b>&nbsp;&nbsp;</td>
<td>is an array of Samba flags (e.g. X or D)</td>
</tr>
</table>
<div class="top">[ <a href="#top">Top</a> ]</div><br /><br />
</div>
<div class="credit">
<hr />
Documentation generated on Wed, 15 Nov 2006 18:00:35 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.2.3</a>
</div>
</td></tr></table>
</td>
</tr>
</table>
</body>
</html>