Plugin Directory

Changeset 3606783


Ignore:
Timestamp:
07/13/2026 11:23:18 PM (3 months ago)
Author:
carlosmmairena
Message:

tagging version 1.1.2

Location:
ldap-staff-directory
Files:
12 edited
8 copied

Legend:

Unmodified
Added
Removed
  • ldap-staff-directory/tags/1.1.2/beaver-builder/class-bb-module.php

    r3484954 r3606783  
    3838                                                                'department' => __( 'Department', 'ldap-staff-directory' ),
    3939                                                                'phone'      => __( 'Phone', 'ldap-staff-directory' ),
     40                                                                'extension'  => __( 'Extension', 'ldap-staff-directory' ),
    4041                                                        ),
    4142                                                ),
  • ldap-staff-directory/tags/1.1.2/elementor/class-elementor-widget.php

    r3484954 r3606783  
    5757                                        'department' => __( 'Department', 'ldap-staff-directory' ),
    5858                                        'phone'      => __( 'Phone', 'ldap-staff-directory' ),
     59                                        'extension'  => __( 'Extension', 'ldap-staff-directory' ),
    5960                                ),
    6061                                'default' => array( 'name', 'email', 'title', 'department' ),
  • ldap-staff-directory/tags/1.1.2/includes/class-admin.php

    r3484954 r3606783  
    137137                );
    138138
     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
    139148                // --- Cache section ---
    140149                add_settings_section(
    … …  
    168177                $clean['exclude_disabled']  = isset( $input['exclude_disabled'] ) ? '1' : '0';
    169178                $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 );
    172183
    173184                // Allowed field keys.
    174                 $allowed_fields  = array( 'name', 'email', 'title', 'department', 'phone' );
     185                $allowed_fields  = array( 'name', 'email', 'title', 'department', 'phone', 'extension' );
    175186                $clean['fields'] = array();
    176187                if ( ! empty( $input['fields'] ) && is_array( $input['fields'] ) ) {
    … …  
    387398        }
    388399
     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
    389411        public function render_field_fields() {
    390412                $saved = $this->get_option( 'fields', array( 'name', 'email', 'title', 'department' ) );
    … …  
    395417                        'department' => __( 'Department', 'ldap-staff-directory' ),
    396418                        'phone'      => __( 'Phone', 'ldap-staff-directory' ),
     419                        'extension'  => __( 'Extension', 'ldap-staff-directory' ),
    397420                );
    398421                foreach ( $items as $key => $label ) {
  • ldap-staff-directory/tags/1.1.2/includes/class-ldap-connector.php

    r3548101 r3606783  
    139139                }
    140140
    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       = '';
    144151
    145152                do {
    … …  
    189196                                        'department' => $this->get_entry_value( $entry, 'department' ) ?? '',
    190197                                        'phone'      => $this->get_entry_value( $entry, 'telephonenumber' ) ?? '',
     198                                        'extension'  => $this->get_entry_value( $entry, $ext_attr_key ) ?? '',
    191199                                );
    192200                        }
  • ldap-staff-directory/tags/1.1.2/includes/class-shortcode.php

    r3548101 r3606783  
    7878
    7979                // 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' );
    8181                $ldap_ed_fields       = array_intersect(
    8282                        array_map( 'trim', explode( ',', $atts['fields'] ) ),
    … …  
    162162                                        $users,
    163163                                        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 ) {
    165165                                                        if ( false !== stripos( $user[ $field ] ?? '', $search ) ) {
    166166                                                                return true;
  • ldap-staff-directory/tags/1.1.2/ldap-staff-directory.php

    r3548101 r3606783  
    44 * Plugin URI:  https://wordpress.org/plugins/ldap-staff-directory/
    55 * Description: Connects to LDAPS to display an employee directory from an OU. Supports Elementor, Beaver Builder and a native shortcode.
    6  * Version:     1.1.1
     6 * Version:     1.1.2
    77 * Requires at least: 5.8
    88 * Requires PHP: 7.4
    … …  
    1919
    2020// Plugin constants.
    21 define( 'LDAP_ED_VERSION',     '1.1.1' );
     21define( 'LDAP_ED_VERSION',     '1.1.2' );
    2222define( 'LDAP_ED_FILE',        __FILE__ );
    2323define( 'LDAP_ED_DIR',         plugin_dir_path( __FILE__ ) );
  • ldap-staff-directory/tags/1.1.2/public/css/directory.css

    r3548101 r3606783  
    264264}
    265265
     266.ldap-extension {
     267        display: block;
     268        margin-top: 4px;
     269        font-size: .88em;
     270        color: var( --ldap-muted-color );
     271}
     272
    266273/* ── No-results ─────────────────────────────────────────────────────────── */
    267274
  • ldap-staff-directory/tags/1.1.2/public/views/directory.php

    r3548101 r3606783  
    181181                                        <?php echo esc_html( $ldap_ed_user['phone'] ); ?>
    182182                                </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>
    183187                                <?php endif; ?>
    184188                        </article>
  • ldap-staff-directory/tags/1.1.2/readme.txt

    r3548101 r3606783  
    55Tested up to:      7.0
    66Requires PHP:      7.4
    7 Stable tag:        1.1.1
     7Stable tag:        1.1.2
    88License:           GPLv2 or later
    99License URI:       https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    7878== Changelog ==
    7979
     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
    8083= 1.1.1 =
    8184* 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  
    3838                                                                'department' => __( 'Department', 'ldap-staff-directory' ),
    3939                                                                'phone'      => __( 'Phone', 'ldap-staff-directory' ),
     40                                                                'extension'  => __( 'Extension', 'ldap-staff-directory' ),
    4041                                                        ),
    4142                                                ),
  • ldap-staff-directory/trunk/elementor/class-elementor-widget.php

    r3484954 r3606783  
    5757                                        'department' => __( 'Department', 'ldap-staff-directory' ),
    5858                                        'phone'      => __( 'Phone', 'ldap-staff-directory' ),
     59                                        'extension'  => __( 'Extension', 'ldap-staff-directory' ),
    5960                                ),
    6061                                'default' => array( 'name', 'email', 'title', 'department' ),
  • ldap-staff-directory/trunk/includes/class-admin.php

    r3484954 r3606783  
    137137                );
    138138
     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
    139148                // --- Cache section ---
    140149                add_settings_section(
    … …  
    168177                $clean['exclude_disabled']  = isset( $input['exclude_disabled'] ) ? '1' : '0';
    169178                $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 );
    172183
    173184                // Allowed field keys.
    174                 $allowed_fields  = array( 'name', 'email', 'title', 'department', 'phone' );
     185                $allowed_fields  = array( 'name', 'email', 'title', 'department', 'phone', 'extension' );
    175186                $clean['fields'] = array();
    176187                if ( ! empty( $input['fields'] ) && is_array( $input['fields'] ) ) {
    … …  
    387398        }
    388399
     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
    389411        public function render_field_fields() {
    390412                $saved = $this->get_option( 'fields', array( 'name', 'email', 'title', 'department' ) );
    … …  
    395417                        'department' => __( 'Department', 'ldap-staff-directory' ),
    396418                        'phone'      => __( 'Phone', 'ldap-staff-directory' ),
     419                        'extension'  => __( 'Extension', 'ldap-staff-directory' ),
    397420                );
    398421                foreach ( $items as $key => $label ) {
  • ldap-staff-directory/trunk/includes/class-ldap-connector.php

    r3548101 r3606783  
    139139                }
    140140
    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       = '';
    144151
    145152                do {
    … …  
    189196                                        'department' => $this->get_entry_value( $entry, 'department' ) ?? '',
    190197                                        'phone'      => $this->get_entry_value( $entry, 'telephonenumber' ) ?? '',
     198                                        'extension'  => $this->get_entry_value( $entry, $ext_attr_key ) ?? '',
    191199                                );
    192200                        }
  • ldap-staff-directory/trunk/includes/class-shortcode.php

    r3548101 r3606783  
    7878
    7979                // 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' );
    8181                $ldap_ed_fields       = array_intersect(
    8282                        array_map( 'trim', explode( ',', $atts['fields'] ) ),
    … …  
    162162                                        $users,
    163163                                        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 ) {
    165165                                                        if ( false !== stripos( $user[ $field ] ?? '', $search ) ) {
    166166                                                                return true;
  • ldap-staff-directory/trunk/ldap-staff-directory.php

    r3548101 r3606783  
    44 * Plugin URI:  https://wordpress.org/plugins/ldap-staff-directory/
    55 * Description: Connects to LDAPS to display an employee directory from an OU. Supports Elementor, Beaver Builder and a native shortcode.
    6  * Version:     1.1.1
     6 * Version:     1.1.2
    77 * Requires at least: 5.8
    88 * Requires PHP: 7.4
    … …  
    1919
    2020// Plugin constants.
    21 define( 'LDAP_ED_VERSION',     '1.1.1' );
     21define( 'LDAP_ED_VERSION',     '1.1.2' );
    2222define( 'LDAP_ED_FILE',        __FILE__ );
    2323define( 'LDAP_ED_DIR',         plugin_dir_path( __FILE__ ) );
  • ldap-staff-directory/trunk/public/css/directory.css

    r3548101 r3606783  
    264264}
    265265
     266.ldap-extension {
     267        display: block;
     268        margin-top: 4px;
     269        font-size: .88em;
     270        color: var( --ldap-muted-color );
     271}
     272
    266273/* ── No-results ─────────────────────────────────────────────────────────── */
    267274
  • ldap-staff-directory/trunk/public/views/directory.php

    r3548101 r3606783  
    181181                                        <?php echo esc_html( $ldap_ed_user['phone'] ); ?>
    182182                                </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>
    183187                                <?php endif; ?>
    184188                        </article>
  • ldap-staff-directory/trunk/readme.txt

    r3548101 r3606783  
    55Tested up to:      7.0
    66Requires PHP:      7.4
    7 Stable tag:        1.1.1
     7Stable tag:        1.1.2
    88License:           GPLv2 or later
    99License URI:       https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    7878== Changelog ==
    7979
     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
    8083= 1.1.1 =
    8184* 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.