-
Notifications
You must be signed in to change notification settings - Fork 2
/
award-force-sso.php
38 lines (33 loc) · 1.2 KB
/
award-force-sso.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/*
* Plugin Name: Award Force SSO
* Plugin URI: https://www.awardforce.com/
* Description: A WordPress plugin supporting single sign-on via Award Force
* Author: Creative Force
* Version: 1.8
* Author URI: https://www.creativeforce.team/
* License: GPL2+
* Text Domain: award-force-sso
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
require 'vendor/autoload.php';
/*----------------------------------------------------------------------------*
* Admin functionality
*----------------------------------------------------------------------------*/
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
$admin = new AwardForceSSO_Admin;
add_action( 'admin_init', [ $admin, 'register_settings' ] );
add_action( 'admin_menu', [ $admin, 'register_menu' ] );
}
/*----------------------------------------------------------------------------*
* Public-Facing functionality
*----------------------------------------------------------------------------*/
add_action('init', function () {
if ( strstr( $_SERVER['REQUEST_URI'], '/awardforce/sso' ) ) {
$awardForce = new AwardForceSSO(new AwardForceAPIV2);
$awardForce->sso();
}
});