/** * Class constructor. * * @since 0.1-dev */ protected function __construct() { require_once TWO_FACTOR_DIR . 'includes/Yubico/U2F.php'; self::$u2f = new u2flib_server\U2F(set_url_scheme('//' . $_SERVER['HTTP_HOST'])); require_once TWO_FACTOR_DIR . 'providers/class.two-factor-fido-u2f-admin.php'; Two_Factor_FIDO_U2F_Admin::add_hooks(); add_action('login_enqueue_scripts', array($this, 'login_enqueue_assets')); add_action('two-factor-user-options-' . __CLASS__, array($this, 'user_options')); return parent::__construct(); }
/** * Class constructor. * * @since 0.1-dev */ protected function __construct() { $app_url_parts = parse_url(home_url()); $app_url = sprintf('%s://%s', $app_url_parts['scheme'], $app_url_parts['host']); require_once TWO_FACTOR_DIR . 'includes/Yubico/U2F.php'; self::$u2f = new u2flib_server\U2F($app_url); require_once TWO_FACTOR_DIR . 'providers/class.two-factor-fido-u2f-admin.php'; Two_Factor_FIDO_U2F_Admin::add_hooks(); add_action('login_enqueue_scripts', array($this, 'login_enqueue_assets')); add_action('two-factor-user-options-' . __CLASS__, array($this, 'user_options')); return parent::__construct(); }
/** * Generates content for a single row of the table * * @since 0.1-dev * @access protected * * @param object $item The current item. * @param string $column_name The current column name. */ protected function column_default($item, $column_name) { switch ($column_name) { case 'name': $actions = array('delete' => Two_Factor_FIDO_U2F_Admin::delete_link($item)); return esc_html($item->name) . self::row_actions($actions); case 'added': return date(get_option('date_format', 'r'), $item->added); case 'last_used': return date(get_option('date_format', 'r'), $item->last_used); default: return 'WTF^^?'; } }
/** * Generates content for a single row of the table * * @since 0.1-dev * @access protected * * @param object $item The current item. * @param string $column_name The current column name. */ protected function column_default($item, $column_name) { switch ($column_name) { case 'name': $out = '<div class="hidden" id="inline_' . esc_attr($item->keyHandle) . '">'; $out .= '<div class="name">' . esc_html($item->name) . '</div>'; $out .= '</div>'; $actions = array('rename hide-if-no-js' => Two_Factor_FIDO_U2F_Admin::rename_link($item), 'delete' => Two_Factor_FIDO_U2F_Admin::delete_link($item)); return esc_html($item->name) . $out . self::row_actions($actions); case 'added': return date(get_option('date_format', 'r'), $item->added); case 'last_used': return date(get_option('date_format', 'r'), $item->last_used); default: return 'WTF^^?'; } }