Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
documentation:white-pages:latest:config_attributes [2016/11/24 17:52]
coudot
documentation:white-pages:latest:config_attributes [2019/07/23 15:11] (current)
Line 1: Line 1:
 ====== Attributes ====== ====== Attributes ======
  
-<​note>​Configuration file: ''​white-pages/​conf/​config.inc.php'​'</​note>​+<​note>​Configuration file: use [[config_general#​configuration_files|White-Pages' ​local configuration file]]</​note>​
  
 To configure how LDAP attributes are displayed or searched, use the ''​$attributes_map''​ parameter which is an array of arrays, with this structure: To configure how LDAP attributes are displayed or searched, use the ''​$attributes_map''​ parameter which is an array of arrays, with this structure:
   * $attributes_map:​   * $attributes_map:​
     * item: item identifier     * item: item identifier
-      * ''​attribute'':​ name of LDAP attribute, in lower case+      * ''​attribute'':​ name of LDAP attribute, ​**in lower case**
       * ''​faclass'':​ name of [[http://​fontawesome.io/​|Font Awesome]] icon class       * ''​faclass'':​ name of [[http://​fontawesome.io/​|Font Awesome]] icon class
       * ''​type'':​ type of attribute (see below)       * ''​type'':​ type of attribute (see below)
  
 The following table shows how ''​type''​ are used: The following table shows how ''​type''​ are used:
-^ Type     ​^ Display ​                                  ​^ Search ​                     ^ +^ Type              ^ Display ​                                     ^ Search ​                     ​^ Substring matching ​
-| text     ​| Simple text                               ​| Text input                  | +| text              | Simple text                                  | Text input                  ​| Yes 
-| mailto ​  ​| Link mailto ​                              ​| Text input                  | +| mailto ​           | Link mailto ​                                 | Text input                  ​| Yes 
-| dn_link ​ | Link on target ​entry                      | Text input                  | +| dn_link ​          | Link on user entry                           | Text input                  | No  
-boolean ​ | "​Yes"​ or "​No" ​                            ​| Select ​                     | +| group_dn_link ​    | Link on group entry                          | Text input                  ​| No  ​
-| date     ​| [[.:​config_general#​date|Formatted date]] ​ | Calendar ("​from"​ and "​to"​) ​ |+usergroup_dn_link | Link on user or group entry                  | Text input                  | No  
 +| boolean ​          | "​Yes"​ or "​No" ​                               | Select ​                     ​| N/A 
 +| date              | [[.:​config_general#​date|Formatted date]] ​    ​| Calendar ("​from"​ and "​to"​) ​ | N/A | 
 +| tel               | Link tel (click to call)                     | Text input                  | Yes | 
 +| guid              | Simple text (objectGUID converted to string) | Text input                  | No  | 
 +| list              | Simple text                                  | Select ​                     | Yes  |
  
 Example: Example:
Line 24: Line 29:
     '​carlicense'​ => array( '​attribute'​ => '​carlicense',​ '​faclass'​ => '​car',​ '​type'​ => '​text'​ ),     '​carlicense'​ => array( '​attribute'​ => '​carlicense',​ '​faclass'​ => '​car',​ '​type'​ => '​text'​ ),
     '​created'​ => array( '​attribute'​ => '​createtimestamp',​ '​faclass'​ => '​clock-o',​ '​type'​ => '​date'​ ),     '​created'​ => array( '​attribute'​ => '​createtimestamp',​ '​faclass'​ => '​clock-o',​ '​type'​ => '​date'​ ),
 +    '​manager'​ => array( '​attribute'​ => '​manager',​ '​faclass'​ => '​user-circle-o',​ '​type'​ => '​dn_link'​ ),
 +    '​member'​ => array( '​attribute'​ => '​member',​ '​faclass'​ => '​user',​ '​type'​ => '​usergroup_dn_link'​ ),
 +);
 +
 +$attributes_list = array(
 +    '​organizationalunit'​ => array('​base'​=>'​ou=services,​dc=example,​dc=com','​filter'​=>'​(objectClass=organizationalUnit)','​key'​=>'​description','​value'​=>'​ou'​),​
 ); );
 </​file>​ </​file>​
Line 29: Line 40:
 To add a new definition to existing ones: To add a new definition to existing ones:
 <file php> <file php>
-$attributes_map[] = ('​fax'​ =array( '​attribute'​ => '​facsimiletelephonenumber',​ '​faclass'​ => '​fax',​ '​type'​ => '​text' ​));+$attributes_map['​fax'​= array( '​attribute'​ => '​facsimiletelephonenumber',​ '​faclass'​ => '​fax',​ '​type'​ => '​text'​ );
 </​file>​ </​file>​
 +
 +To manage a list, you need to define how keys and values are searched in LDAP directory, for example:
 +<file php>
 +$attributes_map['​organizationalunit]'​ = array( '​attribute'​ => '​ou',​ '​faclass'​ => '​building-o',​ '​type'​ => '​list'​ );
 +$attributes_list['​organizationalunit'​] = array('​base'​=>'​ou=services,​dc=example,​dc=com',​ '​filter'​=>'​(objectClass=organizationalUnit)',​ '​key'​=>'​description',​ '​value'​=>'​ou'​);​
 +);
 +</​file>​
 +
 +The attribute set in ''​key''​ will be used as select key, and the attribute set in ''​value''​ will be used as select value.
  
 <note tip> <note tip>
Line 38: Line 58:
 </​file>​ </​file>​
 </​note>​ </​note>​
 +
 +<note warning>​Don'​t forget to put your LDAP attribute in lower case !</​note>​