Insert the results of a LDAP search into HTML or RXML.
<ldapoutput> works like output tags. By default
anything within #'s will be interpreted as a variable. Thus
#attribute_name# will be replaced by the attribute value. ## will be
replaced by a #. See formoutput
page for more information about quoting.
As the attribute can contains multiple values the #attribute_name#
expression returns first value only. Second, third ... values can be
specified by suffix before # (i.e second email value is written as
#mail:2#). Obviously this isn't more often usable. Better solution is
the subcontainer <ldapfor>, see bellow.
The <ldapoutput> tag will copy its contents and replace
the named attribute for each row in the result. If the result is
empty, the <ldapoutput> will not return anything.
Attributes
- host=hostname
-
Hostname of server on which directory server will connect to. If
omitted the default hostname will be used.
- name=user name
-
User name for connection to the directory server. If omitted the
default user name will be used.
- password=user password
-
User password for connection to the directory server. If omitted the
default will be used.
- basedn=base DN
-
Base DN of an object where is started search of
directory. Required.
- scope=base
onelevel
subtree
-
- name=attribute
-
The attribute name used for sorting output.
Note: Only one attribute name can be used.
- quiet
-
Do not show any errors in the page, in case the query fails.
- parse
-
If specified, the content will be parsed by the RXML parser.
Example
<table>
<tr>
<th>Name</th>
<th>Email</th>
<th>Home page</th>
</tr>
<ldapoutput host=test based="c=US"
filter="(&(objectclass=person)(mail=*))">
<tr>
<td>#givenname# #sn#</td>
<td>#mail#</td>
<td>#labeleduri#</td>
</tr>
</ldapoutput>
</table>
Name |
Email |
Home page |
#givenname# #sn# |
#mail# |
#labeleduri# |
|