Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Redirect Admin User On Login Rate Topic   - - - - -

 
  • colleende
  • Member
  • Members
  • Join Date: 07-Nov 11
  • 45 posts

Posted 16 January 2018 - 04:04 AM #1

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19976 posts

Posted 16 January 2018 - 06:01 AM #2

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3376 posts

Posted 16 January 2018 - 07:47 AM #3

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.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • colleende
  • Member
  • Members
  • Join Date: 07-Nov 11
  • 45 posts

Posted 16 January 2018 - 03:46 PM #4

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19976 posts

Posted 17 January 2018 - 05:42 AM #5

You are welcome! :)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11442 posts

Posted 17 January 2018 - 11:12 PM #6

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3376 posts

Posted 18 January 2018 - 05:18 AM #7

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.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11442 posts

Posted 18 January 2018 - 03:18 PM #8

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.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.