2

I have created 2 separate roles under Permission -> Roles.

1). For Employees 2). For Suppliers

I was wondering how to restrict Role: Employees to access admin area only from specific IP. We have static IP, which I believe would make this thing easier for us to restrict the admin access.

Or

Is there any other way to restrict some users from accessing admin area by IP only.

Please suggest if this is possible or not.

Thank you

  • anyone who could share their thoughts, perhaps someone encounter similar situation? – harry Jan 22 '15 at 17:36
3

What you could do is listen to the event admin_user_authenticate_after and check the ip if it matches.

This event is fired when a user is authenticated in the admin login process. It has the result passed in so you should be able to check the ip and if you want to limit the access simply set the result to false and thus the authentication will fail.

Mage::dispatchEvent('admin_user_authenticate_after', array(
    'username' => $username,
    'password' => $password,
    'user'     => $this,
    'result'   => $result,
));

A bit of a thought though sometimes people may want to do a bit of work from home and in this case they would not be able to use the site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.