Procedural File: account.inc
Source Location: /lib/account.inc
Classes:
samba3domain
Represents a Samba 3 domain entry
Page Details:
This provides several helper function for the account modules.
Tags:
array_delete [line 69]
array array_delete(
array $values, array $array)
|
|
This function will return all values from $array without values of $values.
Tags:
Parameters
array |
$values |
list of values which should be removed |
array |
$array |
list of original values |
cleanLDAPResult [line 692]
void cleanLDAPResult(
&$entries, array $entries)
|
|
Cleans the result of an LDAP search. This will remove all 'count' entries and also all numeric array keys.
Parameters
array |
$entries |
LDAP entries in format $entries[entry number][attribute name][attribute values] |
|
&$entries |
|
compareDN [line 744]
integer compareDN(
string $a, string $b)
|
|
Helper function to sort DNs.
Tags:
Parameters
string |
$a |
first argument to compare |
string |
$b |
second argument to compare |
deobfuscateText [line 798]
void deobfuscateText(
String $text)
|
|
Simple function to deobfuscate strings.
Parameters
String |
$text |
text to deobfuscate |
escapeDN [line 536]
String escapeDN(
String $dn)
|
|
Escapes any special characters in an LDAP DN.
Tags:
Parameters
formatLDAPTimestamp [line 776]
String formatLDAPTimestamp(
$time)
|
|
Formats an LDAP time string (e.g. from createTimestamp).
Tags:
Parameters
generateRandomPassword [line 287]
String generateRandomPassword(
)
|
|
Generates a random password with 12 digits.
Tags:
getAbstractDN [line 723]
String getAbstractDN(
String $dn)
|
|
Transforms a DN into a more user friendly format. E.g. "dc=company,dc=de" is transformed to "company > de".
Tags:
Parameters
getdays [line 101]
This function will return the days from 1.1.1970 until now.
Tags:
getLastLDAPError [line 663]
array getLastLDAPError(
)
|
|
Returns the parameters for a StatusMessage of the last LDAP search.
Tags:
getshells [line 41]
Returns a list of shells listed in config/shells.
Tags:
get_preg [line 382]
boolean get_preg(
string $argument, string $regexp)
|
|
Checks if a given value matches the selected regular expression.
Tags:
Parameters
string |
$argument |
value to check |
string |
$regexp |
pattern name |
in_array_ignore_case [line 85]
void in_array_ignore_case(
$needle, $haystack)
|
|
Checks if a string exists in an array, ignoring case.
Parameters
isObfuscatedText [line 811]
boolean isObfuscatedText(
String $text)
|
|
Checks if the given text is obfuscated.
Tags:
Parameters
String |
$text |
text to check |
ldapGetDN [line 644]
array ldapGetDN(
String $dn, [array $attributes = array('dn')])
|
|
Returns the given DN.
Tags:
Parameters
String |
$dn |
DN |
array |
$attributes |
list of attributes to fetch |
lmPassword [line 136]
string lmPassword(
string $password)
|
|
Generates the LM hash of a password.
Tags:
Parameters
string |
$password |
password original password |
ntPassword [line 150]
string ntPassword(
string $password)
|
|
Generates the NT hash of a password.
Tags:
Parameters
string |
$password |
password original password |
obfuscateText [line 786]
void obfuscateText(
String $text)
|
|
Simple function to obfuscate strings.
Parameters
String |
$text |
text to obfuscate |
pwd_disable [line 245]
string pwd_disable(
string $hash)
|
|
Marks an password hash as disabled and returns the new hash string
Tags:
Parameters
string |
$hash |
hash value to disable |
pwd_enable [line 220]
string pwd_enable(
string $hash)
|
|
Marks an password hash as enabled and returns the new hash string
Tags:
Parameters
string |
$hash |
hash value to enable |
pwd_hash [line 170]
string pwd_hash(
string $password, [boolean $enabled = true], [string $hashType = 'SSHA'])
|
|
Returns the hash value of a plain text password the hash algorithm depends on the configuration file
Tags:
Parameters
string |
$password |
the password string |
boolean |
$enabled |
marks the hash as enabled/disabled (e.g. by prefixing "!") |
string |
$hashType |
password hash type (CRYPT, SHA, SSHA, MD5, SMD5, PLAIN) |
pwd_is_enabled [line 270]
boolean pwd_is_enabled(
string $hash)
|
|
Checks if a password hash is enabled/disabled
Tags:
Parameters
string |
$hash |
password hash to check |
searchLDAP [line 622]
array searchLDAP(
String $suffix, String $filter, array $attributes)
|
|
Runs an LDAP search.
Tags:
Parameters
String |
$suffix |
LDAP suffix |
String |
$filter |
filter |
array |
$attributes |
list of attributes to return |
searchLDAPByAttribute [line 555]
array searchLDAPByAttribute(
String $name, String $value, String $objectClass, array $attributes, array $scopes)
|
|
This will search the given LDAP suffix for all entries which have the given attribute.
Tags:
Parameters
String |
$name |
attribute name (may be null) |
String |
$value |
attribute value |
String |
$objectClass |
object class (may be null) |
array |
$attributes |
list of attributes to return |
array |
$scopes |
account types |
searchLDAPByFilter [line 596]
array searchLDAPByFilter(
String $filter, array $attributes, array $scopes)
|
|
This will search the given LDAP suffix for all entries which match the given filter.
Tags:
Parameters
String |
$filter |
|
array |
$attributes |
list of attributes to return |
array |
$scopes |
account types |
search_domains [line 313]
array search_domains(
[ $server = null], [ $suffix = null])
|
|
Returns an array with all Samba 3 domain entries under the given suffix
Tags:
Parameters
smbflag [line 113]
string smbflag(
array $input)
|
|
Takes a list of Samba flags and creates the corresponding flag string.
Tags:
Parameters
array |
$input |
is an array of Samba flags (e.g. X or D) |
|