內容簡介
這個外掛讓你可以查詢一個活動目錄伺服器,選擇性地篩選使用者並在 WordPress 網站中以列表形式顯示。該外掛的一些功能包括:
小工具 - 提供一個小工具,具有一些篩選/格式化選項,讓你可以在任何小工具區域中顯示用戶列表
短碼 - 提供一個短碼,具備所有外掛的篩選/格式化選項,讓你可以在任何頁面或文章中顯示用戶列表
輸出生成器 - 提供一個完整的輸出生成器,讓你可以完全自定每個用戶在列表中顯示的格式。輸出生成器甚至允許使用條件語句(if...elseif...else)
格式選項 - 除了輸出生成器(用於每個單獨的用戶),還提供以下格式化選項:
before_list - 你希望出現在員工列表之前的任何 HTML 代碼。該代碼會輸出在開始的 title_wrap 標記之前。
after_list - 你希望出現在員工列表之後的任何 HTML 代碼。該代碼會在閉合的 list_wrap 標記之後輸出。
after_title - 你希望出現在關閉 title_wrap 標記和開啟 list_wrap 標記之間的任何 HTML 代碼。
title_wrap - 你想要用來包裝列表標題(如果設置)的 HTML 元素。只需輸入元素名稱,請勿添加任何開放或閉合括號。
title_class - 你想要應用於列表標題的 CSS 類(如果設置)。如果你希望不應用 CSS 類,請將其留空。
title_id - 如果你希望將 HTML ID 應用於列表標題,可以在此處指示。請記住,ID 應該是唯一的,因此,如果你計劃在單個頁面上使用多個員工列表,請將其留空。
title - 你希望出現在列表頂部的標題。該標題會在開始列表本身之前輸出。
list_wrap - 你想要用來包裝整個列表的 HTML 元素。只需輸入元素名稱,請勿添加任何開放或關閉括號。
list_class - 你想要指定給開始 list_wrap 標記的 CSS 類,以幫助樣式化整個列表。如果你希望不應用 CSS 類,請將其留空。
list_id - 如果你希望將 HTML ID 應用於列表本身,可以在此處指示。請記住,ID 應該是唯一的,因此,如果你計劃在單個頁面上使用多個員工列表,請將其留空。
item_wrap - 你想要用來包裝列表中每個個人員的 HTML 元素。只需輸入元素名稱,請勿添加任何開放或閉合括號。
item_class - 你想要指定給列表中每個個人員的 CSS 類。如果你希望不應用 CSS 類,請將其留空。
item_id - 如果你希望將 HTML ID 應用於列表中的每個個人員,可以在此處指示。你可以使用占位符變量來輸出 user 的信息(任何設置為檢索的字段以及 user 的用戶名(samaccountname))。只需將占位符變量欄位用百分比符號包裝起來(因此,要使用 samaccountname 的占位符變量,請使用%samaccountname%)所有不允許的字符(@ 符號,點,空格等)都將被替換為連字符。請記住,ID 應該是唯一的,因此,如果你打算在單個頁面上使用可能在單個員工列表中多次包括同一個員工的多個員工列表,請將其留空。同樣,你應該使用一個唯一的占位符變量。
字段選擇
外掛標籤
開發者團隊
② 後台搜尋「Active Directory Employee Listing」→ 直接安裝(推薦)
原文外掛簡介
This plugin allows you to query an active directory server to retrieve an optionally filtered list of users and display it as a list within a WordPress site. Some of the features of this plugin include:
Widget – a widget is provided, with a few filtering/formatting options, to allow you to display a user list in any widgetized area
Shortcode – a shortcode is provided, with all of the plugin’s filtering/formatting options, to allow you to display a user list within any page or post
Output builder – a full-featured output builder is provided, allowing you to completely customize the format in which each user is displayed within the list. The output builder even allows conditional (if…elseif…else) statements.
Format options – in addition to the output builder (which is used for each individual user), the following formatting options are also available:
before_list – Any HTML code you would like to appear before the list of employees. This code is output before the opening title_wrap tag.
after_list – Any HTML code you would like to appear after the list of employees. This code is output after the closing list_wrap tag.
after_title – Any HTML code you would like to appear between the closing title_wrap tag and the opening list_wrap tag.
title_wrap – The HTML element you would like to use to wrap the list title (if set). Just the element name, please; no opening or closing brackets.
title_class – The CSS class you would like applied to the list title (if set). If you would prefer that no CSS class be applied to the title, leave this blank.
title_id – If you would like to apply an HTML ID to the list title, you can indicate that here. Remember that IDs should be unique, so, if you plan on using multiple employee lists on a single page, you should leave this blank.
title – The title you would like to appear at the top of the list. The title is output prior to the opening of the list itself.
list_wrap – The HTML element you would like to use to wrap the entire list. Just the element name, please; no opening or closing brackets.
list_class – The CSS class you would like to assign to the opening list_wrap tag, aiding in styling the entire list. If you would prefer that no CSS class be applied to the list, leave this blank.
list_id – If you would like to apply an HTML ID to the list itself, you can indicate that here. Remember that IDs should be unique, so, if you plan on using multiple employee lists on a single page, you should leave this blank.
item_wrap – The HTML element you would like to use to wrap each individual employee in the list. Just the element name, please; no opening or closing brackets.
item_class – The CSS class you would like to assign to each individual employee in the list. If you would prefer that no CSS class be applied to the list, leave this blank.
item_id – If you would like to apply an HTML ID to each individual employee in the list, you can indicate that here. You can use placeholder variables for user information (any of the fields that are set to be retrieved, plus the user’s username (samaccountname). Simply wrap the placeholder variable with percent symbols (so, to use a placeholder for samaccountname, use %samaccountname%) All disallowed characters (the @ symbol, dots, spaces, etc.) will be replaced with hyphens. Remember that IDs should be unique, so, if you plan on using multiple employee lists that may include the same employee multiple times on a single page, you should leave this blank. Likewise, you should use a placeholder variable that will be unique.
Field chooser – choose which Active Directory fields to retrieve from the server (note that any fields included in the output builder must be chosen in the field chooser, otherwise they won’t be retrieved and, therefore, won’t be displayed)
Single user display – feed a username to the shortcode or widget, and a single user will be retrieved and displayed, rather than a list of users
Search form – a simple search form (the input keyword is searched against all fields being retrieved) is provided
Multisite-compatible – Options can be set for the entire network, and can be overridden on each individual site within the network. Some options can even be overridden in the widget or shortcode itself.
Information cache – Information retrieved by this plugin is cached for 24 hours after it is retrieved (this option is not currently configurable, but will probably be in future versions) in order to avoid hitting the AD server more than necessary.
You can connect to the Active Directory server using SSL and/or TLS, if desired. You can also provide multiple Active Directory server addresses to allow load-balancing (a random server is chosen from the list before connecting and querying).
Compatibility Note and Credits
This plugin currently utilizes version 3.3.2 (with some extended functionality built specifically for this plugin) of the adLDAP class from Scott Barnett & Richard Hyland. It has also been tested with version 3.1-Extended and version 3.3.2-Extended as they are included with various versions of the Active Directory Authentication Integration and Active Directory Integration plugins. This plugin is potentially incompatible (and has not been tested) with Active Directory Integration, though; as it all depends on in which order the adLDAP class is instantiated (if this plugin’s copy of adLDAP is included before that plugin’s version, that plugin may not work properly).
This plugin was developed by Curtiss Grymala for the University of Mary Washington. It is licensed under the GPL2, which basically means you can take it, break it and change it any way you want, as long as the original credit and license information remains somewhere in the package.
Important Note
At this time, this plugin has only been tested on a handful of WordPress installations (all on similar server configurations) with a single Active Directory server, so it is entirely possible that there will be bugs or errors that stop it (or other plugins) from working properly. In order to improve this plugin, please share any feedback you have.
To Do
Implement pagination
Provide a work-around for the PHP “paging” error
Investigate allowing results to be filtered by multiple groups
Investigate allowing results to be filtered by multiple usernames
