[WordPress] 外掛分享: WP Cassify

首頁外掛目錄 › WP Cassify
WordPress 外掛 WP Cassify 的封面圖片
900+
安裝啟用
★★★★★
5/5 分(16 則評價)
161 天前
最後更新
問題解決
WordPress 4.4+ PHP 7.0+ v2.3.9 上架:2016-02-04

內容簡介

如果您對這個外掛程式很滿意:
作為我的努力報酬,我希望能夠收到大學或公司贈送的 T 恤(或其他好禮)。
我的尺寸是 L。最好的祝福。

這個 JASIG CAS 認證外掛程式不依賴於 phpCas 庫。它不僅僅是一個認證外掛程式。
您可以根據 cas 使用者屬性建立自定義的授權規則。如果使用者在 WordPress 資料庫中不存在,它可以自動建立。有很多功能。您可以自定義一切。

網站

Plugin overview

要求

至少需要 PHP 7.0 版本
至少需要 PHP CURL 套件

包括的功能

支援 SLO (單一登出) (感謝 dedotombo 和 me)
添加 NCONTAINS 運算元 (感謝 blandman)
修正閘道模式 (自動登入) 的錯誤 (再次感謝 dedotombo)。現在不需要修改佈景主題檔案來執行。
添加身分認證失敗時登出選項,以免打擾使用者
在稍候的階段(在 wp_loaded 而非 init 上),初始化 PHP 會話

添加一些自訂的掛鉤和過濾器。

已經測試了 CAS Server 版本 4.1.4

與 CAS Protocol 版本 2 和 3 相容
如果 WordPress 資料庫中不存在使用者,自動創建使用者。
將 WordPress 使用者元數據與 CAS 使用者屬性同步。
添加對多值 cas 使用者欄位的支援。現在多值欄位可以序列化以存儲在自訂的 WP 使用者元數據中。
備份/還原外掛程式配置選項設置
您可以選擇要填入的 CAS 使用者屬性。然後您可以通過 PHP 會話訪問它們。

請注意,從 1.8.4 開始,要從佈景主題檔案中訪問 CAS 使用者屬性,請使用下面的代碼:

<?php
if ( isset($GLOBALS['wp-cassify']) ) {
print_r( $GLOBALS['wp-cassify']->wp_cassify_get_cas_user_datas() );
}
?>

根據 CAS 使用者屬性設定 WordPress 角色給使用者。

如果啟用了外掛程式的網路,您可以定義使用者角色規則範圍(按網誌 ID)。
授權規則編輯器。
與 WordPress 存取控制外掛程式相容。
管理 URL 白名單以跳過特定頁面的 CAS 認證。

非常簡單,使用 Susan Boland 提供的 post 方法來繞過身分驗證(請參閱在線文件)。創建包含 redirect 屬性的 WordPress 身分驗證表單,如下所示:

<?php

$args = array(
'echo' => true,
'remember' => true,
'redirect' => site_url( '/?wp_cassify_bypass=bypass' ),
'form_id' => 'loginform',
'id_username' => 'user_login',
'id_password' => 'user_pass',
'id_remember' => 'rememberme',
'id_submit' => 'wp-submit',
'label_username' => __( 'Username' ),
'label_password' => __( 'Password' ),
'label_remember' => __( 'Remember Me' ),
'label_log_in' => __( 'Log In' ),
'value_username' => '',
'value_remember' => false
);

wp_login_form( $args );
?>

在觸發後收到電子郵件通知(在使用者帳戶創建後、在使用者登入/登出後)。

根據使用者屬性值定義通知規則

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.3.9) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「WP Cassify」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

If you’re happy with this plugin :
As a reward for my efforts, I would like to receive T-shirts (or other goodies) as gifts from the universities or companies that use it.
My size is L. Best regards.
This Apereo CAS authentication plugin has no phpCas library dependency. This is not only an authentication plugin.
You can build custom authorization rules according to cas user attributes populated. If user don’t exist in WordPress
database, it can be created automatically. There are many features. You can customize everything.
Website

Plugin overview


Development and release environment
This plugin is now developed and tested from a github repository. You can find it here :
https://github.com/WP-Cassify/wp-cassify-develop
Don’t hesitate to contribute to this project. You can fork it and make pull requests !
Requirements

Require at least PHP version 7.0
Require at least PHP CURL package

Features included

SLO (Single Log Out) support (thanks to dedotombo and me)
Adding NCONTAINS operator (thanks to blandman)
Fix bug on Gateway mode (autologin) (thanks to dedotombo again). Now it’s now necessary to hack theme files to fire it.
Adding option logout on authentication failure to not disturb users
Initialize PHP session at a later stage (on wp_loaded not on init)

Adding some customs hooks and filters.

Tested with Apereo CAS Server version 7.2.5

Compatible with CAS Protocol version 2 and 3
Automatic user creation if not exist in WordPress database.
Synchronize WordPress User metas with CAS User attributes.
Add support for multivaluate cas user fields. Now multivaluate fields can be serialized to be stored in custom WP User meta.
Backup / Restore plugin configuration options settings
You can choose CAS User attributes you want to populate. Then you can access them via PHP Session.

Be careful, to access to CAS User Attributes from your theme file (from 1.8.4), use code below :
wp_cassify_get_cas_user_datas() );
}
?>

Set up WordPress Roles to User according to CAS User attributes.

If plugin is network activated, you can define User Role Rule scope by blog id.
Authorization rule editor.
Compatible with WordPress Access Control Plugin.
Manage URL White List to bypass CAS Authentication on certain pages.

Much simpler bypass authentication with post method provided by Susan Boland (See online documentation). Create wordpress authentication form with redirect attribute like this :
true,
'remember' => true,
'redirect' => site_url( '/?wp_cassify_bypass=bypass' ),
'form_id' => 'loginform',
'id_username' => 'user_login',
'id_password' => 'user_pass',
'id_remember' => 'rememberme',
'id_submit' => 'wp-submit',
'label_username' => __( 'Username' ),
'label_password' => __( 'Password' ),
'label_remember' => __( 'Remember Me' ),
'label_log_in' => __( 'Log In' ),
'value_username' => '',
'value_remember' => false
);

wp_login_form( $args );
?>

Receive email notifications when trigger is fired (after user account creation, after user login/logout).

Define notifications rules based on user attributes values.
Purge user roles before applying user role rules.
Define user account expiration rules bases on CAS User attributes.
Network activation allowed
You can set Service Logout URL (Needs to have CAS Server with followServiceRedirects option configured).
Add support for web application hosted behind a reverse proxy. (Thanks to franck86)
Add custom hooks : wp_cassify_after_cas_authentication, wp_cassify_before_auth_user_wordpress, wp_cassify_before_redirect, wp_cassify_after_redirect. (See online documentation)
Custom filter to perform custom cas server response parsing. Hook name : wp_cassify_custom_parsing_cas_xml_response (See online documentation)
Custom shortcode to generate CAS login/logout link into your blog. (See online documentation)
Debug settings, dump last xml cas server response.
Detect if user has already authenticated by CAS from your public pages and perform auto-login with gateway mode

Add ‘-IN’ and ‘-NOTIN’ operators to process array attributes values returned from CAS.
When you have :
$cas_user_datas['title'] = array( 'Student', 'Professor' );

Then you can use :
(CAS{title} -IN "professor")

延伸相關外掛

文章
Filter
Apply Filters
Mastodon