From: Chris R. <chr...@me...> - 2002-01-28 13:51:52
|
"Cox, Todd (NCI)" <tc...@ma...> wrote: > Good morning all, > > I have a CGI program that lets an administrator search for users using the > Net::LDAP module. The psudeo code is: > > 1) Enter a string to search on (e.g. cox*) > 2) Return the result in a pick box. > 3) Re-draw the form with two tables; One with the current attribute values > of the user selected, the other with text fields to change the values. > 4) Foreach text field that has a new value change the value. > > > The problem with my program is around step two. I can get the pick box to > display the search results but I am having difficulty selecting the values > for the one DN that was selected by the administrator and passing the > current values to the first table. Presumably your search in step 1 is returning the attribute that you are trying to change. What your form basically needs to do is create a pair of fields for each value of the attribute. The first field in each pair should be a hidden field, and should contain the old value of the attribute (initialized from the search results), and the second field in each pair should be a simple text field initialized with the same value. When the user does the "Submit", compare all the 'old' values in the hidden fields with the new values in the text fields, this should give you enough information to do a minimal modify operation on the entry. The operation still isn't guaranteed to succeed of course; another client might modify the entry in between your steps 1 and 4. > I have tried building a hash of hashes while processing my search results > to store and pick later but I haven't had much luck. Does anyone have any > thoughts on a multi-form CGI using Net::LDAP? > > Todd Cox > National Cancer Institute > Rockville, MD > Cheers, Chris |