On Sun, 26 Nov 2000, Corisen wrote:
>hi, i'm designing an web-based registration. there will be a drop down list
>on this web-based form to select the user's department. i've thought of 2
>ways of dynamically populating the department drop-down list:
>
>1. design the ldap name space to contain department name and limit the ldap
>query to one level (from root: dc=mycompany, dc=com) to retrieve all the
>departments:
>i.e. uid=username, o=departmentname, dc=mycompany, dc=com
>
>2. store the department name in a mysql database and dynamically populate
>the drop-down list by querying mysql.
Why put the department name in the dn? The dn should contain unique,
non-changing data. It functions as the primary key for your LDAP database.
Would you include the employee's department as part of the primary key in
a relational database? -- No.
How about creating a department object for each of the departments in your
company? Then you can populate the drop-down using an LDAP query on
objectclass=department. Using the ldapsearch utility that is distributed
with OpenLDAP, the query might look like this:
ldapsearch "objectclass=department" cn
or
ldapsearch "objectclass=department" departmentname
Tony
--
Anthony E. Greene <[EMAIL PROTECTED]> <http://www.pobox.com/~agreene/>
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D
Chat: AOL/Yahoo: TonyG05 ICQ: 91183266
Linux. The choice of a GNU Generation. <http://www.linux.org/>
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list