Initial commit. State 04.2021.

This commit is contained in:
2021-04-22 17:57:16 +02:00
commit 82781cca41
2974 changed files with 975656 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
<div class="updated clef-badge-prompt hide-if-no-js">
<div class="badge-fade">
<?php if ($had_clef_before_onboarding) { ?>
<h3><?php _e("You just logged in securely with Clef!", "clef"); ?></h3>
<?php } else { ?>
<h3><?php _e("You just completed your first login with Clef!", "clef"); ?></h3>
<?php } ?>
<p><?php _e("Let your visitors know that you are protected with the Clef login by adding a Clef badge to the footer of your page. </br> This helps your visitors know they are browsing a secure site and helps us spread the word about Clef.", "clef"); ?></p>
<?php wp_nonce_field('clef_badge_prompt'); ?>
<a href="#" class="button button-primary button-hero add-badge"><?php _e("Add protected by Clef badge", "clef"); ?></a>
<a href="#" class="button no-badge button-hero"><?php _e("No thanks!", "clef"); ?></a>
</div>
<p></p>
<a href="#" class="dismiss">&times;</a>
</div>

View File

@@ -0,0 +1,163 @@
<div id="clef-settings-form">
<form id="clef-form" action="options.php" method="POST" autocomplete="off">
<h1 id="clef-settings-header" class="hide-if-js"><?php _e("Clef", "clef"); ?></h1>
<div id="fb-root"></div>
<div class="fb-like" data-href="https://www.facebook.com/getclef" data-width="200" data-layout="button_count" data-action="like" data-show-faces="true" data-share="false"></div>
<a href="https://twitter.com/getclef" class="twitter-follow-button" data-show-count="false" data-dnt="true"><?php printf( __( 'Follow %s', 'clef' ), '@getclef' ); ?></a>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=241719455859280";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<?php settings_fields($form->id); ?>
<div class="settings-section">
<div class="password-settings">
<div class="inputs-container">
<h3><?php _e("Disable passwords", "clef"); ?> <a class="setting-info" href="http://support.getclef.com/article/60-recommended-password-settings-for-clef-wordpress-plugin" target="clef">Learn more about these settings</a></h3>
<div class="input-container">
<label for="disable_passwords"><?php _e("Disable passwords for Clef users", "clef"); ?></label>
<?php $form->getSection('clef_password_settings')->getField('disable_passwords')->render(); ?>
</div>
<div class="input-container">
<label for=""><?php _e("Disable passwords for all users with privileges greater than or equal to ", "clef"); ?></label>
<?php $form->getSection('clef_password_settings')->getField('disable_certain_passwords')->render(); ?>
</div>
<?php if (property_exists($form->getSection('clef_password_settings'), 'custom_roles')) { ?>
<div class="input-container custom-roles">
<label class="title"><?php _e("Disable passwords for custom roles"); ?></label>
<?php foreach($form->getSection('clef_password_settings')->custom_roles as $role => $role_obj) { ?>
<div class="custom-role">
<label for=""><?php echo $role_obj['name'] ?></label>
<?php $form->getSection('clef_password_settings')->getField('disable_passwords_custom_role_' . $role)->render(); ?>
</div>
<?php } ?>
</div>
<?php }?>
<div class="input-container">
<label for=""><?php _e("Disable passwords for all users and hide the password login form.", "clef"); ?></label>
<?php $form->getSection('clef_password_settings')->getField('force')->render(); ?>
</div>
<div class="input-container">
<label for=""><?php _e("Allow passwords for API (necessary for things like the WordPress mobile app)", "clef"); ?></label>
<?php $form->getSection('clef_password_settings')->getField('xml_allowed')->render(); ?>
</div>
<h3><?php _e("Form style", "clef"); ?></h3>
<div class="input-container">
<label for=""><?php _e("Show Clef wave as primary login option", "clef"); ?></label>
<?php $form->getSection('clef_form_settings')->getField('embed_clef')->render(); ?>
</div>
</div>
<div id="login-form-view" class="login"></div>
</div>
</div>
<div class="override-settings settings-section">
<div class="inputs-container">
<h3><?php _e("Override URL", "clef"); ?> <a class="setting-info" href="http://support.getclef.com/article/11-creating-a-secret-url-where-you-can-log-into-your-wordpress-site-with-a-password" target="clef">Learn more about this setting</a></h3>
<p><?php _e("You have disabled passwords for some (or all) users. In case of emergency, you can create a special link where passwords can still be used. This is a good safety precaution.", "clef"); ?></p>
<div class="input-container">
<label for=""><?php echo wp_login_url() ?>?override=</label>
<?php $form->getSection('clef_override_settings')->getField('key')->render(array("placeholder" => __( "Enter override key here", 'clef' ))); ?>
<a class="generate-override hide-if-no-js"><?php _e("generate a secure override url for me", "clef"); ?></a>
</div>
<?php
$opts = get_option( 'wpclef' );
$css_hide = !empty( $opts['clef_override_settings_key'] ) ? '' : ' hidden';
$url = !empty( $opts['clef_override_settings_key'] ) ? esc_url( wp_login_url() . '?override=' . $opts['clef_override_settings_key'] ) : '#error';
?>
<div class="override-buttons<?php echo $css_hide; ?>">
<a name="override link" class="button button-primary button-hero" href="<?php echo $url; ?>"><?php bloginfo('name', 'display'); ?> <?php _e("Override URL", "clef"); ?></a>
<p><?php _e("Drag this your bookmarks bar", "clef"); ?></p>
</div>
<?php unset( $opts, $url ); ?>
</div>
<div class="preview-container">
<img src="<?php echo CLEF_URL ?>assets/dist/img/bookmark.png" alt="add to bookmarks bar">
</div>
</div>
<div class="support-settings settings-section">
<div class="inputs-container">
<h3><?php _e("Support Clef", "clef"); ?></h3>
<p><?php _e("Clef is, and will always be, free for you and your users. We'd really appreciate it if you'd support us (and show visitors they are browsing a secure site) by adding a link to Clef in your site footer!", "clef"); ?></p>
<div class="input-container">
<label for=""><?php _e("Support Clef in your footer", "clef"); ?></label>
<?php $form->getSection('support_clef')->getField('badge')->render(); ?>
</div>
<a href="#" class="show-support-html hide-if-no-js"><?php _e( 'I want to add the badge or link elsewhere', 'clef' ); ?></a>
<span class="hide-if-js"><b><?php _e( 'I want to add the badge or link elsewhere', 'clef' ); ?>:</b></span>
<div class="support-html-container hide-if-js">
<h4><?php _e( 'Copy this HTML where you want to add the badge', 'clef' ); ?></h4>
<textarea class="ajax-ignore"><?php echo esc_textarea( '<a href="https://bit.ly/wordpress-login-clef" class="clef-badge pretty">'.__( 'WordPress Login Protected by Clef', 'clef' ).'</a>'); ?></textarea>
<h4><?php _e( 'Copy this HTML where you want to add the link', 'clef' ); ?></h4>
<textarea class="ajax-ignore"><?php echo esc_textarea('<a href="https://bit.ly/wordpress-login-clef" class="clef-badge">'.__( 'WordPress Login Protected by Clef', 'clef' ).'</a>'); ?></textarea>
</div>
</div>
<div class="preview-container hide-if-no-js">
<div class="ftr-preview">
<h4><?php _e("Preview of your support", "clef"); ?></h4>
<a href="https://bit.ly/wordpress-login-clef" class="clef-badge pretty" ><?php _e("WordPress Login Protected by Clef", "clef"); ?></a>
<span class="hide-if-js">
<br /><?php _e( 'or', 'clef' ); ?><br />
<a href="https://bit.ly/wordpress-login-clef" class="clef-badge" ><?php _e("WordPress Login Protected by Clef", "clef"); ?></a>
</span>
</div>
</div>
</div>
<div id="invite-users-settings" class="settings-section"></div>
<?php include CLEF_TEMPLATE_PATH . 'pro/form.tpl.php'; ?>
<div class="clef-settings settings-section">
<div class="inputs-container">
<h3><?php _e("Clef API Settings", "clef"); ?></h3>
<p><?php _e("These keys connect your WordPress site to the Clef application you log in to. For more advanced settings, visit the <a href='http://getclef.com/developer'>Clef developer site</a>.", "clef"); ?></p>
<div class="input-container">
<label for=""><?php _e("Application ID", "clef"); ?></label>
<?php $form->getSection('clef_settings')->getField('app_id')->render(); ?>
</div>
<div class="input-container">
<label for=""><?php _e("Application Secret", "clef"); ?></label>
<?php $form->getSection('clef_settings')->getField('app_secret')->render(); ?>
</div>
<div class="input-container">
<label for=""><?php _e("Allow visitors to your site to register with Clef", "clef"); ?></label>
<?php $form->getSection('clef_settings')->getField('register')->render(); ?>
</div>
</div>
</div>
<?php submit_button(); ?>
</form>
</div>
<script id="form-template" type="text/template">
<h4><?php _e("Preview of your login form", "clef"); ?></h4>
<div name="loginform" id="loginform">
<p>
<label for="user_login"><?php _e("Username"); ?><br>
<input type="text" id="user_login" class="ajax-ignore input" value="" size="20"></label>
</p>
<p>
<label for="user_pass"><?php _e("Password"); ?><br>
<input type="text" id="user_pass" class="ajax-ignore input" value="" size="20"></label>
</p>
<div class="or-container">
<div style="position: relative">
<div style="border-bottom: 1px solid #EEE; width: 90%; margin: 0 5%; z-index: 1; top: 50%; position: absolute;"></div>
<h2 style="color: #666; margin: 0 auto 20px auto; padding: 3px 0; text-align:center; background: white; width: 20%; position:relative; z-index: 2;"><?php _e("or", "clef"); ?></h2>
</div>
</div>
<div class="clef-button" >
<img src="<?php echo CLEF_URL ?>assets/dist/img/button.png" alt="clef button">
</div>
<div class="clef-overlay">
<img src="<?php echo CLEF_URL ?>assets/dist/img/overlay.png" alt="clef overlay">
<div class="close-overlay overlay-text"><?php _e('log in with a password', "clef"); ?></div>
</div>
<p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" class="ajax-ignore" id="rememberme" value="forever"> <?php _e("Remember Me"); ?></label></p>
<p class="submit">
<input type="submit" id="wp-submit" class="ajax-ignore button button-primary button-large" value='<?php _e("Log In"); ?>'>
</p>
</div>
</script>

