function appendScript($selector = null) { if (empty($selector)) { $selector = $this->formSelector; } if ($this->isThePage() and $this->isConfirmationRequired()) { $gui = Rublon2FactorGUIWordPress::getInstance(); echo self::getScript($selector, self::FORM_CLASS); } }
public static function getInstance() { if (empty(self::$instance)) { $additional_settings = RublonHelper::getSettings('additional'); $current_user = wp_get_current_user(); self::$instance = new self(RublonHelper::getRublon(), RublonHelper::getUserId($current_user), RublonHelper::getUserEmail($current_user), $logout_listener = RublonHelper::isLogoutListenerEnabled()); // Embed consumer script if (RublonHelper::isSiteRegistered()) { add_action('wp_footer', array(self::$instance, 'renderConsumerScript'), PHP_INT_MAX); add_action('admin_footer', array(self::$instance, 'renderConsumerScript'), PHP_INT_MAX); } } return self::$instance; }
function rublon2factor_render_acm_page() { ?> <div class="wrap"> <div id="rublon2factor_acm_page"> <h2 class="rublon-header"> <?php echo __('Rublon', 'rublon') . ' - ' . __('Account Sharing Manager', 'rublon'); ?> </h2> <p> <?php echo __('Rublon instantly protects all accounts with effortless, email-based two-factor authentication.', 'rublon') . ' ' . __('Get the optional mobile app for more security!', 'rublon') . ' ' . sprintf(__('Learn more at <a href="%s" target="_blank">wordpress.rublon.com</a>.', 'rublon'), RublonHelper::wordpressRublonComURL()); ?> </p> <?php // ACM widget $current_user = wp_get_current_user(); if (RublonHelper::canShowACM() && RublonHelper::isUserAuthenticated($current_user)) { $gui = Rublon2FactorGUIWordPress::getInstance(); echo $gui->getACMWidget(); } ?> </div> </div> <?php }