Forums / All Other Contributions/Addons / Admin Profiles (for v1.3.x only!) Support Thread

Admin Profiles (for v1.3.x only!) Support Thread

Results 1 to 20 of 1,242
17 May 2006, 10:52
#1
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Admin Profiles (for v1.3.x only!) Support Thread

Admin Profiles is a user access control system for the Admin part of your site, allowing you to turn menus on and off and grant or disable access to specific Admin functions for each user.
17 May 2006, 11:03
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Re: Admin Profiles (for v1.3.x only!) Support Thread

duncanad:

I am still working with Admin Profiles v1.0 - only discovered last night that this has moved on to 1.0.3 and haven't upgraded yet. Before I do I would like to get to the bottom of a little problem I have. Actually it's not really a problem but the engineer in me doesn't just want it to work - it should work right!

I have added a new Product Type in Admin. I have done this by copying the product_general files as appropriate and renaming them product_property. The list of files is quite long but they include:

admin/product ---> admin/product_property
admin/includes/modules/product/collect_info.php ---> admin/includes/modules/product_property/collect_info.php
admin/includes/modules/product/preview_info.php ---> admin/includes/modules/product_property/preview_info.php
etc.

The following code is included in all the appropriate files

if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}

I also added the new product_property type to the product_types table in the database.

In Admin Catalog>Categories/Products when I tried to add a new product of the product_property type by choosing this from the product type drop down list I was re-directed to denied.php

I fixed this by inserting '2' into the 'header' field of the admin_files table for the product_property entry which had been added automatically.

In Admin Settings I then found a 'product property' tick box under the 'Catalog Menu' header. A tick in this box and everything worked fine.

My problem is that there are no tick boxes for any of the other product types e.g. product_music. Nor should there be since choosing the product type is just part of the process of setting up a new product, access to which is controlled by the 'Categories' tick box. So why, when I have added a new product type, does this just not work without an additional tick box being required for this product type and no other?

Not a big problem but, as I said, the engineer in me doesn't like it. Any ideas?

Thanks for raising this Alan, it's an interesting one. I have a few ideas, but will need a little time to get to the bottom of it. Some of the changes that went into 1.03 may affect this, but can only improve the situation (though I doubt that they would eliminate it), so there is no harm in upgrading.
18 May 2006, 06:49
#3
duncanad avatar

duncanad

Zen Follower

Join Date:
Nov 2004
Posts:
247
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

Just a quick update on the above as to the nature of the problem - not the cause unfortunately.

When I raised this with Peter yesterday I thought that what I was experiencing applied only to the new product type I had created and that it may have been something I had missed whilst copying and amending files to do this. However I now find that, when creating a new product in Admin, it is only 'Product-General' that can be accessed by default. If you want to create a 'Product-Music' or 'Product-Free Shipping' you will be redirected to denied.php and get the following message:

"Sorry, your security clearance does not allow you to access this resource.

Please contact your site administrator if you believe this to be incorrect.

Sorry for any inconvenience."

If you now look into the admin_files table you will find that a new entry has been created for the product type you were trying to create e.g. product_music. If you insert '2' in the 'header' column you will find a tick box available in Tools>Admin Settings>Edit Permissions under the 'Catalog Menu' header. A tick in the box will then allow you to create products of the appropriate type.

The way I think it is supposed to work is that ticking the 'categories' tick box should allow access to all categories and products create/amend/delete functions.

In the meantime just a minor inconvenience the first time a product of a particular type is created.

Regards,

Alan
19 May 2006, 22:36
#4
cbrantly avatar

cbrantly

New Zenner

Join Date:
May 2006
Posts:
3
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

Hi, I found your Admin Profiles module and it sounds like exactly what I need. However I am having a problem getting it installed. I have a fresh installation of Zen Cart with only the demo data loaded. I followed all of the instructions in install.txt, but now when I try to login to the admin page I get an "Illegal Access" error.

Here are some notes on what I have done:
1) I did not use a DB prefix
2) I couldn't understand step 1...where was I supposed to put "Import install_admin_profiles.sql"? Since I couldn't find where to type that, I connected to my zen db from the mysql command line client and ran each line from the install_admin_profiles.sql file.
3) Copied all Admin Profiles files to their proper location
4) Patched the 3 php files listed in step 3

I then tried to login using the same username/password that was working before installing Admin Profiles, but got the Illegal Access error. I appreciate any help you can offer!
19 May 2006, 22:52
#5
cbrantly avatar

cbrantly

New Zenner

Join Date:
May 2006
Posts:
3
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

Nevermind...ignore my previous message for now. Somehow when I downloaded ZenCart today I got version 1.27bugsecurityfix. I am not sure why the site was linking to an old version, but I'm going to try upgrading to 1.3.0.1 and see if that fixes my problem.

I still would like to know where I am supposed to issue the "Import install_admin_profiles.sql" command though.

Thanks!
19 May 2006, 23:38
#6
cbrantly avatar

cbrantly

New Zenner

Join Date:
May 2006
Posts:
3
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

I found the MySQL import tool in the Zen Cart Admin page. After upgrading my cart to 1.3.0.1 it appears to be working!
20 May 2006, 01:19
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Re: Admin Profiles (for v1.3.x only!) Support Thread

cbrantly:

I found the MySQL import tool in the Zen Cart Admin page. After upgrading my cart to 1.3.0.1 it appears to be working!

That's great news. I hope you find it the mod useful.
03 Jun 2006, 09:31
#8
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

To those interested the archived Admin Profiles support thread is located at
http://www.zen-cart.com/forum/showthread.php?t=33570
06 Jun 2006, 05:53
#9
ddeschn avatar

ddeschn

New Zenner

Join Date:
Oct 2005
Posts:
3
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

Hi Kuroi,

Great contribution to ZenCart - it is going to come in handy.

Here's my problem: I have installed the module as per your instructions and set up a user profile with access to one area of my site. When I log in with that profile username and password I still have full access to everything (where I should only have one menu option).

Thoughts?

-Donovan
08 Jun 2006, 18:25
#10
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Re: Admin Profiles (for v1.3.x only!) Support Thread

ddeschn:

Hi Kuroi,

Great contribution to ZenCart - it is going to come in handy.

Here's my problem: I have installed the module as per your instructions and set up a user profile with access to one area of my site. When I log in with that profile username and password I still have full access to everything (where I should only have one menu option).

Thoughts?

-Donovan
Yes that would be a bit worrying. What happens when you go back and look at the Admin Profile for that user, does it come up showing your restrictions? It's very unlikely that this will be the case, as a new user starts with no permissions, you have to deliberately add them in.

More likely IMO, is that this is a manifestation of the Zen Cart registers_globals bug. This means that although you log in as one user, Zen Cart switches you to be another. Here's an except from the archived support forum on this problem. Although your symptoms aren't quite the same, it would take something like this for the mod to break down so completely.

duncanad:

With register globals on the Admin identity changes when a new admin is created or an existing admin is deleted. This is not an Admin Profiles problem either. It happens on a virgin install of ZenCart without Admin Profiles installed. Admin Profiles just makes the problem very noticeable.

Setting register globals off solves the problem.

If you don't have access to your server's configuration files just add a .htaccess file to the root directory of your ZenCart with the following line of code:

php_value register_globals 0

Actually you should do this anyway since it makes your Zencart more secure. I always do this for live sites but didn't bother in this instance since I was 'only' testing. Wish I had now!

Hope this helps others from suffering the same grief.


Later in that thread I suggested a way of testing whether Admin is properly recognising you as the user you logged on. Here's an extract ...

kuroi:

Your suggestion that it would be helpful to show the identity of the currently logged in user is a good one, but not strictly about Admin Profiles. However, as it is clearly relevant to users of AP, what the hell, let's take a look.

When a user logs in a session variable is created containing his or her admin_ID. When they logoff, this variable is unset. So the easy and correct way to do what you ask, would be simply to create and unset a session variable containing the user's admin_name. Then we could simply display it anywhere we wanted. Yes. NOOOOO.

