Description

Small extension for Yii framework, providing an API for creating and validating an encrypted token that has a limited lifetime,
and also provides a filter to allow or deny execution of controller actions, depending on the validity of the token.

Usage

classArticleControllerextendsCController{publicfunctionfilters() {returnarray('ext.TimeBarredToken.TimeBarredTokenFilter + details','throwException'=>true,'message'=>'Access to this article denied!',);}/* This action shows you protected page */publicfunctionactionDetails() {$this->render('details');}/* This action generates link with token and should be accessible only for authorised users - usually only for you */publicfunctionactionMySecretLinkGenerator() {echoYii::app()->createUrl('article/details',array('token'=>Yii::app()->timeBarredToken->getToken(strtotime('21 december 2011 15:00'),3600)));}}