Skip to content

Instantly share code, notes, and snippets.

@AndrewSepic
Created August 4, 2020 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewSepic/e24376780881de781b61f01d041f0cdc to your computer and use it in GitHub Desktop.
Save AndrewSepic/e24376780881de781b61f01d041f0cdc to your computer and use it in GitHub Desktop.
<?php
//Check that the user is logged in/ has been verified and has cookies set
if ( isset( $_COOKIE['isAuthorized'] ) ){
$current_user = $_COOKIE['clientName'];
echo '<p>Welcome ' . $current_user . ' | <a class="mboLogOut" href="#">Logout</a></p>';
?>
<script>
jQuery( document ).ready(function( $ ) {
$('a.mboLogOut').on('click', function(){
Cookies.remove('isAuthorized');
Cookies.remove('clientName');
location.reload();
})
});
</script>
<?php
}
else {
?><h3 class="login-leadin">Login with your MindBody email to access Classes on Demand</h3>
<form name="mbologinform" id="mbologin" action="<?php echo site_url(); ?>/mindbody-auth" method="post">
<p class="login-email">
<input type="text" name="email" id="mbo_email" class="input" value="" placeholder="Email" size="30" autocomplete="off">
</p>
<p class="login-submit">
<input type="submit" name="submit" id="submit" class="button button-primary" value="Log In">
</p>
<a href="https://company.mindbodyonline.com"><img src="<?php echo get_stylesheet_directory_uri();?>/images/MB-powered-by-logo-primary-radiance-@2x.png" alt="Powered by Mindbody"/></a>
</form>
<?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment