In app_controller.php beforeFilter() add this
<?php
function beforeFilter() {
        if (isset($this->params['prefix'])  &&  $this->params['prefix'] ==
'admin') {
                $allowedIPList = array('127.0.0.1'); //List of allowed ip
                $ip = $this->RequestHandler->getClientIP();
                if (!in_array($ip,$allowedIPList)) {
                        $this->redirect('/');
                        exit;
                }
        }
}
?>

On Nov 12, 12:01 pm, K3 <[email protected]> wrote:
> Hi,
> i have enabled admin routing to my website. I just configured
> everything on the production server, but i want add some additional
> security layer. I want to allow access to admin section only from
> couple IP addresses. How can i do this?

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.


Reply via email to