• Any version of MySQL from the last few years will do. This was writtenusing MySQL V4.1.15.You'll also need a database and database user ready for your application to use.The tutorial will provide syntax for creating any necessary tables in MySQL.Additionally, to save time, we will be developing Criki using a PHP framework calledCakePHP. Download CakePHP by visitingCakeForge.organd downloading thelatest stable version. This tutorial was written using V1.1.13. For information aboutinstalling and configuring CakePHP, check out the tutorial series titled "Cook up Websites fast with CakePHP" (seeResources).
Section 2. Criki so far
At the end ofPart 4, you were given several items to complete. There was at leastone glaring security hole in the task management edit workflow. You were taskedwith finding a way to use wiki markup when writing task descriptions, withoutreproducing the wiki markup rendering code. And the tasks views contained usernames as text, which could have been made into links to the users' profiles. How didyou do?
Securing the task management edit workflow
There are two specific problems in the task management edit workflow to address.Alert code monkeys will have noticed them already. The first should be fairlyobvious. Consider this line from the tasks edit view in Listing 1.
Listing 1. Tasks edit view excerpt
<?phpif ($task['Task']['user_id'] == $user['id']) :echo $html->link('Edit','/tasks/edit/' . $task['Task']['id']);endif;?>
This displays the edit link for only the user to whom the task has been assigned.Now consider the task edit action in Listing 2.
Listing 2. Task edit action
function edit($id = null) {if(empty($this->data)) {if(!$id) {$this->Session->setFlash('Invalid id for Task');$this->redirect('/task/index');
Add a Comment