View File

@@ -0,0 +1,15 @@
<?php
if ($options['isNetworkSettings']) {
if ($options['isNetworkSettingsEnabled']) {
include CLEF_TEMPLATE_PATH . 'admin/multisite/network-enabled.tpl.php';
} else {
include CLEF_TEMPLATE_PATH . 'admin/multisite/network-disabled.tpl.php';
}
}
else if ($options['isNetworkSettingsEnabled']) {
if ($options['isUsingIndividualSettings']) {
include CLEF_TEMPLATE_PATH . 'admin/multisite/single-disabled.tpl.php';
} else {
include CLEF_TEMPLATE_PATH . 'admin/multisite/single-enabled.tpl.php';
}
}

View File

@@ -0,0 +1,11 @@
<form action="edit.php?action=clef_multisite" method="POST">
<div class="settings-section">
<div class="inputs-container">
<h2><?php _e('Enable Clef across the whole network', 'clef'); ?></h2>
<p><?php _e('If you would like to enable Clef across all sites on the network using the options you set here, click the button below.', 'clef'); ?></p>
<?php wp_nonce_field("clef_multisite"); ?>
<input type="hidden" name="enable" value="1">
<input type="submit" value="<?php _e('Use network settings everywhere', 'clef'); ?>" class="button-primary ajax-ignore">
</div>
</div>
</form>

View File

@@ -0,0 +1,29 @@
<div class="settings-section">
<form action="edit.php?action=clef_multisite" method="POST">
<div class="inputs-container">
<h2><?php _e('Disable network-wide settings', 'clef'); ?></h2>
<p><?php _e('Currently, you control Clef settings for all the sites in your network. If you disable network-wide settings, individual sites in the network will need to manage their own Clef settings.', 'clef'); ?></p>
<?php wp_nonce_field("clef_multisite"); ?>
<input type="hidden" name="disable" value="1">
<input type="submit" value="<?php _e('Disable network-wide settings', 'clef'); ?>" class="button-primary ajax-ignore">
</div>
<div class="inputs-container">
</div>
</form>
</div>
<form id="multisite-settings">
<div class="settings-section">
<h3><?php _e('Individual site network settings', 'clef'); ?></h3>
<div class="inputs-container">
<p><?php _e('You can let individual sites manage their own Clef configuration if you would like to customize how Clef works on each site.', 'clef') ?></p>
<?php wp_nonce_field(ClefNetworkAdmin::MULTISITE_SETTINGS_ACTION) ?>
<div class="input-container">
<input type="hidden" name="allow_override_form">
<label for="allow_override"><?php _e('Allow individual sites to manage settings', 'clef'); ?></label>
<input type="checkbox" name="allow_override" value="<?php echo $options['isSingleSiteSettingsAllowed'] ?>" <?php if ($options['isSingleSiteSettingsAllowed']) { ?> checked="checked" <?php } ?>>
</div>
</div>
</div>
</form>

