Some checks are pending
CI / PHP lint (7.4) (pull_request) Waiting to run
CI / PHP lint (8.0) (pull_request) Waiting to run
CI / PHP lint (8.1) (pull_request) Waiting to run
CI / PHP lint (8.2) (pull_request) Waiting to run
CI / PHP lint (8.3) (pull_request) Waiting to run
CI / PHP lint (8.4) (pull_request) Waiting to run
CI / WordPress Coding Standards (pull_request) Waiting to run
CI / WordPress.org Plugin Check (pull_request) Waiting to run
New "User sync" tab that imports Microsoft 365 / Entra ID users as WordPress accounts and keeps them up to date: - Scope: whole tenant or the (nested) members of selected groups, guests optional, e-mail domain allow-list respected. Existing accounts are linked by e-mail address. - Roles: selectable default role plus a group -> role mapping (in addition to or instead of the default role, first match wins). Roles of pre-existing accounts are only managed on request. - Profile: selectable Graph attributes (names, job title, department, phones, address, language, ...) and the profile photo as avatar. - Deprovisioning: accounts disabled or deleted in Microsoft 365 (or removed from the sync groups) are deactivated or deleted; accounts deactivated by the sync are reactivated automatically. Deactivated accounts lose every sign-in path and all sessions. - Safeguards: dry run, safety stop above 20 % (min. 5) deprovisioning, abort on any Graph error, "deleted" only on a 404 for the object ID, protected pre-existing administrators and own account, content reassignment required for deletion, run lock. - Runs manually, via WP-Cron or `wp m365-login sync [--dry-run]`. - Users screen column with deactivate/reactivate row actions and a read-only Microsoft 365 section on the profile screen. The Graph client gains paging, retry on throttling and user, group member and photo endpoints. The group picker is now reusable. Version 1.1.0, German translations (du/Sie), docs and audit addendum. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
40 lines
1.9 KiB
PHP
40 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: M365 Login
|
|
* Plugin URI: https://github.com/friloo/wp-m365-login
|
|
* Description: Adds a customisable "Sign in with Microsoft" button to the WordPress login page. Users are matched by e-mail address via Microsoft Entra ID (OpenID Connect, PKCE); an optional user sync imports Microsoft 365 users with roles and profile fields.
|
|
* Version: 1.1.0
|
|
* Requires at least: 6.0
|
|
* Requires PHP: 7.4
|
|
* Author: friloo
|
|
* Author URI: https://github.com/friloo
|
|
* License: GPL-2.0-or-later
|
|
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
|
* Text Domain: m365-login
|
|
* Domain Path: /languages
|
|
*/
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
define( 'M365_LOGIN_VERSION', '1.1.0' );
|
|
define( 'M365_LOGIN_FILE', __FILE__ );
|
|
define( 'M365_LOGIN_DIR', plugin_dir_path( __FILE__ ) );
|
|
define( 'M365_LOGIN_URL', plugin_dir_url( __FILE__ ) );
|
|
define( 'M365_LOGIN_OPTION', 'm365_login_settings' );
|
|
|
|
require_once M365_LOGIN_DIR . 'includes/class-m365-login-settings.php';
|
|
require_once M365_LOGIN_DIR . 'includes/class-m365-login-crypto.php';
|
|
require_once M365_LOGIN_DIR . 'includes/class-m365-login-jwt.php';
|
|
require_once M365_LOGIN_DIR . 'includes/class-m365-login-certificate.php';
|
|
require_once M365_LOGIN_DIR . 'includes/class-m365-login-graph.php';
|
|
require_once M365_LOGIN_DIR . 'includes/class-m365-login-auth.php';
|
|
require_once M365_LOGIN_DIR . 'includes/class-m365-login-sync.php';
|
|
require_once M365_LOGIN_DIR . 'includes/class-m365-login-button.php';
|
|
require_once M365_LOGIN_DIR . 'includes/class-m365-login-admin.php';
|
|
require_once M365_LOGIN_DIR . 'includes/class-m365-login.php';
|
|
require_once M365_LOGIN_DIR . 'includes/functions.php';
|
|
|
|
register_activation_hook( __FILE__, array( 'M365_Login', 'activate' ) );
|
|
register_deactivation_hook( __FILE__, array( 'M365_Login_Sync', 'unschedule' ) );
|
|
|
|
add_action( 'plugins_loaded', array( 'M365_Login', 'instance' ) );
|