2

Assume I have a login page (http://www.my-website.com/login/) and I want to block all users which access to login page base on their IP address except my own IP address. Could you help me to solve this issue?

Thanks in advance!

4

1 に答える 1

5

コントローラ内:

public function login() {
    if ($this->request->clientIp() != 'Your IP address here') {
        throw new ForbiddenException();
    }

    ...
}
于 2013-01-29T05:11:06.970 に答える