• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

15. Interfacing with LDAP-Enabled Directories > 15.3. Modifying LDAP Entries

Modifying LDAP Entries

The best way to illustrate adding, updating, and deleting LDAP entries is to build an example administrative interface that can perform these tasks. The main template of the application is a template named index.cfm, which is shown in Example 15-3. This template contains an HTML form with a single select box control containing the common names (first and last names) of each entry in the LDAP server. Below the select box are three buttons—one for adding a new entry, one for modifying an existing entry, and one for deleting an entry.

Example 15-3. Main LDAP administration template
<!--- Query the ldap server for all entries --->
<cfldap action="Query" name="GetEntries" server="localhost"
        attributes="dn,cn,sn,givenName" filter="(sn>=A)"
        start="dc=example,dc=com" scope="subtree" sort="sn, givenname">
   
<html>
<head>
  <title>LDAP Administration</title>
</head>
   
<center>
<h2>LDAP Administration</h2>
   
<!--- If a message was passed from the action form, display it --->
<cfif IsDefined('URL.Message')>
  <cfoutput>
  <h3 style="color: red;">#Message#</h3>
  </cfoutput>
</cfif>
   
<!--- Display the common name for each entry in a multi-select box.  Assign
      the DN to each option value --->
<form name="MyForm" action="Action.cfm" method="post">
   
<select name="dn" size="5">
    <cfoutput query=....

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint