Skip to content

Instantly share code, notes, and snippets.

@Tmw
Tmw / Users_controller.php
Created November 17, 2011 09:09
A overview of our usersController
<?php
class UsersController extends AppController
{
function index()
{
$userName = $this->Session->read('User.username');
if($userName == null){
$this->redirect(array('controller' => 'users', 'action' => 'login'));
}