Zen Cart Logo
Forums / Basic Configuration / Restrict admins to certain areas?

Restrict admins to certain areas?

Locked

Views: 5,086

Results 1 to 20 of 24
This thread is locked. New replies are disabled.
6 Oct 2006, 6:44 PM
#1
akoza avatar

akoza

New Zenner

Join Date:
Sep 2006
Posts:
28
Plugin Contributions:
0

Restrict admins to certain areas?

Is there a way to restrict an admin to certain areas of the site?

For example, I wish to allow someone access to the catalog area for product entry but not to other areas of the admin.

6 Oct 2006, 6:55 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Restrict admins to certain areas?

There is an Admin Profiles contribution in the Downloads area which adds support for this.

25 Jun 2007, 2:24 PM
#4
designsdirect avatar

designsdirect

New Zenner

Join Date:
Nov 2006
Posts:
12
Plugin Contributions:
0

Re: Restrict admins to certain areas?

Hi dudes

this solution is brilliant!

(make sure to install the sql patch through the admin area before uploading the files, from the link above!)

I have a question! is it posible to restrict specific products for admin uses as well?

25 Jun 2007, 3:58 PM
#5
designsdirect avatar

designsdirect

New Zenner

Join Date:
Nov 2006
Posts:
12
Plugin Contributions:
0

Re: Restrict admins to certain areas?

Is there any way of customizing the admin home page and provide a link on it for individual admin users?

Many thanks

Matt

http://www.designsdirect.co.uk

25 Jun 2007, 11:14 PM
#6
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Restrict admins to certain areas?

provide a link on it for individual admin users?

Interesting suggestion but may I ask where would the link points actually ? To which page would you link to point the URL for these specific admins from the index page exactly ?

26 Jun 2007, 8:23 AM
#7
designsdirect avatar

designsdirect

New Zenner

Join Date:
Nov 2006
Posts:
12
Plugin Contributions:
0

Re: Restrict admins to certain areas?

i would want a specific user to have acccess to only one product! so the link would be directed to a single product that they can update themselves!

when an admin user updates their product i have put a simple redirect code at the end of the denied.php file inside the admin profiles download!

<?php echo 'Sorry, your security clearance does not allow you to access this resource.<br /><br /> Please contact your site administrator if you believe this to be incorrect.<br /><br /> Sorry for any inconvenience.'; ?> <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/admin/index.html">

This is following an idea to create a recruitement agency website using the zen cart!

26 Jun 2007, 11:31 AM
#8
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Restrict admins to certain areas?

Hum ... I guess this request is really for implementing into the admin profiles MOD. If so, I believe the author of that MOD could help you out under her / his official topic.

However, I do have a little suggestion.

<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/admin/index.html">

replace with:

<?php echo zen_redirect(zen_href_link(FILENAME_DEFAULT, '', 'NONSSL')); ?>

:wink2:

26 Jun 2007, 11:40 AM
#9
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Restrict admins to certain areas?

designsdirect:

i would want a specific user to have acccess to only one product! so the link would be directed to a single product that they can update themselves!When an admin user logs in a session variable with their admin_id is created.

You could read this session variable to determine which user has logged in and use a conditional or switch statement in admin/index.php to present them with just a link to their product.

However, you would have to set each link up individually (or write more complex code to create database entries) and this would not prevent them from experimenting with the URL to access other products.

26 Jun 2007, 11:55 AM
#10
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Restrict admins to certain areas?

and this would not prevent them from experimenting with the URL to access other products.

There's a possibility of blocking this utility from unauthorized admin IDs actually. Perhaps I could create an individual restricted products MODs so that only authorized admins would be able to either, update or delete that particular product if needed.

26 Jun 2007, 12:38 PM
#11
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Restrict admins to certain areas?

TheOracle:

Perhaps I could create an individual restricted products MODs so that only authorized admins would be able to either, update or delete that particular product if needed.Many people have requested this but I have deliberately not included it in Admin Profiles. There are two reasons for this:

  1. the aim of AP to restrict access to admin functions not to individual categories or products
  2. other add-ons mod the product and category files and AP would thus clash with them if it went there too creating a maintenance and support nightmare
    Doing this as a stand-alone mod would therefore be a much better approach that avoids point 1 and minimises point 2. I look forward to seeing your mod when it's ready.
26 Jun 2007, 12:54 PM
#12
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Restrict admins to certain areas?

Doing this as a stand-alone mod would therefore be a much better approach that avoids point 1 and minimises point 2. I look forward to seeing your mod when it's ready.

Very well. Added this on my to-do list. I will probably integrate this feature into the additional products fields MOD (of course - if in demand from that topic). Otherwise, I could create it separately.

17 Aug 2007, 12:29 PM
#13
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

Re: Restrict admins to certain areas?

Hi there... this looks to be a great contribution, exactly what I was looking for. Great work and thank you.

Just a wee quick qu tho. When I downloaded the files and opened the install.txt in notepad it is all bunched up. Where there should have been a new paragraph instead there was a little box.

