public function render() { $connect_nonce = wp_create_nonce(self::CONNECT_CLEF_OAUTH_ACTION); $redirect_url = add_query_arg(array('_wpnonce' => $connect_nonce, 'connect' => true), admin_url("/admin.php?page=" . $this->settings->settings_path)); echo ClefUtils::render_template('user_settings.tpl', array("options" => array("connected" => ClefUtils::user_has_clef(), "appID" => $this->settings->get('clef_settings_app_id'), "redirectURL" => $redirect_url, "clefJSURL" => CLEF_JS_URL, "state" => ClefUtils::get_state(), "nonces" => array("connectClef" => $connect_nonce, "disconnectClef" => wp_create_nonce(self::DISCONNECT_CLEF_ACTION))))); $this->rendered = true; }
public function badge_prompt_html() { if (!$this->should_display_prompt()) { return; } $had_clef_before_onboarding = $this->onboarding->had_clef_before_onboarding(); echo ClefUtils::render_template('admin/badge-prompt.tpl', array("had_clef_before_onboarding" => $had_clef_before_onboarding)); // Ensure the prompt is hidden on next load $this->hide_prompt(); }
function send_email($from_email) { if (empty($this->user_email)) { return true; } $invite_link = $this->get_link(); $subject = '[' . $this->site_name . '] ' . __('Set up Clef for your account', "clef"); $message = ClefUtils::render_template('invite_email.tpl', array("invite_link" => $this->get_link(), "site_name" => $this->site_name), false); $headers = "From: WordPress <" . $from_email . "> \r\n"; add_filter('wp_mail_content_type', array('ClefUtils', 'set_html_content_type')); $sent = wp_mail($this->user_email, $subject, $message, $headers); remove_filter('wp_mail_content_type', array('ClefUtils', 'set_html_content_type')); return $sent; }
:</b></span> <div class="support-html-container hide-if-js"> <h4><?php _e('Copy this HTML where you want to add the badge', 'wpclef'); ?> </h4> <textarea class="ajax-ignore"><?php echo esc_textarea(ClefUtils::render_template('badge.tpl', array("pretty" => true))); ?> </textarea> <h4><?php _e('Copy this HTML where you want to add the link', 'wpclef'); ?> </h4> <textarea class="ajax-ignore"><?php echo esc_textarea(ClefUtils::render_template('badge.tpl', array("pretty" => false))); ?> </textarea> </div> </div> <div class="preview-container hide-if-no-js"> <div class="ftr-preview"> <h4><?php _e("Preview of your support", "wpclef"); ?> </h4> <a href="https://bit.ly/wordpress-login-clef" class="clef-badge pretty" ><?php _e("WordPress Login Protected by Clef", "wpclef"); ?> </a> <span class="hide-if-js">
public function multisite_settings() { echo ClefUtils::render_template('admin/multisite-disabled.tpl'); }
?> </h3> <p><?php _e("If you lose your device, don't fret! Just visit <a href='https://getclef.com/lost'>getclef.com/lost</a>, deactivate with your PIN, and reactivate on a new device.", "wpclef"); ?> </p> <div class="button button-primary button-hero next"><?php _e("Got it!", "wpclef"); ?> </div> </div> <?php if (is_admin()) { ?> <?php echo ClefUtils::render_template('admin/waltz-prompt.tpl', array("next_href" => '#', "next_text" => __("Go to Clef settings", "wpclef"), "class" => "setup")); ?> <?php echo ClefUtils::render_template('admin/waltz-prompt.tpl', array("next_href" => admin_url(), "next_text" => __("Go to dashboard", "wpclef"), "class" => "connect")); ?> <?php } ?> </div> </div>
public static function send_email($email, $subject, $template, $vars) { // Get the site domain and get rid of www. $sitename = strtolower($_SERVER['SERVER_NAME']); if (substr($sitename, 0, 4) == 'www.') { $sitename = substr($sitename, 4); } $from_email = 'wordpress@' . $sitename; $message = ClefUtils::render_template($template, $vars, false); $headers = "From: WordPress <" . $from_email . "> \r\n"; add_filter('wp_mail_content_type', array('ClefUtils', 'set_html_content_type')); $sent = wp_mail($email, $subject, $message, $headers); remove_filter('wp_mail_content_type', array('ClefUtils', 'set_html_content_type')); return $sent; }
public function render_login_button($redirect_url = false, $app_id = false, $embed = false, $type = "login") { if (!$app_id) { $app_id = $this->settings->get('clef_settings_app_id'); } if (!$redirect_url) { $redirect_url = $this->get_callback_url(); } echo ClefUtils::render_template('button.tpl', array("app_id" => $app_id, "redirect_url" => $redirect_url, "embed" => $embed, "type" => $type, "custom" => array("logo" => $this->settings->get('customization_logo'), "message" => $this->settings->get('customization_message')))); }
public function render() { echo ClefUtils::render_template('user_settings.tpl', array("connect_error" => $this->connect_error, "options" => array("connected" => ClefUtils::user_has_clef(), "appID" => $this->settings->get('clef_settings_app_id'), "clefJSURL" => CLEF_JS_URL, "state" => ClefUtils::get_state(), "nonces" => array("disconnectClef" => wp_create_nonce(self::DISCONNECT_CLEF_ACTION))))); $this->rendered = true; }
public function other_install_settings() { require_once 'lib/plugin-installer/installer.php'; $installer = new PluginInstaller(array("name" => "BruteProtect", "slug" => "bruteprotect")); // pass in current URL as base URL $url = $installer->url(); echo ClefUtils::render_template('admin/other-install.tpl', array("url" => $url)); }