How To Redirect Admin User On Login

Hi,

I have different admin user groups set up with different privileges. One of the user groups can basically only add orders via admin - they don't have any other permissions. So when someone in this group logs in, I would like to redirect them right to the Add Order page (dispatch=order_management.new). Can someone please assist me with how to make a modification to make this redirect happen automatically for just this user group? I cannot find an addon that serves this purpose and allows different redirects based on admin user group.

Thank you!

Colleen

Hi,

I have different admin user groups set up with different privileges. One of the user groups can basically only add orders via admin - they don't have any other permissions. So when someone in this group logs in, I would like to redirect them right to the Add Order page (dispatch=order_management.new). Can someone please assist me with how to make a modification to make this redirect happen automatically for just this user group? I cannot find an addon that serves this purpose and allows different redirects based on admin user group.

Thank you!

Colleen

You can use the login_user_post hook in the fn_login_user function (app/functions/fn.users.php) to make this action

Hi,

I have different admin user groups set up with different privileges. One of the user groups can basically only add orders via admin - they don't have any other permissions. So when someone in this group logs in, I would like to redirect them right to the Add Order page (dispatch=order_management.new). Can someone please assist me with how to make a modification to make this redirect happen automatically for just this user group? I cannot find an addon that serves this purpose and allows different redirects based on admin user group.

Thank you!

Colleen

Hello Colleen!

Please also do not forget about the AREA == 'A' condition so that you will not affect login for customers. Admin usergroups are defined in the $auth['usergroup_ids'] array.

Thank you both very much! Between both of your suggestions, I have it working perfectly now! I appreciate your help.

You are welcome! :)

Hello Colleen!

Please also do not forget about the AREA == 'A' condition so that you will not affect login for customers. Admin usergroups are defined in the $auth['usergroup_ids'] array.

Aren't usergroup_id's distinct and Admin usergroups are also distinct from customer usergroups? So not sure why a condition for AREA would be required (though it won't hurt) for a specific usergroup_id.

Aren't usergroup_id's distinct and Admin usergroups are also distinct from customer usergroups? So not sure why a condition for AREA would be required (though it won't hurt) for a specific usergroup_id.

This condition is not required at the storefront, so why should it run there? I think that there should be less code that is not executed.

This condition is not required at the storefront, so why should it run there? I think that there should be less code that is not executed.


Exactly my point. So no need to check for area.