PluginProbe
Authorizer / 2.9.6
Authorizer v2.9.6
3.15.3 3.15.2 3.15.1 3.15.0 3.14.3 3.14.4 3.14.2 3.14.1 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.10 2.9.11 2.9.12 2.9.13 2.9.2 2.9.3 2.9.6 All 126 releases
authorizer / src / authorizer / class-dashboard-widget.php

class-dashboard-widget.php in Authorizer 2.9.6, at src/authorizer/class-dashboard-widget.php

66 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Authorizer
4 *
5 * @license GPL-2.0+
6 * @link https://github.com/uhm-coe/authorizer
7 * @package authorizer
8 */
9
10 namespace Authorizer;
11
12 use Authorizer\Helper;
13 use Authorizer\Options;
14 use Authorizer\Options\Access_Lists;
15 use Authorizer\Options\Login_Access;
16
17 /**
18 * Builds the Dashboard widget.
19 */
20 class Dashboard_Widget extends Static_Instance {
21
22 /**
23 * Load Authorizer dashboard widget if it's enabled.
24 *
25 * Action: wp_dashboard_setup
26 */
27 public function add_dashboard_widgets() {
28 $options = Options::get_instance();
29 $widget_enabled = $options->get( 'advanced_widget_enabled', Helper::SINGLE_CONTEXT, 'allow override' ) === '1';
30
31 // Load authorizer dashboard widget if it's enabled and user has permission.
32 if ( current_user_can( 'create_users' ) && $widget_enabled ) {
33 // Add dashboard widget for adding/editing users with access.
34 wp_add_dashboard_widget( 'auth_dashboard_widget', __( 'Authorizer Settings', 'authorizer' ), array( $this, 'add_auth_dashboard_widget' ) );
35 }
36 }
37
38
39 /**
40 * Render Authorizer dashboard widget (callback).
41 */
42 public function add_auth_dashboard_widget() {
43 $access_lists = Access_Lists::get_instance();
44 $login_access = Login_Access::get_instance();
45 ?>
46 <form method="post" id="auth_settings_access_form" action="">
47 <?php $login_access->print_section_info_access_login(); ?>
48 <div>
49 <h2><?php esc_html_e( 'Pending Users', 'authorizer' ); ?></h2>
50 <?php $access_lists->print_combo_auth_access_users_pending(); ?>
51 </div>
52 <div>
53 <h2><?php esc_html_e( 'Approved Users', 'authorizer' ); ?></h2>
54 <?php $access_lists->print_combo_auth_access_users_approved(); ?>
55 </div>
56 <div>
57 <h2><?php esc_html_e( 'Blocked Users', 'authorizer' ); ?></h2>
58 <?php $access_lists->print_combo_auth_access_users_blocked(); ?>
59 </div>
60 <br class="clear" />
61 </form>
62 <?php
63 }
64
65 }
66