lib

# 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:

author: | Tilo Lutz
author: | Roland Gruber

### array_delete [line 70]

`array array_delete( array $values, array $array)`

This function will return all values from $array without values of $values.

#### Tags:

return: | list of remaining values

#### Parameters

array | $values | list of values which should be removed
array | $array | list of original values

[ Top ]

### cleanLDAPResult [line 654]

`array cleanLDAPResult( array $entries)`

Cleans the result of an LDAP search.

This will remove all 'count' entries and also all numeric array keys.

#### Tags:

return: | cleaned entries

#### Parameters

array | $entries | LDAP entries in format $entries[entry number][attribute name][attribute values]

[ Top ]

### escapeDN [line 521]

`String escapeDN( String $dn)`

Escapes any special characters in an LDAP DN.

#### Tags:

return: | escaped DN

#### Parameters

String | $dn | DN

[ Top ]

### generateRandomPassword [line 288]

`String generateRandomPassword( )`

Generates a random password with 12 digits.

#### Tags:

return: | password

[ Top ]

### getAbstractDN [line 684]

`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:

return: | transformed DN

#### Parameters

String | $dn | DN

[ Top ]

### getdays [line 102]

`number getdays( )`

This function will return the days from 1.1.1970 until now.

#### Tags:

return: | of days

[ Top ]

### getLastLDAPError [line 624]

`array getLastLDAPError( )`

Returns the parameters for a StatusMessage of the last LDAP search.

#### Tags:

return: | parameters for StatusMessage or null if all was ok

[ Top ]

### getshells [line 41]

`array getshells( )`

Returns a list of shells listed in config/shells.

#### Tags:

return: | list of shell names

[ Top ]

### get_preg [line 372]

`boolean get_preg( string $argument, string $regexp)`

Checks if a given value matches the selected regular expression.

#### Tags:

return: | true if matches, otherwise false

#### Parameters

string | $argument | value to check
string | $regexp | pattern name

[ Top ]

### in_array_ignore_case [line 86]

`void in_array_ignore_case( $needle, $haystack)`

Checks if a string exists in an array, ignoring case.

#### Parameters

| $needle |
| $haystack |

[ Top ]

### lmPassword [line 137]

`string lmPassword( string $password)`

Generates the LM hash of a password.

#### Tags:

return: | password hash

#### Parameters

string | $password | password original password

[ Top ]

### ntPassword [line 151]

`string ntPassword( string $password)`

Generates the NT hash of a password.

#### Tags:

return: | password hash

#### Parameters

string | $password | password original password

[ Top ]

### pwd_disable [line 246]

`string pwd_disable( string $hash)`

Marks an password hash as disabled and returns the new hash string

#### Tags:

return: | disabled hash value

#### Parameters

string | $hash | hash value to disable

[ Top ]

### pwd_enable [line 221]

`string pwd_enable( string $hash)`

Marks an password hash as enabled and returns the new hash string

#### Tags:

return: | enabled password hash

#### Parameters

string | $hash | hash value to enable

[ Top ]

### pwd_hash [line 171]

`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:

return: | the password hash

#### 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)

[ Top ]

### pwd_is_enabled [line 271]

`boolean pwd_is_enabled( string $hash)`

Checks if a password hash is enabled/disabled

#### Tags:

return: | true if the password is marked as enabled

#### Parameters

string | $hash | password hash to check

[ Top ]

### searchLDAP [line 605]

`array searchLDAP( String $suffix, String $filter, array $attributes)`

Runs an LDAP search.

#### Tags:

return: | list of found entries

#### Parameters

String | $suffix | LDAP suffix
String | $filter | filter
array | $attributes | list of attributes to return

[ Top ]

### searchLDAPByAttribute [line 540]

`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:

return: | list of found entries

#### 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

[ Top ]

### searchLDAPByFilter [line 580]

`array searchLDAPByFilter( String $filter, array $attributes, array $scopes)`

This will search the given LDAP suffix for all entries which match the given filter.

#### Tags:

return: | list of found entries

#### Parameters

String | $filter |
array | $attributes | list of attributes to return
array | $scopes | account types

[ Top ]

### search_domains [line 303]

`array search_domains( [ $server = null], [ $suffix = null])`

Returns an array with all Samba 3 domain entries under the given suffix

#### Tags:

return: | list of samba3domain objects

#### Parameters

| $server |
| $suffix |

[ Top ]

### smbflag [line 114]

`string smbflag( array $input)`

Takes a list of Samba flags and creates the corresponding flag string.

#### Tags:

return: | Samba flag string

#### Parameters

array | $input | is an array of Samba flags (e.g. X or D)

[ Top ]

Documentation generated on Thu, 28 Oct 2010 21:00:03 +0200 by phpDocumentor 1.4.1