Forums / General Questions / How to change the admin panel for new admins

How to change the admin panel for new admins

Views: 2,110

Results 1 to 8 of 8
5 Aug 2016, 9:08 AM
#1
kabko avatar

kabko

New Zenner

Join Date:
Dec 2009
Posts:
37
Plugin Contributions:
0

How to change the admin panel for new admins

Hi everyone.

I would like to ask how to change the admin main panel for newly added administrators.

I add new admin and I click the menus which I want him to use. For example I add admin, who can only access products, categories, IH...as he will be only adding new products to eshop. BUT, when he logs in with his admin login, he can see the main admin panel (admin dashboard - or whatever it is called), where he can see the statistics, new customers and new orders. I DONT WANT him to see all this, so I need to "hide" it somehow.

Can someone help me with this?

Thank you,
Peter

5 Aug 2016, 2:12 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How to change the admin panel for new admins

  1. Create an admin "Profile" for that user. Perhaps their role is "Sales" so call that profile "Sales". Then assign the appropriate permissions to that role/profile.
  2. Create/Edit the admin "User" and assign them the appropriate role.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

5 Aug 2016, 2:23 PM
#3
kabko avatar

kabko

New Zenner

Join Date:
Dec 2009
Posts:
37
Plugin Contributions:
0

Re: How to change the admin panel for new admins

DrByte:

  1. Create an admin "Profile" for that user. Perhaps their role is "Sales" so call that profile "Sales". Then assign the appropriate permissions to that role/profile.
  2. Create/Edit the admin "User" and assign them the appropriate role.

Thank you DrByte.

This is exactly how I created it, but Im talking about the main admin area - after the "User" has logged in. I dont want him to see the statistics, new customers, new orders..ect. It is the page you see right after you log in as admin ( http ://youreshop.com/youradminfolder/index.php )

5 Aug 2016, 4:10 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to change the admin panel for new admins

What was the source of your installation?
What is the upgrade history and method of your store?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

5 Aug 2016, 4:33 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: How to change the admin panel for new admins

kabko:

Thank you DrByte.

This is exactly how I created it, but Im talking about the main admin area - after the "User" has logged in. I dont want him to see the statistics, new customers, new orders..ect. It is the page you see right after you log in as admin ( http ://youreshop.com/youradminfolder/index.php )
There are (currently) no configuration elements that control the display (or non-display) of those front-page elements. The functionality that you seek will require custom programming.

5 Aug 2016, 5:37 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How to change the admin panel for new admins

True, there's no built-in way to suppress the display of home-page content based on profile.

But if it's really important to you, you can put conditions around the View/display code in /admin/index.php (or /admin/index_dashboard.php in v155).

There's some work going on to implement some level of restriction capability in v160 since those statistical/data blocks on the homepage are now driven by individual widgets with their own controllers.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Aug 2016, 2:51 AM
#7
kabko avatar

kabko

New Zenner

Join Date:
Dec 2009
Posts:
37
Plugin Contributions:
0

Re: How to change the admin panel for new admins

DrByte:

True, there's no built-in way to suppress the display of home-page content based on profile.

But if it's really important to you, you can put conditions around the View/display code in /admin/index.php (or /admin/index_dashboard.php in v155).

There's some work going on to implement some level of restriction capability in v160 since those statistical/data blocks on the homepage are now driven by individual widgets with their own controllers.

Thank you very much.

Could you please specify exactly what code should I insert in which exact file? I kow its something like " If the logged in admin is not the main admin, then do not show the dashboard", but I need the code for this...Im not that good in coding...

Thank you,
Peter

9 Aug 2016, 3:05 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How to change the admin panel for new admins

I haven't tested this and it's not the most elegant, but I'm pretty sure it'll "work":

/admin/index.php around line 48 you'll see this segment. Add the line in red:

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
 <?php
[B]if (zen_is_superuser() == false) die();[/B]


  $customers = $db->Execute("select count(*) as count from " . TABLE_CUSTOMERS);

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.