O'Reilly logo

CakePHP 1.3 Application Development Cookbook by Mariano Iglesias

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building and running a shell

In this recipe, we will learn how to build and run a custom shell, which will ask for a username and a password, and add the given account to a list of user accounts. Based on the system created in the recipe Setting up a basic authentication system from Chapter 1, Authentication, this shell is a great help when looking to create test accounts.

Getting ready

To go through this recipe we need an authentication system. Follow the entire recipe Setting up a basic authentication system from Authentication chapter.

How to do it...

Create a file named user.php and place it in your app/vendors/shells folder, with the following contents:

<?php App::import('Core', 'Security'); class UserShell extends Shell { public $uses = array('User'); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required