cruge / components / CrugeUiAccessControlFilter.php

<?php 
	/*	CrugeUiAccessControlFilter
		
		es una extension de CrugeAccessControlFilter (ver documentacion en esa clase base).
		
		esta clase difiere de CrugeAccessControlFilter en que aqui se le puede pasar
		la lista de actions a los cuales no se requiere una operacion para acceder a ellas.
	
		se usa excluisivamente en UiController, bajo esta configuracion:
				array('CrugeAccessControlFilter'
						,'publicActions'=>	
							array('registration','login','pwdrec'
							,'activationurl','ajaxgeneratenewpassword')
					),
			
		
		@author: Christian Salazar H. <christiansalazarh@gmail.com> @bluyell
	*/
	class CrugeUiAccessControlFilter extends CrugeAccessControlFilter {

		public $publicActions;
	
		public function init(){
			parent::init();
		}
	
		protected function preFilter($filterChain)
		{
			// si el action es alguno de los de la lista, permite el paso y deja de procesar
			// los demas filtros
			$currentActionName = Yii::app()->getController()->action->id;
			if(in_array($currentActionName,$this->publicActions)){
				return true;
			}
			else
			{
				parent::preFilter($filterChain);
			}
		}

		protected function postFilter($filterChain)
		{
		}
	}
?>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.