I had to go through the text and reorganise it myself.

While this isn't anyone else's problem and of course I'm grateful that the text was there at all but I just wondered if anyone else was having the same problem and if there was something i was doing that i could avoid doing that would stop this.

Its happened with the last few mods i've dl'd too.

thanks

17 Aug 2007, 12:35 PM
#14
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Restrict admins to certain areas?

barricades:

When I downloaded the files and opened the install.txt in notepad it is all bunched up. Where there should have been a new paragraph instead there was a little box.It's a problem that I have too and is about how the rather basic Notepad app handles end of line characters.

In my more recent mods I've stopped using .txt files and put all the installation notes in HTML files. When opening other people's and my older .txt based files I never use Notepad and instead use the vastly superior (and free) Notepad++.

17 Aug 2007, 1:16 PM
#15
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

Re: Restrict admins to certain areas?

Thanks for the prompt reply, i'll check that out.

One other wee question tho. If i replace the admin.php and english.php files as per the instructions then will they not get overwritten when i upgrade in the future?

Is that sort of "par for the course" in using mods, that you have to reinstall them everytime you upgrade? Could they not use the overrides system?

cheers

17 Aug 2007, 1:21 PM
#16
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Restrict admins to certain areas?

barricades:

If i replace the admin.php and english.php files as per the instructions then will they not get overwritten when i upgrade in the future?

Is that sort of "par for the course" in using mods, that you have to reinstall them everytime you upgrade? Could they not use the overrides system?Yes they are at risk of getting over-ridden, and the changes to them would need to be re-applied.

That is "par for the course" for mods that over-write admin files as the over-rides system does not yet extend to the admin area.

14 Dec 2007, 3:22 PM
#17
dodgegirl avatar

dodgegirl

New Zenner

Join Date:
Nov 2007
Posts:
8
Plugin Contributions:
0

Re: Restrict admins to certain areas?

In reading this thread, I see now where it says to install the sql before uploading the files. I did not do that, unfortunately. And I do not believe I have any prefix set up... I'm sorry! I am just learning all of this.

Now I have this error...
1146 Table 'mommamad_zc2.zen_admin_menu_headers' doesn't exist
in:
[select id from zen_admin_menu_headers where header = 'Configuration']
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

Is there any way of fixing this? Or will I have to resort to uninstalling ZC and reinstalling?

I am using 1.3.7.

Thank you so much for your help and advice. I certainly do appreciate all the work someone went through to create this mod, as it sounds like one of the best features I have seen so far!

14 Dec 2007, 3:29 PM
#18
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Restrict admins to certain areas?

DodgeGirl:

In reading this thread, I see now where it says to install the sql before uploading the files. I did not do that, unfortunately. And I do not believe I have any prefix set up... I'm sorry! I am just learning all of this.

Now I have this error...
1146 Table 'mommamad_zc2.zen_admin_menu_headers' doesn't exist
in:
[select id from zen_admin_menu_headers where header = 'Configuration']
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

Is there any way of fixing this? Or will I have to resort to uninstalling ZC and reinstalling?It shouldn't be necessary to re-install Zen Cart. Unfortunately though, you haven't told us whether or not you have now installed the SQL patch, so it's not possible to say whether your problem is due to the absence of the table named in your error message, or the misnaming of it. Without knowing this it's not possible to advise as to the best way forward. BTW, you are using a database prefix of "zen_".

14 Dec 2007, 3:36 PM
#19
dodgegirl avatar

dodgegirl

New Zenner

Join Date:
Nov 2007
Posts:
8
Plugin Contributions:
0

Re: Restrict admins to certain areas?

kuroi:

It shouldn't be necessary to re-install Zen Cart. Unfortunately though, you haven't told us whether or not you have now installed the SQL patch, so it's not possible to say whether your problem is due to the absence of the table named in your error message, or the misnaming of it. Without knowing this it's not possible to advise as to the best way forward.

Sorry. The SQL I installed was the install_admin_profiles. I did upload the files within "Extra - Patch Files" prior to installing the SQL as well as all of the Admin files.

"BTW, you are using a database prefix of "zen_". "

Ohh.. Thank you!! I am sure that will be very useful to know in the future! Appreciate you pointing that out.

14 Dec 2007, 5:10 PM
#20
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Restrict admins to certain areas?

DodgeGirl:

Sorry. The SQL I installed was the install_admin_profiles. I did upload the files within "Extra - Patch Files" prior to installing the SQL as well as all of the Admin files.

"BTW, you are using a database prefix of "zen_". "

Ohh.. Thank you!! I am sure that will be very useful to know in the future! Appreciate you pointing that out.In that case, I suspect that you have run the SQL without allowing for your database prefix. If you access your database directly using a tool such as phpMyAdmin, I suspect that you will see about four entries at the top of the table list with no prefix. If you edit their names to add "zen_" at the beginning, this will hopefully clear your problem.