static function init() { if (!self::$instance) { if (did_action('plugins_loaded')) { self::plugin_textdomain(); } else { add_action('plugins_loaded', array(__CLASS__, 'plugin_textdomain')); } self::$instance = new U2F(); } return self::$instance; }
function process_bulk_action() { if (!isset($_GET['key']) or !is_array($_GET['key'])) { return false; } switch ($this->current_action()) { case 'delete': foreach ($_GET['key'] as $key) { U2F::delete_security_key(get_current_user_id(), $key); foreach ($this->data as $index => $data) { if ($key == $data['keyHandle']) { unset($this->data[$index]); } } } break; } }
public function test_init() { $this->assertInstanceOf('U2F', U2F::init()); }
/** * doRegistration * @param string $regRequest * @param string $registration * @return void **/ public function doRegistration($regRequest, $registration) { return $this->u2f->doRegister($regRequest, $registration); }