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

- <type>: message type ("ERROR", "WARN", "INFO")
- <headline>: headline for the message (may include format tags)
- <type>: text for the message (may include format tags)
- <variables>: optional, array of variables to include in headline/text
  The positions in headline/text must be marked with %s before.

Format of special tags:

- {bold}text{endbold}: "text" is printed bold
- {color=#123456}text{endcolor}: "text" is printed in given color
- {link=http://nodomain.org}text{endlink}: This will add a link to http://nodomain.org which will be labeled "text"