doublenerd: Cake User Authentication.

This is my hack for simple user authentication:

include the line
require ("login.php"); in the /cake/index.php file.

Login.php


	Login
	

Login

login Name

Password

logout.php

'logged out','password'=>'','userlevel'=>'0','userid'=>0);
header('location: index.php');
DEFINE('USERNAME','');
DEFINE('USERLEVEL','');
DEFINE('USERPASSWORD','');
DEFINE('USERID','');
?>

Then, in a controller add a line like:


if (USERLEVEL<10)
{
$this->flash('You have insufficient privilages to perform this action','/');
return;
};

Author: PJ

Belfast based Comic Artist who won’t shut up on twitter.

One thought on “doublenerd: Cake User Authentication.”

Comments are closed.