Skip to content

Instantly share code, notes, and snippets.

@ceeram
Last active December 15, 2015 02:58
Show Gist options
  • Save ceeram/5190495 to your computer and use it in GitHub Desktop.
Save ceeram/5190495 to your computer and use it in GitHub Desktop.
<?php $user = $this->Session->read('Auth.User');?>
<?php if (!$user) : ?>
<?php echo $this->Form->create('User', array('novalidate' => true, 'url' => array('controller' => 'users', 'action' => 'login', 'plugin' => false, 'admin' => false)));?>
<?php echo $this->Form->input('username');?>
<?php echo $this->Form->input('password');?>
<?php echo $this->Form->end('Login');?>
<?php else : ?>
<?php echo $this->Html->link('Logout', array('admin' => false, 'plugin' => false, 'controller' => 'users', 'action' => 'logout'));?>
<?php endif;?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment