>>9514751
//Reserve exclamations to identify hash - first/last names
add_filter('insert_user_meta', function ($meta, $user, $update)
{
if ($update)
{
if (strpos($_POST['first_name'], "!") !== false)
{
wp_die(sprintf(__('<strong>ERROR</strong>: Exclamation points are reserved to identify SHA3 and DES hashes. .') , $username, wp_get_referer()));
}
if (strpos($_POST['last_name'], "!") !== false)
{
wp_die(sprintf(__('<strong>ERROR</strong>: Exclamation points are reserved to identify SHA3 and DES hashes. .') , $username, wp_get_referer()));
}
}
return $meta;
}
, 10, 3);
//edit login text
add_filter('gettext', 'sha3_text');
add_filter('ngettext', 'sha3_text');
function sha3_text($translated)
{
$translated = str_ireplace('Username', 'Secure SignOn', $translated);
return $translated;
}
//add usage info to footer
add_action('login_footer', 'sha3_footer');
function sha3_footer()
{
echo '<div id="login"><p id="nav">For Secure SignOn usage, visit .</p></div>';
}
//disable registration bp
function my_disable_bp_registration() {
remove_action( 'bp_init', 'bp_core_wpsignup_redirect' );
remove_action( 'bp_screens', 'bp_core_screen_signup' );
}
add_action( 'bp_loaded', 'my_disable_bp_registration' );
add_filter( 'bp_get_signup_page', "firmasite_redirect_bp_signup_page");
function firmasite_redirect_bp_signup_page($page ){
return bp_get_root_domain() . '/wp-login.php?action=register';
}
//disallow editing of bp name field since
function bpfr_hide_profile_field_group( $retval ) {
if ( bp_is_active( 'xprofile' ) ) :
// hide profile group/field to all except admin
if ( !is_super_admin() ) {
//exlude fields, separated by comma
$retval['exclude_fields'] = '1';
//exlude groups, separated by comma
$retval['exclude_groups'] = '1';
}
return $retval;
endif;
}
add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );
sha3-secure-signon.js
/**
*/
jQuery(document).ready(function() {
jQuery('#user_login').attr('placeholder', 'User#Passphrase');
jQuery('#user_email').attr('placeholder', 'User Email');
jQuery('#user_pass').attr('placeholder', 'Site Password');
var checked_val = "null";
jQuery(".no_option").on("click", function() {
if (jQuery(this).val() == checked_val) {
jQuery('input[name=hash][value=null]').prop("checked", true);
checked_val = "null";
} else {
checked_val = jQuery(this).val();
jQuery('input[name=hash][value=null]').propRemove("checked");
}
});
});