-
Gateway Customization Guide Red Hat Directory Server Version 7.
-
Red Hat, Inc. 1801 Varsity Drive Raleigh NC 27606-2072 USA Phone: +1 919 754 3700 Phone: 888 733 4281 Fax: +1 919 754 3701 PO Box 13588 Research Triangle Park NC 27709 USA © 2001 Sun Microsystems, Inc. Used by permission. © 2005 by Red Hat, Inc. All rights reserved. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, V1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/).
-
Contents List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
Chapter 2 Setting Up the Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Gateway Installation Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Location of Gateway Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Gateway Cloning . . . . . . . . . . . . . . . . . . . . . . .
-
Setting Up Locales for Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 dsgw-l10n.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Chapter 4 File Controlling Gateway Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Files Controlling Gateway Functionality . . . . . . . . . . . . . .
-
Modifying Search Attributes for Advanced Searches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Standard and Advanced Searches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying Search Attributes for Person . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Directory Express Search Support for User ID . . . . . . . . . . . . . . . . . . . .
-
Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 changeHTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Format . . . . . . . . . . .
-
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . securitypath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example . . . . . . . . . . . . . . .
-
Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DS_POSTEDVALUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
Arguments for ELSE and ENDIF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Miscellaneous Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BODY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
domodify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 newentry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 dosearch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Index . . . . . . . . . . . .
-
Red Hat Directory Server Gateway Customization Guide • April 2005
-
Preface The descriptions, instructions, and examples in this guide can be used to create and modify a gateway instance to suit the needs of users in your organization.
-
Conventions Used in This Book Conventions Used in This Book This section explains the conventions used in this book. • Monospaced font — This typeface is used for any text that appears on the computer screen or text that you should type. It is also used for filenames, functions, and examples. • Notes and Cautions text boxes. NOTE Notes and Cautions mark important information. Make sure you read the information before continuing with a task.
-
Related Information • Red Hat Directory Server Deployment Guide. Provides an overview for planning your deployment of the Directory Server. Includes deployment examples. • Red Hat Directory Server Installation Guide. Contains procedures for installing your Directory Server as well as procedures for migrating your Directory Server. • Red Hat Directory Server Administrator’s Guide. Contains procedures for the day-to-day maintenance of your directory service.
-
Related Information 20 Red Hat Directory Server Gateway Customization Guide • April 2005
-
Chapter 1 Introduction This chapter describes the gateway functionality of Red Hat Directory Server (Directory Server). The chapter contains the following sections: • What Is a Gateway? (page 21) • Directory Express and Default Gateway (page 23) • Support for Multiple Gateway Instances (page 25) • Anonymous and Non-Anonymous Searching (page 27) • Automatic Updates to Directory Configuration (page 27) What Is a Gateway? A gateway is an HTTP-to-LDAP client that lives on an HTTP server.
-
What Is a Gateway? Gateways Installed with Directory Server Two gateway instances are installed during Directory Server installation: the default gateway and Directory Express. Both gateways are configured to use the suffix set when the Directory Server was configured and non-SSL (Secure Socket Layer) communications. NOTE A Java gateway based on the DSML protocol is also installed with Directory Server.
-
Directory Express and Default Gateway Directory Express The configuration file for Directory Express is serverRoot/clients/dsgw/context/pb.conf. During Directory Server installation, Directory Express is configured to use the Red Hat Administration Server installed with the directory as its HTTP server.
-
Directory Express and Default Gateway 24 Figure 1-1 Directory Express: Search Result Figure 1-2 Directory Express: Extended Search Results Red Hat Directory Server Gateway Customization Guide • April 2005
-
Support for Multiple Gateway Instances Default Gateway (dsgw.conf) In addition to the standard search form, the default gateway provides an advanced search form, a Directory Server authentication form, and a form for adding and modifying entries. Figure 1-3 Default Gateway Support for Multiple Gateway Instances Directory Server supports multiple gateway instances — that is, many gateways can access directory data from the same HTTP server without conflict. The .
-
Support for Multiple Gateway Instances Specifying Gateway Configuration to Gateway CGIs Information about which .conf file to use is communicated in the QUERY STRING using a GET and through a hidden variable on a POST. GET Operations (GCONTEXT) In a GET operation, gateway CGIs get the gateway context from the QUERY STRING in the URL. Use the GCONTEXT directive in all URLs to gateway CGIs. Embed after the CGI name, as shown in the example that follows.
-
Anonymous and Non-Anonymous Searching http://adminHost:adminPort/clients/dsgw/bin/lang?context= The default gateway and Directory Express are available from the page for the Red Hat Administration Server (http://adminHost:adminPort). Anonymous and Non-Anonymous Searching The gateway supports both anonymous and non-anonymous searching. Anonymous searching provides basic permissions for accessing information in the user directory.
-
Automatic Updates to Directory Configuration The updatedsgw script runs automatically for gateways installed on the Red Hat Administration Server managing the Directory Server instance. When the server port or root DN (or other settings, such as directory manager) for a Directory Server instance is changed, the Red Hat Administration Server managing the Directory Server instance runs the updatedsgw script.
-
Chapter 2 Setting Up the Gateway This chapter describes the planning decisions and tasks required to install and initially configure a gateway for access by end users. The chapter contains the following sections: • Gateway Installation Planning (page 29) • HTTP Server Configuration (page 32) • Creating a New Gateway Instance (page 36) • Gateway .
-
Gateway Installation Planning Two gateway instances are installed during Directory Server installation: Red Hat Directory Express (Directory Express) and the default gateway. The configuration files (pb.conf and dsgw.conf) for the two instances are stored in the serverRoot/clients/dsgw/context directory. Additional gateways can be created by customizing Directory Express or the default gateway.
-
Gateway Installation Planning Protecting Bind DN and Password The gateway configuration files reference files that contain sensitive information, including the binddnfile parameter containing the bind DN and bind password used to permit non-anonymous searching of the directory. The binddnfile should not be stored under the gateway configuration directory (serverRoot/clients/dsgw) or in any directory that is served up over HTTP.
-
HTTP Server Configuration There are many factors affecting gateway performance on an HTTP server, including the following: • The number of users accessing the gateway at a given time. • The complexity of the directory searches performed and the search results required. • Whether the gateway is additionally to be used for authentication and login. • The load from other processes managed by the host machine. • The speed and performance of the computer hardware selected for the host computer.
-
HTTP Server Configuration Name Translation Mapping The HTTP server uses Name Translation mapping to translate a virtual path provided by a gateway client to a physical path used by an HTTP server. This Name Translation mapping specifies the gateway’s HTML directory. The gateway’s CGIs use this information to output the correct URL (HTTP redirection). The NameTrans mapping is specified in the gateway’s configuration file using the gwnametrans parameter.
-
HTTP Server Configuration 2. Adding the following CGI directories (under Program Management). Prefix: /clients/dsgw/bin CGI Directory: serverRoot/clients/dsgw/bin (On Windows, add them as shell CGI directories.) 3. Adding an additional Document directory (under Content Management). Prefix: /clients Directory: serverRoot/clients 4. Changing permissions of the cookie directory (required for UNIX only).
-
HTTP Server Configuration 2. Add an additional document directory. Adding an additional document directory is necessary to establish access to the gateway files. For additional information, see http://enterprise.netscape.com/docs/enterprise/611/admin/esco ntnt.htm#22280. From the Class Manager for the Red Hat Enterprise Server: a. Select Content Management > Additional Document Directories. b. In the URL Prefix field, enter this: clients/dsgw c.
-
Creating a New Gateway Instance http://webserverHost:webserverPort/clients/dsgw/bin/search where webserverHost is the HTTP server’s hostname and webserverPort is the port number used by the server. When the HTTP server is using the standard HTTP port number (80), the port number does not need to be included in the URL. Creating a New Gateway Instance These instructions assume that the new gateway instance will run under the Red Hat Administration Server or a similarly capable HTTP server. 1.
-
Gateway .conf File Configuration 7. To access the new gateway instance (in this example, example.conf) navigate the browser to this URL: http://adminHost:adminPort/clients/dsgw/bin/lang?context=example Gateway Cloning The HTML and template directories for one gateway can serve as the HTML and template directory for many others.
-
Gateway .conf File Configuration It is strongly recommended that you use a different directory manager account for the gateway, an account other than cn=Directory Manager. Once you setup the new directory manager account (for example, cn=gateway manager,cn=config), use ACLs to restrict access to applicable sub suffixes and the user entries under those sub suffixes.
-
Gateway .conf File Configuration Figure 2-1 Authenticating as Directory Manager Setting Up the Suffix for Adding Entries The location-suffix parameter is defined in dsgw.conf and identifies the suffix under which the gateway creates new entries in the directory. The location-suffix parameter can point to any suffix in a directory. Setting the location-suffix parameter is described in “include,” on page 98.
-
Configuring Gateway Clients Enabling SSL communications on the Directory Server is described in the Red Hat Directory Server Administrator’s Guide. Information about managing key and certificate databases is provided in Managing Servers with Red Hat Console. Configuring the Gateway to Use SSL The securitypath parameter specifies the location of the certificate database.
-
Configuring Gateway Clients Language Support for HTTP Clients When a user accesses information in the directory from an HTTP client — through the gateway or another HTTP-based LDAP interface — the client provides the Directory Server with information indicating the optimal character set and collation order to use in transmitting information to the browser. Unicode and Latin-1 Character Sets When the user is using Netscape Communicator, the Directory Server sends Unicode characters.
-
Configuring Gateway Clients Customizing Communicator’s LDAP Settings Administrators can reconfigure Javascript preference settings in Communicator to allow users to interact with information stored in the user directory. 42 • In the Address Book and Select Address dialog boxes (accessible from the mail composition window), users can enter one string of search criteria to search an LDAP directory for matching names.
-
Chapter 3 Gateway Localization This chapter describes gateway localization and identifies the tasks required to set up additional gateway locales.
-
How the Gateway Selects a Character Set How the Gateway Selects a Character Set The gateway can output web pages in many character sets. The gateway selects a character set for each HTTP client based on a combination of input from the client and from the gateway's configuration files. The gateway selects a character set for transmission according to this priority: • Character set defined in the client's HTTP Accept-charset header.
-
Special Characters HTTP Clients that Do Not Request UTF-8 For browsers that do not request UTF-8 by default, the gateway selects a character set from the Accept-Charset request header or from the Accept-Language request header, depending on the HTTP client. Some HTTP clients don't request any character set information. For these clients, the gateway's charset parameter definition is the default. When the charset parameter is not defined in the dsgw.
-
Gateway Locales This works around a problem with Japanese NT, which garbles environment variables that are in UTF-8 (or any charset except Shift_JIS). The Web server passes information to the gateway CGI programs in environment variables, but the query string environment variable $QUERY_STRING is URL-encoded, so it can handle UTF-8 (from Windows' point of view, it's ASCII). Gateway Locales The gateway's default language is US English.
-
Setting Up Locales for Translation dsgw-l10n.conf dsgw-l10n.conf provides translation in the Search and Advanced Search pull-down menus for the default gateway (dsgw.conf). If dsgw-l10n.conf is not present in the /config/lang directory, translation of the UI does not occur and English characters appear in the pull-down menus for Standard Search and Advanced Search. The following example shows how to create a new locale using Chinese as the language for translation: 1.
-
Setting Up Locales for Translation 48 Red Hat Directory Server Gateway Customization Guide • April 2005
-
Chapter 4 File Controlling Gateway Functionality This chapter provides examples of customized gateways. The chapter contains the following sections: • Files Controlling Gateway Functionality (page 49) • Gateway .
-
Gateway .conf Files Files that control gateway functionality are described in Table 4-1. Table 4-1 Gateway File Types and Locations Files Function Location Gateway .conf files Define basic configuration parameters for the gateway and specify the HTML and template directory. (See “Gateway .conf Files” on page 51.) serverRoot/clients/dsgw/context Gateway search configuration files Define how the gateway performs searches in the Directory. (See “Gateway Search Configuration Files” on page 51.
-
Gateway Search Configuration Files • The locations where new entries can be created within the directory. • The types of entries that can be created. • The search base. • Whether the gateway uses SSL communications. dsgw.conf dsgw.conf is the configuration file for the default gateway. dsgw.conf is invoked at: http://adminHost:adminPort/clients/dsgw/bin/lang?context=dsgw pb.conf pb.conf is the configuration file for Directory Express, a gateway customized as a directory lookup tool. pb.
-
Object Class Templates Object Class Templates The gateway contains a template file for each object class defined in the gateway. To modify how the gateway displays an entry type, edit the corresponding template file. To add gateway support for a new object class, create a new template file, or modify an existing one. Modifying template files is discussed in Chapter 5, “Editing Entry Types.
-
Gateway Search Result Templates Table 4-3 Gateway Forms and Corresponding Script Files Set of Forms Corresponding Script Files Authentication forms authPassword.html authSearch.html Standard search forms searchString.html Advanced search forms csearchAttr.html csearchBase.html csearchMatch.html csearchString.html csearchType.html Newentry forms newentry.html newentryType.html newentryName.
-
Banner Files Chapter 6, “Search Attributes, Filters, and Results,” describes how search result templates can be edited to modify the display of search results. Banner Files Banner files identified in Table 4-5 are used to specify the banner and button images that appear in gateway forms. Table 4-5 Banner Files Controlling Appearance of Gateway Forms Banner File Controls Appearance of Banner and Buttons in ... maintitle.html Main form authtitle.html Authentication form csearchtitle.
-
Chapter 5 Editing Entry Types This chapter describes how entry type formats — defined by object classes and their attributes — can be controlled by editing parameters in the dsgw.conf file.
-
Entry Types (Object Classes) template The template parameter is used to map the gateway’s HTML templates for entry types to the Directory Server’s LDAP object classes. location The location parameter is used to define points in the directory tree where new entries can be added. The location parameter definitions must precede newtype parameter definitions in the .conf file. newtype Each entry type is described by a newtype parameter.
-
Mapping Locations and Entry Types Considerations for Adding New Entry Types Before adding support for a new entry type (object class), decide: • Where will the new entry be created? If a location parameter is not set up to point to the location where the new entry type will be created, add a new location parameter to the dsgw.conf file.
-
Mapping Locations and Entry Types location location location location location location location location country org groups acct hr pay pd test "United States" "This Organization" "Organizational Groups" "Accounting" "Human Resources" "Payroll" "Product Development" "Product Testing" "c=US#" "" "ou=Groups" "ou=Accounting" "ou=Human Resources" "ou=Payroll" "ou=Product Development" "ou=Product Testing" newtype newtype newtype newtype newtype orgperson NTperson groupun orgunit org "Person" "NT Person"
-
Object Class Attributes in Template Files UID-Based DN When a person or Windows person entry is added to the directory, the gateway prompts for a unique DN. The unique DN is typically the user ID of a person in the organization. Although DN formats can be based on the common names of employees in the organization, common names are frequently not unique within an organization. NOTE UID-based DN formats are recommended because they are by nature unique and can prevent naming collisions within the directory.
-
Object Class Attributes in Template Files Default Gateway Object Classes The default gateway supports the object classes listed in Table 5-1. Table 5-1 Default Object Classes Default Gateway Object Class Related Template File domain component display-dc.html groupOfNames display-group.html groupOfUniqueNames display-groupun.html ntGroup display-ntgroup.html organization display-org.html organizationalUnit display-orgunit.html person display-person.html inetOrgPerson display-orgperson.
-
Object Class Attributes in Template Files Adding Attributes to Object Classes Adding an attribute to an object class requires adding an additional row to the HTML table in the template file where the object class is defined.
-
Object Class Attributes in Template Files 2. Insert a null pair to replace the deleted attribute.
Pager: | | | |
NOTE When deleting a single attribute-value pair from a row, replace the two deleted cells with two cells containing the non-breaking space character.
-
Object Class Attributes in Template Files 2. Edit the third line in the template file to indicate the name of the new directory entry type. Change: to 3. Edit the DS_OBJECTCLASS directive to include the new object class. Change: to 4. Add the value for exampleperson to the input type.
-
Object Class Attributes in Template Files 6. Define a template parameter in dsgw.conf for the object class examplePerson: template exampleperson person inetorgperson exampleperson This will instruct the gateway to display the exampleperson entry type according to the template defined for the examplePerson object class (display-exampleperson.html). 7. Update the Directory Server schema to include the examplePerson object class. 8.
-
Chapter 6 Search Attributes, Filters, and Results This chapter describes the files that control how the gateway searches for objects and describes how to add search support for a new object.
-
Changing Search Scope • The label of the search attribute as it is displayed in the Find drop-down list on the Search form . • The object class attribute to search on. • Match types to use in search results. NOTE Define new search preferences in dsgwsearchprefs.conf whenever a new object class with searchable attributes is added to the gateway. dsgwfilter.conf The dsgwfilter.conf file contains an entry for each search object defined in dsgwsearchprefs.conf.
-
Modifying Search Attributes for Advanced Searches Table 6-1 Valid Search Scopes (Continued) Search Scope Tells the Gateway to... onelevel Not to search in the entry specified in the baseurl parameter but search in the most immediate children of the entry. subtree Search the entry specified in the baseurl parameter and all of its children. This is the default setting. Modifying Search Attributes for Advanced Searches Each search object entry in dsgwsearchprefs.
-
Modifying Search Attributes for Advanced Searches Figure 6-1 Advanced Search Form: Search Results The figures that follow show the matching patterns that can be selected in the Advanced Search form. Figure 6-2 shows the entry type pop-up menu on the Advanced Search form.
-
Modifying Search Attributes for Advanced Searches Figure 6-2 Advanced Search Form: Entry Type Figure 6-3 shows the attribute pop-up menu on the Advanced Search form. Figure 6-3 Advanced Search Form: Attribute Figure 6-4 shows the matching filter pop-up menu on the Advanced Search form.
-
Modifying Search Attributes for Advanced Searches Figure 6-4 Advanced Search Form: Matching Filter Specifying Search Attributes for Person The dsgwsearchprefs.
-
Modifying Search Attributes for Advanced Searches The third column contains a string of six bits. Each bit position in the string maps to a match type, as shown in Table 6-2. A value of 1 indicates that the match type is valid for the associated attribute. A value of 0 indicates that the match type is not valid.
-
Adding Search Support for a New Object "dsgw-people" subtree "full name" cn 111111 "" "" "last name" sn 111111 "" "" "phone number" "telephoneNumber" 111011 "" "" "e-mail address" "mail" 111111 "" "" "user id" "uid" 111111 "" "" "title" title 111111 "" "" "pager number" pagerTelephoneNumber 111011 "" "" As a result of adding this syntax to dsgwsearchprefs.conf: • A pager number selection will appear in the drop-down menu on the Advanced Search form.
-
Adding Search Support for a New Object People "" "Search for": "(&(objectClass=person)(objectClass=examplePerson)" "dsgw-people" subtree "full name" cn 111111 "" "" "last name" sn 111111 "" "" "phone number" "telephoneNumber" 111011 "" "" "e-mail address" "mail" 111111 "" "" "user id" "uid" 111111 "" "" "title" title 111111 "" "" "birthdate" dateOfBirth 111011 " " " " As a result of adding the syntax shown in the example: • The gateway will include examplePerson entries in its search for persons.
-
Modifying Default Search Filters not-used-by-dsgw not-used-by-dsgw subtree "name" "cn" 111111 "" "" "location" "l" 111111 "" "" "occupant" "roleOccupant" 111111 "" "" "description" "description" 111011 "" "" "phone number" "telephoneNumber" 111011 "" "" END "is" "(%a=%v))" "is not" "(!(%a=%v)))" "sounds like" "(%a~=%v))" "starts with" "(%a=%v*))" "ends with" "(%a=*%v))" "contains" "(%a=*%v*))" END The syntax in the above example specifies a list of filters for searching attributes in the OrgRole object cl
-
Modifying Default Search Filters • Search Filters for User Data Patterns • Specifying a Search Filter for a New Object Search Filters for User Data Patterns This example shows typical search filter syntax for any search string containing the @ symbol. In this example, the gateway will respond to search strings containing the @ symbol (the pattern) by searching the mail attribute for values that are equal to or start with the supplied value (the filter).
-
Customizing Search Result Templates Customizing Search Result Templates The following sections describe how the gateway displays search results and contains procedures for customizing the gateway search result templates: • How the Gateway Displays Search Results • Modifying Search Result Templates How the Gateway Displays Search Results When a user submits a standard search or advanced search from the gateway, the gateway constructs a search string and filter for the corresponding search object and que
-
Customizing Search Result Templates Figure 6-5 Search Results Table 6-3 lists the default gateway search objects and the information displayed on the search results list. Search results templates are stored in the serverRoot/clients/dsgw/config directory and use the list-search object.html file naming convention. Table 6-3 Default Search Results for Search Objects Search Object Search Result Template Used Search Results Displayed Domain Component list-Domaincomponent.
-
Customizing Search Result Templates Table 6-3 Default Search Results for Search Objects (Continued) Search Object Search Result Template Used Search Results Displayed Org-Units list-Org-Units.html Organizational unit name, description, and phone number. Anything list-Anything.html Name, phone number, e-mail address, and description. A new search result template is required for each new object class that is not a child of another object class.
-
Customizing Search Result Templates
| The additional HTML table heading syntax adds the Organizational Unit label to the heading row of the table. The additional DS_ATTRIBUTE directive syntax adds a cell to the body row of the table indicating that the information is stored in the ou attribute of the entry and the string is case insensitive.
-
Customizing Search Result Templates 82 Red Hat Directory Server Gateway Customization Guide • April 2005
-
Chapter 7 Customizing Graphics and Color This chapter describes how to change the appearance of default gateway forms. The chapter contains the following sections: • Appearance of Gateway Forms (page 83) • Banner Image (page 83) • Button Images (page 84) • Color Schemes (page 86) • Changing Table Colors (page 88) Appearance of Gateway Forms The default gateway installed during Directory Server installation matches the standard appearance of Directory Server.
-
Button Images Updating the Banner Image (title.gif) The following sections describe how to change the dimensions of the banner image as well as how to change the banner image filename. Changing Dimensions of Banner Image The default banner image has a height of 40 pixels and a width of 530 pixels. When using a banner image with a different pixel height and width, change the specifications of the image in all files in clients/dsgw/html where the image is referenced: • maintitle.html • authtitle.
-
Button Images Table 7-1 Button Images (Continued) Button Image Description stsearch_on.gif Used on the searchtitle.html page. adsearch_off.gif Used in the maintitle.html, authtitle.html, searchtitle.html, and newentrytitle.html pages. adsearch_on.gif Used on the csearchtitle.html page. newentry_off.gif Used in the maintitle.html, authtitle.html, csearchtitle.html, and searchtitle.html pages. newentry_on.gif Used on the newentrytitle.html page. authen_off.gif Used in the maintitle.
-
Color Schemes Color Schemes Changing the color schemes for a form requires editing the files that make up a gateway form. The procedure for changing colors depends on the gateway file type. • Files Controlling Colors on Gateway Forms • Changing Colors Using BODY Tag • Changing Colors Using Directives Files Controlling Colors on Gateway Forms Table 7-2 describes the gateway files that control the appearance of gateway forms.
-
Color Schemes Table 7-2 Files Controlling Appearance of Gateway Forms (Continued) To Change Colors on the ... Edit File Type New entry forms newentrytitle.html banner newentryType.html script newentryName.html script display-*.html template display-*.html template View or edit entry forms Changing Colors Using BODY Tag Table 7-3 lists the five standard color attributes that can be changed.
-
Changing Table Colors In the example, the attribute is a standard HTML %color attribute, and color is an RGB color value in the form #rrggbb (or a standard color name, such as aquamarine).
-
Changing Table Colors Table 7-4 Sixteen Standard Colors and Their Hexadecimal Values (Continued) Color Name Hexadecimal Value olive #808000 yellow #FFFF00 navy #000080 blue #0000FF teal #008080 aqua #00FFFF Changing Color of Table Headings To change the color of table heading text, edit the following lines within the template file:
so that the BGCOLOR value is an RGB color value in the form #RRGGBB or a standard color na
-
Changing Table Colors 90 Red Hat Directory Server Gateway Customization Guide • April 2005
-
Appendix A Parameters Defined in the .conf File The dsgw.conf and pb.conf files are installed during Red Hat Directory Server (Directory Server) installation. This appendix describes the configuration parameters defined in these files. Associated directives are described in Appendix B, “Gateway Directives.” authlifetime Specifies the amount of time in seconds before a user’s authentication expires in the gateway.
-
baseurl baseurl Specifies the host name and port number used to contact the Directory Server. This parameter also determines the search base used for searches performed from the gateway and whether the gateway uses SSL to communicate with the Directory Server. Format baseurl [ldap | ldaps]://dirHost:dirPort/searchBase ldap | ldaps. Use LDAP to have the gateway communicate the Directory Server without using SSL. Use LDAPS to have the gateway communicate with the Directory Server using SSL. dirHost.
-
changeHTML Format binddnfile binddn_filename Example binddnfile /export/TEST/binddnfile changeHTML Used by the gateway to substitute ideographic space for non-breaking space (nbsp) in Asian character sets. Format changeHTML nbsp_from nbsp_to charset Example changeHTML Shift_JIS charset Defines the default character set for communication with HTTP clients. The default is UTF-8 (Unicode), which supports all the characters in the Directory Server.
-
configdir More information: “ignoreAcceptCharsetFrom,” on page 97 Format charset character_set Example charset UTF-8 For more information about charsets, see RFC 1345, which defines the syntax of charset names. configdir Specifies the location of the configuration directory of the gateway. These include the object class templates, search configuration files, search result templates, and script files used to generate HTML forms dynamically for the user.
-
enable-aim-presence Example dirmgr "cn=Directory Manager, o=example.com" For information on the root DN and on setting permissions for the directory, see the Red Hat Directory Server Administrator’s Guide. enable-aim-presence Specifies the AIM® presence (online or offline) of a user by displaying or hiding the AIM icon in the Directory Server Gateway UI.
-
gwnametrans , ); //// Uncomment the above DS_ATTRIBUTE directive and remove the //// //// double quotes to have aim presence in search results lists //// Once this is done, listings of multiple users will show AIM presence for each user. NOTE By default, nsaimid and nsaimstatustext are used for AIM ID and AIM presence information, respectively. If you use different attributes, be sure to change the HTML files.
-
htmldir htmldir Specifies the location of the HTML files for the gateway. These include the HTML files controlling the appearance of gateway forms. The HTML directory for the default gateway (dsgw.conf) is ../html. The HTML directory for Directory Express (pb.conf) is ../pbhtml. Format htmldir "html_directory" Example htmldir "/exampleconfig" ignoreAcceptCharsetFrom Ignores request headers for the UTF-8 character set automatically sent by Netscape Communicator and Internet Explorer browsers.
-
location location Defines the location choices selectable from the gateway when adding new entries. Each location parameter represents a branch point in the directory tree below which new entries can be added. Format location handle "friendly_name""dn" handle. An arbitrary string used by the location-suffix parameter to map a type of entry to the locations where the entry can be created. For more information, see “location-suffix,” on page 99. friendly_name.
-
location-suffix location-suffix Identifies the directory suffix used to create new entries in the directory. This value is appended to the DN field of the NLS parameter when the gateway is used to create new entries in the directory. Format location-suffix "suffix" Example location-suffix "o=example.com" newtype Defines the types of entries that can be added to the directory using the gateway. newtype also defines the locations in the directory where an entry type can be added.
-
NLS rdnattr. The attribute used to name entries of this type. For example, the default value for the rdnattr field for people entries is uid. This means that any people entries created using the gateway will have DNs of the following format: uid=string The rdnattr field can be modified so that entries are named using a different attribute.
-
securitypath The orgchart-attrib-farleft-rdn attribute is the same as the one included in the Org Chart’s configuration file (serverRoot/clients/orgchart/config.txt), and the attribute value (uid, cn, and so on) must match the values specified in the config.txt file. Format orgchart-attrib-farleft-rdn attribute Example orgchart-attrib-farleft-rdn uid securitypath Identifies the location of the certificate database used by the gateway when using SSL to communicate with the Directory Server.
-
url-orgchart-base template orgperson person inetorgperson url-orgchart-base Points to the Org Chart application, providing a link to the Org Chart application from the Directory Server Gateway UI pages. By default, the Directory Server installation program sets the base to use the Red Hat Administration Server as the web server. You can change the host name and port number to be that of a dedicated web server. (See “HTTP Server Configuration,” on page 32.
-
vcard-property Format vcard-property vcardprop syntax ldapattr [ldapattr2...] vcardprop. The name of a vCard property. vCard properties that are currently mapped to LDAP attributes are: • FN — The Formatted Name property. All vCards must have an FN property. By default, FN is mapped to the cn attribute. • N — The Name property. By default, N is mapped to the sn and givenName attributes.
-
vcard-property syntax. A string that describes the nature of the vCard information. The following syntaxes are supported: • cis — used for simple strings, such as a person’s name or telephone number. • mls — used for multi-line strings, such as a mailing address. ldapattr [ldapattr2...]. The attribute(s) to be mapped to the vCard property. This is useful when mapping a vCard property to a custom attribute.
-
Appendix B Gateway Directives This appendix describes directives used in gateway HTML object class and search result templates. The appendix contains the following sections: • Introduction (page 107) • Context-Related Directives (page 109) • Entry-Related Directives (page 110) • Miscellaneous Directives (page 122) Introduction The display of LDAP directory information is controlled by HTML template files containing directives.
-
Introduction Structure of an HTML Template Directory entry display, edit, and add templates generally have the following structure:
directive appears within a URL and is used in the invocation of CGIs through GET operations.
-
Entry-Related Directives Entry-Related Directives Entry-related directives are supported by the dosearch and edit CGIs. DS_ENTRYBEGIN Delimits the beginning of an entry. The DS_ENTRYBEGIN directive is used in display or edit templates to mark the start of an LDAP entry and in list templates to mark the beginning of a section which should be repeated for each entry which is returned by the search. Always paired with DS_ENTRYEND. Arguments None. DS_ENTRYEND Delimits the end of an entry.
-
Entry-Related Directives Table B-1 DS_ATTRIBUTE: Display of syntax Argument syntax Description Display As tel Display as a telephone number text dn Display as a distinguished name href (a link to an LDAP entry) mail Display as a mailto: URL href (mailto: URL) mls Display as a multi-line string text time Display as date/time text cis Display as a case-ignore string text url Display as a labeled URL href (URL) type=how-to-display.
-
Entry-Related Directives Table B-3 DS_ATTRIBUTE: Display of options Argument (Continued) options Display dntags Applies only when using syntax=dn — tags are displayed when showing DNs. Normally, they are not displayed. dateonly Applies only when using syntax=time — only displays the date, omitting the time. readonly When editing, do not allow the user to modify the attribute’s value. dnpicker Applies only when using syntax=dn — embeds delete checkboxes and Javascript array information.
-
Entry-Related Directives cols=number, cols=+number, cols=>number. Controls the width of the displayed attribute. If a number is given by itself, then the attribute is displayed with exactly that number of columns. If a plus (+) sign is given before the number, then the attribute is given that number number of extra columns. For example, if the value is 10 characters wide, and the number is 10, then 20 columns are used when displaying the number.
-
Entry-Related Directives DS_OBJECTCLASS Describes the type of directory entries for which a given template should be used. Arguments value=value1,value2,...valueN. Specifies a list of object class values. For a template file to be used to display a given entry, all of the values given must be values in the entry’s objectClass attribute. NOTE The gateway does not read the template files to determine which template to use. Instead, it reads the dsgw.conf file and scans the template lines in that file.
-
Entry-Related Directives DS_SORTENTRIES Specifies that entries should be sorted; typically used within list templates. This directive must appear within a DS_ENTRYBEGIN...DS_ENTRYEND block. Up to two DS_SORTENTRIES directives are honored (the attribute from the first one that appears is used as the primary sort key, and the second one is used as a secondary sort key). Arguments attr=attrname. Sort the entries in ascending order by attrname.
-
Entry-Related Directives DS_EDITBUTTON Displays a button which, when clicked, brings up an editable view of an entry. This directive must appear within a DS_ENTRYBEGIN...DS_ENTRYEND block. Typically used in display templates. Arguments label=text. Use text as the label on the button. If not provided, the text Edit is used. Example DS_DELETEBUTTON Displays a button which, when clicked, allows deletion of an entry.
-
Entry-Related Directives DS_EDITASBUTTON Displays a button which, when clicked, allows editing of an entry using a non-default template. This directive must appear within a DS_ENTRYBEGIN... DS_ENTRYEND block. Arguments label=text. Use text as the label on the button. If not provided, the text Edit As is used. template=template-name. Use the template name template-name when editing. Example A button to bring up edit-passwd.
-
Entry-Related Directives DS_OLDPASSWORD Displays an HTML password field for the old password. This directive must appear within a DS_ENTRYBEGIN...DS_ENTRYEND block. Arguments None. DS_HELPBUTTON Displays a help button. Arguments topic=topic_name. Causes the Help System to open the given topic name. Example DS_CLOSEBUTTON Displays a Close button, which causes the containing window to be closed. Arguments label=text. Use text as the label on the button.
-
Entry-Related Directives Arguments None. DS_END_ENTRYFORM Causes the gateway to emit a tag. This directive must appear within a DS_ENTRYBEGIN...DS_ENTRYEND block. Arguments None. DS_EMIT_BASE_HREF Emit a tag that contains the base URL for the CGI that was executed. Arguments None. DS_DNEDITBUTTON Used to edit DN-valued attributes, such as group member. Arguments label= template= attr= desc= DS_BEGIN_DNSEARCHFORM Used to edit DN-valued attributes, such as group member.
-
Entry-Related Directives Arguments None. DS_ATTRVAL_SET Display an attribute based on an attrvset as defined in the dsgw.conf file. Arguments set=name. Use information from attribute valueset name. prefix=text. HTML text to emit before each attribute value element (optional). suffix=text. HTML text to emit after each attribute value element (optional). Plus any of the arguments supported by the DS_ATTRIBUTE directive.
-
Entry-Related Directives Table B-4 Conditions Supported for ELSE and ENDIF (Continued) Condition Arguments Description Displaying none Are we just displaying an entry? Bound none Is the user authenticated? BoundAsThisEntry none Is the user authenticated as the entry we are displaying? AttributeHasValues attr mincount Does the attribute attr have at least mincount values? AttributeHasThisValue attr syntax value Does the attribute attr with syntax syntax have value as one of its values? A
-
Miscellaneous Directives Miscellaneous Directives BODY Emit HTML
element that includes color information. Arguments extrahtml Examples COLORS Set color information to be used in subsequent BODY directives. Arguments html-color-info Example TITLE Emit HTML , , and elements.
-
Miscellaneous Directives ENDHTML Emit sequence Arguments None. HELPBUTTON Display a Help button (same effect as DS_HELPBUTTON directive but can be used from any gateway directory CGI). Arguments topic Example INCLUDE Include the contents of another HTML file. You cannot nest include directives. Arguments filename. The name of the file to include. This is relative to the html/ directory where files such as display-inetorgperson.html are located.
-
Miscellaneous Directives Arguments filename. The name of the file to include. This is relative to the config/ directory where files such as dsgw.conf are located. Example DS_LAST_OP_INFO Display a string that shows the result of the last domodify run. This directive works only when the genscreen or edit CGIs are invoked via domodify’s completion_javascript feature. Arguments prefix=prefix-text. Text displayed before the last operation info. suffix=suffix-text.
-
Miscellaneous Directives DS_GATEWAY_VERSION Emit a string containing the version of the directory gateway CGI being executed. Arguments None. Example IF/ ELSE/ ELIF/ ENDIF Same as those supported by the dosearch and edit CGIs. However, conditionals marked with an asterisk (*) are supported.
-
Miscellaneous Directives 126 Red Hat Directory Server Gateway Customization Guide • April 2005
-
Appendix C CGI Usage This appendix provides regular expression-type descriptions of the ways to invoke the CGIs in script files. Each regular expression is followed by the variables the expression can take on a POST. Upper case words are variables. Lower case words are literals. auth auth[?context=CONTEXT[&dn=DN]] authasrootdn = "true" or escapedbinddn = DN lang lang?context=CONTEXT[&file=FILE] search search?context=CONTEXT[&file=string] (GETs only. No POSTs.
-
searchType = SEARCHTYPE searchAttr = SEARCHATTR unauth unauth[?conetxt=CONTEXT] dnedit dnedit?CONTEXT=context&TEMPLATE=tmplname&DN=dn&ATTR=attrname&DESC= description edit edit?template&context=CONTEXT[&info=INFOSTRING] [&ADD][&dn=DN][&dnattr=ATTRNAME&dndesc=DESCRIPTION] (GETs only. No POSTs.
-
newentry newentry[?context=CONTEXT[&file=FILE]] entrytype = ET entryname = EN rdntag = RDNTAG selectLocation = SL dnsuffix = DNSUFFIX dosearch dosearch?context=BLAH[&hp=host[:port]][&dn=baseDN][&ldq=LDAPquery]] mode = MODE searchstring = SEARCH STRING type = TYPE base = BASE attr = ATTR match = MATCH attr = ATTR filterpattern = FILTERPATTERN filterprefix = FILTERPREFIX filtersuffix = FILTERSUFFIX scope = SCOPE searchdesc = SEARCHDESC Appendix C CGI Usage 129
-
130 Red Hat Directory Server Gateway Customization Guide • April 2005
-
Index A C Advanced search attributes for 69 example of pop-up menu 71 Attributes adding to object classes 61 deleting from object classes 61 auth CGI 127 Authentication and non-anonymous searching 27 as directory manager 39 authlifetime parameter 91 CGIs auth 127 csearch 127 dnedit 128 dosearch 129 edit 128 lang 127 newentry 129 search 127 specifying gateway configuration to 26 unauth 128 usage 127 changeHTML parameter 93 Chapter Single Template 91, 107, 127 charset parameter 93 configdir parameter 94 c
-
DS_ATTRVAL_SET 120 DS_BEGIN_DNSEARCHFORM 120 DS_BEGIN_ENTRYFORM 119 DS_CLOSEBUTTON 118 DS_CONFIRM_NEWPASSWORD 118 DS_DELETEBUTTON 116 DS_DNEDITBUTTON 119 DS_EDITASBUTTON 117 DS_EDITBUTTON 116 DS_EMIT_BASE_HREF 119 DS_END_ENTRYFORM 119 DS_ENTRYBEGIN 110 DS_ENTRYEND 110 DS_GATEWAY_VERSION 125 DS_HELPBUTTON 118 DS_LAST_OP_INFO 124 DS_LOCATIONPOPUP 124 DS_NEWPASSWORD 117 DS_OBJECTCLASS 114 DS_OLDPASSWORD 118 DS_POSTEDVALUE 115 DS_SAVEBUTTON 117 DS_SEARCHDESC 115 DS_SORTENTRIES 115 DS_VIEW_SWITCHER 114 ENDHTML 1
-
setting suffix for adding entries 39 setting up SSL support 40 Gateway configuraton customizing Communicator’s LDAP settings 42 Gateway files .conf file 51 .conf file configuration 37 banner files 54 banner files, see also Banner files dsgw.conf 51 dsgwsearchprefs.conf 51 files controlling gateway functionality 49 invoking CGIs in script files 127 object class templates 52 object class templates, see also Object class templates pb.
-
N Name translation mapping 33 newentry CGI 129 newtype parameter 56, 100 NLS parameter 101 Non-anonymous searching 27 O Object class templates adding attributes to 61 adding search support for 74 adding template for a child of a parent class 63 and directives 60 and entry types 55 and entry-related directives 60 attributes 59 configuring DN formats for 59 considerations for adding new 57 creating a new parent object class 64 creating new search object 75 creating new search object, see also Search objects
-
creating new 75 Search preferences extending 74 Search result templates customizing 78 default templates and related object classes 53 modifying 80 removing information from 81 Search results display of 78 Search scope base 69 defining 68 onelevel 69 subtree 69 Search support for user ID in Directory Express 73 securitypath parameter 102 serverID 18 serverRoot 18 SSL support 40 Standard search page 25 T template parameter 56, 102 U unauth CGI 128 updatedsgw script 27, 31 updating title.
-
136 Red Hat Directory Server Gateway Customization Guide • April 2005
-
List of Tables Table 2-1 Location of Gateway Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Table 4-1 Gateway File Types and Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Table 4-2 Default Template Files and Related Object Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Table 4-3 Gateway Forms and Corresponding Script Files . . . . . . . . . . . . . .
-
14 Red Hat Directory Server Gateway Customization Guide • April 2005
-
Examples HTML and configuration directories specified in pb.conf ......................................... 6 Embedding GCONTEXT in a Link ............................................................................ 7 Specifying PCONTEXT in an HTML Form .............................................................. 7 Setting up .conf file and directories for new gateway instance ................................ 21 Changing LDAP port in the baseurl parameter ...................................................
-
ii Red Hat Directory Server Gateway Customization Guide