| 1 |
<?php |
| 2 |
/* |
| 3 |
* License: GPLv3 |
| 4 |
* License URI: https://www.gnu.org/licenses/gpl.txt |
| 5 |
* Copyright 2012-2026 Jean-Sebastien Morisset (https://wpsso.com/) |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
die( 'These aren\'t the droids you\'re looking for.' ); |
| 10 |
} |
| 11 |
|
| 12 |
if ( ! class_exists( 'WpssoProfileYourSSO' ) && class_exists( 'WpssoAdmin' ) ) { |
| 13 |
|
| 14 |
class WpssoProfileYourSSO extends WpssoAdmin { |
| 15 |
|
| 16 |
public function __construct( &$plugin, $id, $name, $lib, $ext ) { |
| 17 |
|
| 18 |
$this->p =& $plugin; |
| 19 |
|
| 20 |
if ( $this->p->debug->enabled ) { |
| 21 |
|
| 22 |
$this->p->debug->mark(); |
| 23 |
} |
| 24 |
|
| 25 |
$this->menu_id = $id; |
| 26 |
$this->menu_name = $name; |
| 27 |
$this->menu_lib = $lib; |
| 28 |
$this->menu_ext = $ext; |
| 29 |
|
| 30 |
$metabox_id = $this->p->cf[ 'meta' ][ 'id' ]; |
| 31 |
$metabox_title = _x( $this->p->cf[ 'meta' ][ 'title' ], 'metabox title', 'wpsso' ); |
| 32 |
|
| 33 |
$this->menu_metaboxes = array( $metabox_id => $metabox_title ); |
| 34 |
} |
| 35 |
|
| 36 |
/* |
| 37 |
* Callback method must be public for add_meta_box() hook. |
| 38 |
* |
| 39 |
* See WpssoAdmin->add_settings_page_metaboxes(). |
| 40 |
*/ |
| 41 |
public function show_metabox_sso() { |
| 42 |
|
| 43 |
$user_id = get_current_user_id(); |
| 44 |
$user_obj = get_userdata( $user_id ); |
| 45 |
|
| 46 |
if ( empty( $user_obj->ID ) ) { // Just in case. |
| 47 |
|
| 48 |
wp_die( __( 'Invalid user ID.' ) ); |
| 49 |
} |
| 50 |
|
| 51 |
$this->p->user->show_metabox_sso( $user_obj ); |
| 52 |
} |
| 53 |
} |
| 54 |
} |
| 55 |
|