Verification Code

Hey guys, I’m working on email verification code function.

Using this to create verification code:


$model->verification_code = sha1(mt_rand(10000, 99999).time().$model->email);

public ation:





public function actionCancel($id)

	{		

		

		

		

		$model= Client::model()->findByAttributes(array(

		  'verification_code' => $id,

		));

		if ($model === null)

		   throw new CHttpException(404, 'Not found');

		else{ 

			$model->status = "Canceled";

			$model->save();	

		}

	}




I included the action in both public and admin access rules.

I’m using:

http://192.168..*/client/cancel/hash code

I’m getting

"Error 400

Your request is invalid."

What am I doing wrong?

PS: when I’m not passing an id into the action and just do echo test the function runs.

Figured out with the help -JG- in the chat that my url manager was killing the link thus it wouldnt reach it. Had to tweak the url manager a little and it worked.