Zen Cart Logo
Forums / Customization from the Admin / Can i hide admin menu to superuser?

Can i hide admin menu to superuser?

Views: 17,763

Results 1 to 9 of 9
27 May 2016, 11:43 PM
#1
sungmo avatar

sungmo

New Zenner

Join Date:
Jan 2010
Posts:
79
Plugin Contributions:
0

Can i hide admin menu to superuser?

I know there is admin profile for it.

However, some modules do not allow ordinary admin users to execute something because of security problem except superuser.

So I want to give employee superuser.

Is it possible not to show some admin menus to superuser like other admin users?

For example, i do not want to show "Configuration" menu to superuser.

Thanks

28 May 2016, 6:15 PM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,711
Plugin Contributions:
56

Re: Can i hide admin menu to superuser?

sungmo:

... some modules do not allow ordinary admin users to execute something because of security problem except superuser.

What modules would these be?

28 May 2016, 7:06 PM
#3
lat9 avatar

lat9

Administrator

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

Re: Can i hide admin menu to superuser?

swguy:

What modules would these be?
If a plugin is to be included in the admin menus, that plugin includes a file (normally in your admin's /includes/extra_datafiles folder) that contains a statement similar to:

define ('FILENAME_MY_PLUGIN', 'myplugin');

If the plugin's filename definition looks like:

define ('FILENAME_MY_PLUGIN', 'myplugin[B].php[/B]');

then that's why only superusers can access the plugin in Zen Cart 1.5.1. Simply remove that .php from the definition. I'm pretty sure that swguy submitted a change (for Zen Cart 1.5.4?) to enable those improperly-coded plugins to appear on the menu without change.

28 May 2016, 7:25 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,711
Plugin Contributions:
56

Re: Can i hide admin menu to superuser?

lat9:

I'm pretty sure that swguy submitted a change (for Zen Cart 1.5.4?) to enable those improperly-coded plugins to appear on the menu without change.

LOL I can't even remember my own changes anymore! :)
You are correct @lat9 - I made that change since there were so many plugins in the early days of 1.5 - including my own - which were not doing that step correctly.

28 May 2016, 8:38 PM
#5
sungmo avatar

sungmo

New Zenner

Join Date:
Jan 2010
Posts:
79
Plugin Contributions:
0

Re: Can i hide admin menu to superuser?

lat9:

If a plugin is to be included in the admin menus, that plugin includes a file (normally in your admin's /includes/extra_datafiles folder) that contains a statement similar to:

define ('FILENAME_MY_PLUGIN', 'myplugin');

> If the plugin's filename definition looks like:
> ```
define ('FILENAME_MY_PLUGIN', 'myplugin[B].php[/B]');

then that's why only superusers can access the plugin in Zen Cart 1.5.1. Simply remove that .php from the definition. I'm pretty sure that swguy submitted a change (for Zen Cart 1.5.4?) to enable those improperly-coded plugins to appear on the menu without change.

Thanks guys...

I am using Stock By Attribute (SBA) Stock Page Version 1.5.3

and I already checked the file in admin/extra_datafiles/products_with_attributes_stock.php

the file doesn't have ".php".

you can see that code at the below

define('FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK','products_with_attributes_stock');
define('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK', DB_PREFIX . 'products_with_attributes_stock');
define('FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK_SETUP','stock_by_attr_install');

and I can not use 2 functions which are number 1 and 2 in below image except superuser.

so I decided to edit superuser...

someone has any solution?

thanks

Attachment 16372

28 May 2016, 8:42 PM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,711
Plugin Contributions:
56

Re: Can i hide admin menu to superuser?

Maybe try posting to the SBA support thread?

*** Removed old SBA support thread ***

29 May 2016, 11:29 PM
#7
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Can i hide admin menu to superuser?

As stated at an SBA forum that has been a little busier, this is not an issue if the version that is currently available on github is used. Shortly instructions are to be added to that version and it posted to ZC as the last default ZC attribute type is now handled by SBA (upload of files). There certainly remains other "improvements" possible, but it appears significantly functional.

31 May 2016, 10:25 PM
#8
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,711
Plugin Contributions:
56

Re: Can i hide admin menu to superuser?

mc12345678:

As stated at an SBA forum that has been a little busier, ...

It might be worthwhile for you to link that thread from the README in your Github repo. It's hard to know which thread to use otherwise.

31 May 2016, 10:31 PM
#9
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Can i hide admin menu to superuser?

swguy:

It might be worthwhile for you to link that thread from the README in your Github repo. It's hard to know which thread to use otherwise.
Agree, only still not entirely sure because of the sorted history of the module what thread would actually be best. One that currently associates with an outdated version of ZC, one that implies that there is no SBA compatible with a newer version of ZC or scrap it all and start yet another...
Just yet another confusing aspect of the plugin...
Baby steps though I guess. :)