Allow Access To Certain Pages

Hi,

I’m new to Yii, have just taken over the maintenance of a private site and need some help.

Apart from the login and register pages the site is all private and the correct user rules are already in place, redirecting guests back to these if they try to access anything else without logging in first.

My problem is that I also have an additional 4 information pages; cookies, terms and conditions etc etc that need to be accessible by everyone without logging in, how can I allow access to just these information pages?

Any help appreciated.

Thanks,

Matt

You should exclude them from protected list.

See how it’s done for login and register.

Thanks,

Didn’t solve the problem exactly but gave me a fresh idea how to address things. All working now, the site checks an array of the information page slugs in the PageController and allows the view action if the current page slug is in that array. More a hack than a solution but as this only applies to 4 reference pages this works for me.

Thanks for the pointer.

Matt

I am not sure its the correct way or not but I accomplished it with following condition in my /components/controller.php

if(Yii::app()->controller->id!= "site"){

               $this->redirect('/user/auth');//;


                } 

you can add controller->action ="your action" and that will allow that action

in controller page, config the accessrules function.