Art and Limits

Society & Philosophy 7 Comments

My friend and I keep having these discussions (a.k.a. arguments) on and off every week and one off every week. Among the most interesting of these is about the boundaries of art.

It all started with the Danish cartoons. (please do read about it before you go ahead). While, my friend took the stance that cartoons were meant to ridicule a subject and must be taken as a joke and not seriously. And, any action against it will be a curtailment of freedom of art. Making the statement – ‘Art has no Limits’.

Read the rest of this entry »

Email verification using tokens – CakePHP

Web & Code 16 Comments

I recently wrote a code for an email verification system using cakephp. Well, before you use it there are few things. This is written by a cake noob so may not be the best there is. I have not written it as a general stand alone piece of code. So its need modifications for use. And I am a sucker when it comes to commenting and formatting my code so please dont mind. My thanks to Edward and the CakePhP Google Groups. And finally cake rocks!!!


Database Table

A basic user table with the following columns

id - primary key and auto increment
activate *

*columns with which we are concerned with

Controller code

class UsersController extends AppController {
var $name = 'Users';
var $helpers = array('Html', 'Form');
var $components = array('Email');
function register() {
if (!empty($this->data)) {
$this->User->data = $this->data;
//Create Token using form data and random number to ensure its unique and cannot be replicated
if ( $this->User->validates()) {
//Save all form data including the tokenhash
$ms='Click on the link below to complete registration ';
//create mail body
$this->Email->from = 'yourName <email>';
$this->Email->subject = 'Confirm Registration for Niwiki - reg.';
//send mail
$this->Session->setFlash('Please Check your email for validation Link');

Read the rest of this entry »

© 2009, Nikhil Hullur | Entries RSS Comments RSS