Developer FAQ


Q: Where is the ldap/config object?

A: The ldap object is in $_SESSION['ldap'] and the config object in $_SESSION['config'].



Q: How can I make LDAP operations, where is the user name and password?

A: LAM automatically reconnects to the LDAP server on every page load. You can use $_SESSION['ldap']->server() which is the LDAP server handle.
Be sure to include ldap.inc before (automatically included for account modules).

Example: ldap_search($_SESSION['ldap']->server(), $suffix, $filter, $attributes)



Q: What is the LDAP suffix for the different account types?

A: Just call $_SESSION['config']->get_Suffix($scope) where $scope is the account type (user,group, ...).
Be sure to include ldap.inc before (automatically included for account modules).

Example: $suffix = $_SESSION['config']->get_Suffix('user')



Q: How can I check if the user is really logged in and not calling the scripts by hand?

A: After the user successfully logged in to LAM the variable $_SESSION['loggedIn'] is set to true.



Q: What is the command for these error/warning/info messages?


A: Your script must include status.inc (automatically included for account modules) to display these messages.
The command is StatusMessage(<type>, <headline>, <text>[, <variables>]).

Parameters:

Format of special tags: