Changeset 3606783
- Timestamp:
- 07/13/2026 11:23:18 PM (3 months ago)
- Location:
- ldap-staff-directory
- Files:
-
- 12 edited
- 8 copied
-
tags/1.1.2 (copied) (copied from ldap-staff-directory/trunk )
-
tags/1.1.2/beaver-builder/class-bb-module.php (modified) (1 diff)
-
tags/1.1.2/elementor/class-elementor-widget.php (modified) (1 diff)
-
tags/1.1.2/includes/class-admin.php (modified) (4 diffs)
-
tags/1.1.2/includes/class-ldap-connector.php (copied) (copied from ldap-staff-directory/trunk/includes/class-ldap-connector.php ) (2 diffs)
-
tags/1.1.2/includes/class-shortcode.php (copied) (copied from ldap-staff-directory/trunk/includes/class-shortcode.php ) (2 diffs)
-
tags/1.1.2/ldap-staff-directory.php (copied) (copied from ldap-staff-directory/trunk/ldap-staff-directory.php ) (2 diffs)
-
tags/1.1.2/public/css/directory.css (copied) (copied from ldap-staff-directory/trunk/public/css/directory.css ) (1 diff)
-
tags/1.1.2/public/js/directory.js (copied) (copied from ldap-staff-directory/trunk/public/js/directory.js )
-
tags/1.1.2/public/views/directory.php (copied) (copied from ldap-staff-directory/trunk/public/views/directory.php ) (1 diff)
-
tags/1.1.2/readme.txt (copied) (copied from ldap-staff-directory/trunk/readme.txt ) (2 diffs)
-
trunk/beaver-builder/class-bb-module.php (modified) (1 diff)
-
trunk/elementor/class-elementor-widget.php (modified) (1 diff)
-
trunk/includes/class-admin.php (modified) (4 diffs)
-
trunk/includes/class-ldap-connector.php (modified) (2 diffs)
-
trunk/includes/class-shortcode.php (modified) (2 diffs)
-
trunk/ldap-staff-directory.php (modified) (2 diffs)
-
trunk/public/css/directory.css (modified) (1 diff)
-
trunk/public/views/directory.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ldap-staff-directory/tags/1.1.2/beaver-builder/class-bb-module.php
r3484954 r3606783 38 38 'department' => __( 'Department', 'ldap-staff-directory' ), 39 39 'phone' => __( 'Phone', 'ldap-staff-directory' ), 40 'extension' => __( 'Extension', 'ldap-staff-directory' ), 40 41 ), 41 42 ), -
ldap-staff-directory/tags/1.1.2/elementor/class-elementor-widget.php
r3484954 r3606783 57 57 'department' => __( 'Department', 'ldap-staff-directory' ), 58 58 'phone' => __( 'Phone', 'ldap-staff-directory' ), 59 'extension' => __( 'Extension', 'ldap-staff-directory' ), 59 60 ), 60 61 'default' => array( 'name', 'email', 'title', 'department' ), -
ldap-staff-directory/tags/1.1.2/includes/class-admin.php
r3484954 r3606783 137 137 ); 138 138 139 add_settings_field( 140 'ldap_ed_extension_attr', 141 __( 'Extension Attribute', 'ldap-staff-directory' ), 142 array( $this, 'render_field_extension_attr' ), 143 'ldap-staff-directory', 144 'ldap_ed_section_display', 145 array( 'label_for' => 'ldap_ed_extension_attr' ) 146 ); 147 139 148 // --- Cache section --- 140 149 add_settings_section( … … 168 177 $clean['exclude_disabled'] = isset( $input['exclude_disabled'] ) ? '1' : '0'; 169 178 $clean['per_page'] = absint( $input['per_page'] ?? 20 ); 170 $clean['enable_search'] = isset( $input['enable_search'] ) ? '1' : '0'; 171 $clean['cache_ttl'] = absint( $input['cache_ttl'] ?? 60 ); 179 $clean['enable_search'] = isset( $input['enable_search'] ) ? '1' : '0'; 180 $ext_attr = sanitize_text_field( $input['extension_attr'] ?? 'ipPhone' ); 181 $clean['extension_attr'] = '' !== $ext_attr ? $ext_attr : 'ipPhone'; 182 $clean['cache_ttl'] = absint( $input['cache_ttl'] ?? 60 ); 172 183 173 184 // Allowed field keys. 174 $allowed_fields = array( 'name', 'email', 'title', 'department', 'phone' );185 $allowed_fields = array( 'name', 'email', 'title', 'department', 'phone', 'extension' ); 175 186 $clean['fields'] = array(); 176 187 if ( ! empty( $input['fields'] ) && is_array( $input['fields'] ) ) { … … 387 398 } 388 399 400 /** @param array $args Settings field args passed by the Settings API. */ 401 public function render_field_extension_attr( $args = array() ) { 402 printf( 403 '<input type="text" id="%1$s" name="%2$s[extension_attr]" value="%3$s" class="regular-text" placeholder="ipPhone"><p class="description">%4$s</p>', 404 esc_attr( $args['label_for'] ), 405 esc_attr( LDAP_ED_OPTION_KEY ), 406 esc_attr( $this->get_option( 'extension_attr', 'ipPhone' ) ), 407 esc_html__( 'LDAP attribute for telephone extensions. Use ipPhone for Active Directory / IP-PBX systems, or enter the attribute name from your own schema (e.g. extensionAttribute1). Case does not matter.', 'ldap-staff-directory' ) 408 ); 409 } 410 389 411 public function render_field_fields() { 390 412 $saved = $this->get_option( 'fields', array( 'name', 'email', 'title', 'department' ) ); … … 395 417 'department' => __( 'Department', 'ldap-staff-directory' ), 396 418 'phone' => __( 'Phone', 'ldap-staff-directory' ), 419 'extension' => __( 'Extension', 'ldap-staff-directory' ), 397 420 ); 398 421 foreach ( $items as $key => $label ) { -
ldap-staff-directory/tags/1.1.2/includes/class-ldap-connector.php
r3548101 r3606783 139 139 } 140 140 141 $attributes = array( 'cn', 'displayname', 'mail', 'title', 'department', 'telephonenumber' ); 142 $users = array(); 143 $cookie = ''; 141 $ext_attr = sanitize_text_field( $this->settings['extension_attr'] ?? 'ipPhone' ); 142 if ( '' === $ext_attr ) { 143 $ext_attr = 'ipPhone'; 144 } 145 // ldap_get_entries() normalizes all attribute names to lowercase in the returned array, 146 // so the lookup key must be lowercase regardless of what the admin configured. 147 $ext_attr_key = strtolower( $ext_attr ); 148 $attributes = array( 'cn', 'displayname', 'mail', 'title', 'department', 'telephonenumber', $ext_attr ); 149 $users = array(); 150 $cookie = ''; 144 151 145 152 do { … … 189 196 'department' => $this->get_entry_value( $entry, 'department' ) ?? '', 190 197 'phone' => $this->get_entry_value( $entry, 'telephonenumber' ) ?? '', 198 'extension' => $this->get_entry_value( $entry, $ext_attr_key ) ?? '', 191 199 ); 192 200 } -
ldap-staff-directory/tags/1.1.2/includes/class-shortcode.php
r3548101 r3606783 78 78 79 79 // Resolve field list from the shortcode attribute. 80 $allowed_fields = array( 'name', 'email', 'title', 'department', 'phone' );80 $allowed_fields = array( 'name', 'email', 'title', 'department', 'phone', 'extension' ); 81 81 $ldap_ed_fields = array_intersect( 82 82 array_map( 'trim', explode( ',', $atts['fields'] ) ), … … 162 162 $users, 163 163 static function ( $user ) use ( $search ) { 164 foreach ( array( 'name', 'email', 'title', 'department', 'phone' ) as $field ) {164 foreach ( array( 'name', 'email', 'title', 'department', 'phone', 'extension' ) as $field ) { 165 165 if ( false !== stripos( $user[ $field ] ?? '', $search ) ) { 166 166 return true; -
ldap-staff-directory/tags/1.1.2/ldap-staff-directory.php
r3548101 r3606783 4 4 * Plugin URI: https://wordpress.org/plugins/ldap-staff-directory/ 5 5 * Description: Connects to LDAPS to display an employee directory from an OU. Supports Elementor, Beaver Builder and a native shortcode. 6 * Version: 1.1. 16 * Version: 1.1.2 7 7 * Requires at least: 5.8 8 8 * Requires PHP: 7.4 … … 19 19 20 20 // Plugin constants. 21 define( 'LDAP_ED_VERSION', '1.1. 1' );21 define( 'LDAP_ED_VERSION', '1.1.2' ); 22 22 define( 'LDAP_ED_FILE', __FILE__ ); 23 23 define( 'LDAP_ED_DIR', plugin_dir_path( __FILE__ ) ); -
ldap-staff-directory/tags/1.1.2/public/css/directory.css
r3548101 r3606783 264 264 } 265 265 266 .ldap-extension { 267 display: block; 268 margin-top: 4px; 269 font-size: .88em; 270 color: var( --ldap-muted-color ); 271 } 272 266 273 /* ── No-results ─────────────────────────────────────────────────────────── */ 267 274 -
ldap-staff-directory/tags/1.1.2/public/views/directory.php
r3548101 r3606783 181 181 <?php echo esc_html( $ldap_ed_user['phone'] ); ?> 182 182 </a> 183 <?php endif; ?> 184 185 <?php if ( in_array( 'extension', $ldap_ed_fields, true ) && ! empty( $ldap_ed_user['extension'] ) ) : ?> 186 <span class="ldap-extension"><?php echo esc_html( $ldap_ed_user['extension'] ); ?></span> 183 187 <?php endif; ?> 184 188 </article> -
ldap-staff-directory/tags/1.1.2/readme.txt
r3548101 r3606783 5 5 Tested up to: 7.0 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 17 Stable tag: 1.1.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 78 78 == Changelog == 79 79 80 = 1.1.2 = 81 * Feature: New "Extension" field for telephone extensions — displays as plain text (no link) alongside the existing phone field. Supports organizations with PBX/telephone exchange systems where extensions are stored in a separate LDAP attribute (e.g. `ipPhone`). The LDAP attribute name is configurable in Display Options (default: `ipPhone`). Works with Active Directory, Samba, OpenLDAP, and custom schemas. 82 80 83 = 1.1.1 = 81 84 * Improvement: LDAP user retrieval now uses RFC 2696 paged results (LDAP_CONTROL_PAGEDRESULTS), allowing the plugin to retrieve all employees from directories with more than 1,000 users — previously, Active Directory's default MaxPageSize limit silently truncated results. -
ldap-staff-directory/trunk/beaver-builder/class-bb-module.php
r3484954 r3606783 38 38 'department' => __( 'Department', 'ldap-staff-directory' ), 39 39 'phone' => __( 'Phone', 'ldap-staff-directory' ), 40 'extension' => __( 'Extension', 'ldap-staff-directory' ), 40 41 ), 41 42 ), -
ldap-staff-directory/trunk/elementor/class-elementor-widget.php
r3484954 r3606783 57 57 'department' => __( 'Department', 'ldap-staff-directory' ), 58 58 'phone' => __( 'Phone', 'ldap-staff-directory' ), 59 'extension' => __( 'Extension', 'ldap-staff-directory' ), 59 60 ), 60 61 'default' => array( 'name', 'email', 'title', 'department' ), -
ldap-staff-directory/trunk/includes/class-admin.php
r3484954 r3606783 137 137 ); 138 138 139 add_settings_field( 140 'ldap_ed_extension_attr', 141 __( 'Extension Attribute', 'ldap-staff-directory' ), 142 array( $this, 'render_field_extension_attr' ), 143 'ldap-staff-directory', 144 'ldap_ed_section_display', 145 array( 'label_for' => 'ldap_ed_extension_attr' ) 146 ); 147 139 148 // --- Cache section --- 140 149 add_settings_section( … … 168 177 $clean['exclude_disabled'] = isset( $input['exclude_disabled'] ) ? '1' : '0'; 169 178 $clean['per_page'] = absint( $input['per_page'] ?? 20 ); 170 $clean['enable_search'] = isset( $input['enable_search'] ) ? '1' : '0'; 171 $clean['cache_ttl'] = absint( $input['cache_ttl'] ?? 60 ); 179 $clean['enable_search'] = isset( $input['enable_search'] ) ? '1' : '0'; 180 $ext_attr = sanitize_text_field( $input['extension_attr'] ?? 'ipPhone' ); 181 $clean['extension_attr'] = '' !== $ext_attr ? $ext_attr : 'ipPhone'; 182 $clean['cache_ttl'] = absint( $input['cache_ttl'] ?? 60 ); 172 183 173 184 // Allowed field keys. 174 $allowed_fields = array( 'name', 'email', 'title', 'department', 'phone' );185 $allowed_fields = array( 'name', 'email', 'title', 'department', 'phone', 'extension' ); 175 186 $clean['fields'] = array(); 176 187 if ( ! empty( $input['fields'] ) && is_array( $input['fields'] ) ) { … … 387 398 } 388 399 400 /** @param array $args Settings field args passed by the Settings API. */ 401 public function render_field_extension_attr( $args = array() ) { 402 printf( 403 '<input type="text" id="%1$s" name="%2$s[extension_attr]" value="%3$s" class="regular-text" placeholder="ipPhone"><p class="description">%4$s</p>', 404 esc_attr( $args['label_for'] ), 405 esc_attr( LDAP_ED_OPTION_KEY ), 406 esc_attr( $this->get_option( 'extension_attr', 'ipPhone' ) ), 407 esc_html__( 'LDAP attribute for telephone extensions. Use ipPhone for Active Directory / IP-PBX systems, or enter the attribute name from your own schema (e.g. extensionAttribute1). Case does not matter.', 'ldap-staff-directory' ) 408 ); 409 } 410 389 411 public function render_field_fields() { 390 412 $saved = $this->get_option( 'fields', array( 'name', 'email', 'title', 'department' ) ); … … 395 417 'department' => __( 'Department', 'ldap-staff-directory' ), 396 418 'phone' => __( 'Phone', 'ldap-staff-directory' ), 419 'extension' => __( 'Extension', 'ldap-staff-directory' ), 397 420 ); 398 421 foreach ( $items as $key => $label ) { -
ldap-staff-directory/trunk/includes/class-ldap-connector.php
r3548101 r3606783 139 139 } 140 140 141 $attributes = array( 'cn', 'displayname', 'mail', 'title', 'department', 'telephonenumber' ); 142 $users = array(); 143 $cookie = ''; 141 $ext_attr = sanitize_text_field( $this->settings['extension_attr'] ?? 'ipPhone' ); 142 if ( '' === $ext_attr ) { 143 $ext_attr = 'ipPhone'; 144 } 145 // ldap_get_entries() normalizes all attribute names to lowercase in the returned array, 146 // so the lookup key must be lowercase regardless of what the admin configured. 147 $ext_attr_key = strtolower( $ext_attr ); 148 $attributes = array( 'cn', 'displayname', 'mail', 'title', 'department', 'telephonenumber', $ext_attr ); 149 $users = array(); 150 $cookie = ''; 144 151 145 152 do { … … 189 196 'department' => $this->get_entry_value( $entry, 'department' ) ?? '', 190 197 'phone' => $this->get_entry_value( $entry, 'telephonenumber' ) ?? '', 198 'extension' => $this->get_entry_value( $entry, $ext_attr_key ) ?? '', 191 199 ); 192 200 } -
ldap-staff-directory/trunk/includes/class-shortcode.php
r3548101 r3606783 78 78 79 79 // Resolve field list from the shortcode attribute. 80 $allowed_fields = array( 'name', 'email', 'title', 'department', 'phone' );80 $allowed_fields = array( 'name', 'email', 'title', 'department', 'phone', 'extension' ); 81 81 $ldap_ed_fields = array_intersect( 82 82 array_map( 'trim', explode( ',', $atts['fields'] ) ), … … 162 162 $users, 163 163 static function ( $user ) use ( $search ) { 164 foreach ( array( 'name', 'email', 'title', 'department', 'phone' ) as $field ) {164 foreach ( array( 'name', 'email', 'title', 'department', 'phone', 'extension' ) as $field ) { 165 165 if ( false !== stripos( $user[ $field ] ?? '', $search ) ) { 166 166 return true; -
ldap-staff-directory/trunk/ldap-staff-directory.php
r3548101 r3606783 4 4 * Plugin URI: https://wordpress.org/plugins/ldap-staff-directory/ 5 5 * Description: Connects to LDAPS to display an employee directory from an OU. Supports Elementor, Beaver Builder and a native shortcode. 6 * Version: 1.1. 16 * Version: 1.1.2 7 7 * Requires at least: 5.8 8 8 * Requires PHP: 7.4 … … 19 19 20 20 // Plugin constants. 21 define( 'LDAP_ED_VERSION', '1.1. 1' );21 define( 'LDAP_ED_VERSION', '1.1.2' ); 22 22 define( 'LDAP_ED_FILE', __FILE__ ); 23 23 define( 'LDAP_ED_DIR', plugin_dir_path( __FILE__ ) ); -
ldap-staff-directory/trunk/public/css/directory.css
r3548101 r3606783 264 264 } 265 265 266 .ldap-extension { 267 display: block; 268 margin-top: 4px; 269 font-size: .88em; 270 color: var( --ldap-muted-color ); 271 } 272 266 273 /* ── No-results ─────────────────────────────────────────────────────────── */ 267 274 -
ldap-staff-directory/trunk/public/views/directory.php
r3548101 r3606783 181 181 <?php echo esc_html( $ldap_ed_user['phone'] ); ?> 182 182 </a> 183 <?php endif; ?> 184 185 <?php if ( in_array( 'extension', $ldap_ed_fields, true ) && ! empty( $ldap_ed_user['extension'] ) ) : ?> 186 <span class="ldap-extension"><?php echo esc_html( $ldap_ed_user['extension'] ); ?></span> 183 187 <?php endif; ?> 184 188 </article> -
ldap-staff-directory/trunk/readme.txt
r3548101 r3606783 5 5 Tested up to: 7.0 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 17 Stable tag: 1.1.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 78 78 == Changelog == 79 79 80 = 1.1.2 = 81 * Feature: New "Extension" field for telephone extensions — displays as plain text (no link) alongside the existing phone field. Supports organizations with PBX/telephone exchange systems where extensions are stored in a separate LDAP attribute (e.g. `ipPhone`). The LDAP attribute name is configurable in Display Options (default: `ipPhone`). Works with Active Directory, Samba, OpenLDAP, and custom schemas. 82 80 83 = 1.1.1 = 81 84 * Improvement: LDAP user retrieval now uses RFC 2696 paged results (LDAP_CONTROL_PAGEDRESULTS), allowing the plugin to retrieve all employees from directories with more than 1,000 users — previously, Active Directory's default MaxPageSize limit silently truncated results.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)