View File

@@ -0,0 +1,11 @@
<form action="admin.php?page=clef&action=clef_multisite" method="POST">
<div class="settings-section">
<div class="inputs-container">
<h2><?php _e("You're overriding multi-site settings.", 'clef'); ?></h2>
<p><?php _e("You've decided to manage your own settings for Clef. To re-enabled the settings configured by your site's network administrator, please click the button below.", 'clef'); ?></p>
<?php wp_nonce_field("clef_multisite") ?>
<input type="submit" value="<?php _e('Use network settings', 'clef'); ?>" class="button-primary">
</div>
</div>
</form>

View File

@@ -0,0 +1,10 @@
<form action="admin.php?page=clef&action=clef_multisite" method="POST">
<div class="settings-section">
<div class="inputs-container">
<h2><?php _e('Clef is being managed by multi-site.', 'clef'); ?></h2>
<p><?php _e('Your Clef installation is currently managed by your network administrator. To use your own Clef settings, you can override the network-wide settings below.', 'clef'); ?></p>
<?php wp_nonce_field("clef_multisite") ?>
<input type="submit" value="<?php _e('Override network settings', 'clef'); ?>" class="button-primary">
</div>
</div>
</form>

View File

@@ -0,0 +1,25 @@
<div id="clef-settings-container">
<div class="message"><p></p></div>
<?php if ($options['isMultisite']) { ?>
<div id='clef-multisite-options'>
<?php include CLEF_TEMPLATE_PATH . 'admin/multisite.tpl.php'; ?>
</div>
<?php } ?>
<?php include CLEF_TEMPLATE_PATH . 'admin/tutorial.tpl.php'; ?>
<div id="clef-settings">
<?php include CLEF_TEMPLATE_PATH . 'admin/form.tpl.php'; ?>
</div>
</div>
<?php include CLEF_TEMPLATE_PATH . 'js-templates/invite.tpl.php'; ?>
<script type="text/javascript">
var app,
clefOptions = <?php echo json_encode($options); ?>;
jQuery(document).ready(function() {
app = new AppView(_.extend(ajaxSetOpt, clefOptions));
});
</script>

View File

