Ip-Based Access Control

Hi,

I need to implement an IP-Based access control. Valid IP’s are given as regular expressions.

I also need to send a message to the user if his IP does not match the valid IP’s.

Can someone explain me how to do that in Yii (i’m relative new to it).

Thanks alot!

One of the options of access control is ‘ip’ (check the docs/google, I’ve seen it somewhere.) As for sending a message. Without knowing there email, the only way the ‘send’ a message would be Yii::app()->user->setFlash(). If you do have an email address, look at the contact form code, it should give you an idea on how to send one.