Unfortunately, due to the admin_ID registers_global BUG identified by Duncanad, this approach would show who logged on, but not who Admin thinks the current user is, due to its tendancy under some circumstances to just change user. Ouch.

A solution that showed who it actually thought the current user was would therefore highlight this unfortunate tendancy ... Let's do it anyway.

Go to the bottom of admin/includes/headers.php. Find the line that reads

<td class="headerBarContent" align="center"><b><?php echo date("r", time()) . 'GMT' . '[' . $_SERVER['REMOTE_ADDR'] . ' ]'; ?></b></td>

change "center" to "left" then insert the following line immediately afterwards

<td class="headerBarContent" align="center"><b><?php $result=$db->Execute("select admin_name from ".TABLE_ADMIN." where admin_id=".$_SESSION['admin_id']); echo $result->fields['admin_name']; ?></b></td>

Upload the file to your server and enjoy.
Knowing whether this does reveal a shift in your user identity would be useful to me for supporting Admin Profiles. If it doesn't, we'll have to try to think of some other possible causes.
08 Jun 2006, 22:02
#11
ddeschn avatar

ddeschn

New Zenner

Join Date:
Oct 2005
Posts:
3
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

That seems to have solved it. Somehow what was happening was it kept me logged in as my main administrator and didn't recognize the switch to the new user.

With that features off everything works great!

-Donovan
10 Jun 2006, 19:45
#12
breagan avatar

breagan

New Zenner

Join Date:
May 2006
Posts:
3
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

[QUOTE=kuroi]Admin Profiles is a user access control system for the Admin part of your site, allowing you to turn menus on and off and grant or disable access to specific Admin functions for each user.

Excellent contrib. Easy quick install! Just what the doctor ordered.
Thanks for the work.
BR
19 Jun 2006, 07:21
#13
jay_confiz avatar

jay_confiz

New Zenner

Join Date:
Jun 2006
Posts:
6
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

Hello, Im trying to install Admin Profiles on my site and when i have compleated the install i log onto my admin page and insted of the Configuration etc.. links it comes up with "illegal access" when i did a trial instal on my local server with the zencart version 1.3 it worked perfect, but when i install onto my live server i get that error.

can anyone please help me with this?
19 Jun 2006, 07:41
#14
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Re: Admin Profiles (for v1.3.x only!) Support Thread

This is a new one. Just it just say illegal access on an otherwise white screen, or is there more that might help us to understand where the message is coming from?
19 Jun 2006, 07:47
#15
jay_confiz avatar

jay_confiz

New Zenner

Join Date:
Jun 2006
Posts:
6
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

just a blank screan, i have uploaded a picture of what is happening.
19 Jun 2006, 07:59
#16
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Re: Admin Profiles (for v1.3.x only!) Support Thread

Which version of Zen Cart are you using?
19 Jun 2006, 08:06
#17
jay_confiz avatar

jay_confiz

New Zenner

Join Date:
Jun 2006
Posts:
6
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

I am using Version 1.2.7
19 Jun 2006, 08:10
#18
jay_confiz avatar

jay_confiz

New Zenner

Join Date:
Jun 2006
Posts:
6
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

Oh sorry, i just read that this was for version 1.3 + :P my bad
19 Jun 2006, 08:23
#19
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Re: Admin Profiles (for v1.3.x only!) Support Thread

There is an older add-in, Admin Levels, upon which Admin Profiles was based, that works with 1.2.7.

Also, don't underestimate the power of a not quite blank screen. Your screenshot confirmed that the problem was within your Zen Cart and showed how far Zen Cart had got before it threw the error. All useful info.
19 Jun 2006, 08:25
#20
jay_confiz avatar

jay_confiz

New Zenner

Join Date:
Jun 2006
Posts:
6
Plugin Contributions:
0

Re: Admin Profiles (for v1.3.x only!) Support Thread

yeah thanks for that. yeah i knew it was with zencart coz i had the admin levels working with a newer version of zencart :) any ideas on why it would be doing this though?