@@ -0,0 +1,79 @@
<div id="clef-tutorial">
<div class="clef-tutorial-container">
<div class="sub intro connect setup">
<h1><?php _e("Clef makes logging into your site safer and easier. <br> It's <b>free</b>, and getting set up takes <b>30 seconds</b>.", "clef"); ?></h1>
<div class="next button button-hero button-primary center"><?php _e("Get Started", "clef"); ?></div>
<div class="quotes">
<blockquote>
"Passwords are <a class="highlight red" href="http://wordpress.com/security">the least secure part</a> of everything you do online."
<cite>— WordPress Security Team</cite>
</blockquote>
<blockquote>
"With Clef, the often painful process of logging into a site feels, admittedly, <a class="highlight green" href="http://bits.blogs.nytimes.com/2013/12/18/new-clef-plug-in-lets-you-forget-about-your-password/">a little bit magical."</a>
<cite>— The New York Times</cite>
</blockquote>
<blockquote>
"Passwordless login with Clef hits <a class="highlight orange" href="http://wptavern.com/password-free-login-with-clef-hits-all-the-high-notes">all the high notes."</a>
<cite>— WP Tavern</cite>
</blockquote>
</div>
<a href="#" class='skip done'><?php _e("Skip setup, I already have Clef API keys", "clef"); ?></a>
</div>
<div class="sub sync setup">
<div class="spinner-container">
<span class="spinner"></span>
<h2>loading</h2>
</div>
<iframe class="setup" src="" frameborder="0"></iframe>
</div>
<div class="sub invite setup">
<h1><?php _e("Want to invite your users to Clef?", "clef"); ?></h1>
<div class="invite-users-container"></div>
</div>
<div class="sub connect login">
<h1><?php _e("Connect your Clef account", "clef"); ?></h1>
<p><?php _e("To connect, click the button below and sync the Wave. Once you're connected, you'll be able to log in and out of your WordPress site with just your phone.", "clef"); ?></p>
<div class="button-wrapper">
<div id="clef-button-target"></div>
</div>
<h3><?php _e("Don't have the app? Let us text you the download link.", "clef"); ?></h3>
<iframe src="<?php echo CLEF_BASE ?>/iframes/text" frameborder="0"></iframe>
</div>
<div class="sub using-clef setup connect">
<h1><?php _e("3 tips for using Clef", "clef"); ?></h1>
<h3>1. <?php _e("Sync once, log in everywhere.", "clef"); ?></h3>
<p><?php _e("When you scan a Clef Wave, you'll be logged in to all of your sites on that computer. This means you don't have to keep scanning as you browse the web.", "clef"); ?></p>
<h3>2. <?php _e("Log out with your phone.", "clef"); ?></h3>
<p><?php _e("When you want to log out of your sites, click the logout button <b>on your phone</b>. This will log you out of all of your sites and can be done from anywhere (including after you walk away).", "clef"); ?></p>
<h3>3. <?php _e("Lose your device?", "clef"); ?></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.", "clef"); ?></p>
<div class="button button-primary button-hero next"><?php _e("Got it!", "clef"); ?></div>
</div>
<?php if (is_admin()) { ?>
<?php
echo ClefUtils::render_template('admin/waltz-prompt.tpl', array(
"next_href" => '#',
"next_text" => __("Go to Clef settings", "clef"),
"class" => "setup"
));
?>
<?php
echo ClefUtils::render_template('admin/waltz-prompt.tpl', array(
"next_href" => admin_url(),
"next_text" => __("Go to dashboard", "clef"),
"class" => "connect"
));
?>
<?php } ?>
</div>
</div>

View File

@@ -0,0 +1,13 @@
<div class="waltz <?php if (!empty($class)) echo $class; ?>">
<img src="<?php echo CLEF_URL . "assets/dist/img/waltz.png" ?>" alt="Waltz">
<div class="text">
<h1<?php _e(">Want to use Clef everywhere?", "clef"); ?></h1>
<p><?php _e("<a target='_blank' href='http://getwaltz.com'>Waltz</a> is a chrome extension that lets you log in to sites like Facebook, Gmail, and Twitter using Clef. It takes 5 seconds to install and will give you the full Clef experience.", "clef"); ?></p>
</div>
<div class="buttons">
<a class="button button-primary button-hero" href="http://getwaltz.com" target="_blank"><?php _e("Try Waltz", "clef"); ?></a>
<a href="<?php echo $next_href; ?>" class="button button-hero next"><?php echo $next_text; ?></a>
</div>
<?php wp_nonce_field(ClefAdmin::DISMISS_WALTZ_ACTION); ?>
</div>
<div class="clear"></div>