Zen Cart Logo
Forums / Customization from the Admin / Why admin_level sets to '0' when creating new admins?

Why admin_level sets to '0' when creating new admins?

Locked

Views: 2,525

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
11 Apr 2009, 5:49 AM
#1
calixto avatar

calixto

New Zenner

Join Date:
Mar 2009
Posts:
30
Plugin Contributions:
0

Why admin_level sets to '0' when creating new admins?

Why after saving an admin enty its admin_level sets to '0'?

i do not see admin_level submitted by the form (it is kind of commented out)

thanks

Calixto

11 Apr 2009, 7:22 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Why admin_level sets to '0' when creating new admins?

That's because the admin-demo feature is presently disabled in the software.
In a future version there will be full admin security, allowing different permissions for different users. Until then, the demo option is disabled.

13 Apr 2009, 4:34 AM
#3
calixto avatar

calixto

New Zenner

Join Date:
Mar 2009
Posts:
30
Plugin Contributions:
0

Re: Why admin_level sets to '0' when creating new admins?

DrByte:

That's because the admin-demo feature is presently disabled in the software.
In a future version there will be full admin security, allowing different permissions for different users. Until then, the demo option is disabled.

I must be missing something very obvious, so I apologize.
Admin level = 0 stands for the no used Demo user.
My point is that while going into editing the admin list, and saving the result, zencart sets the admin_level to zero, which should not be done.
My poor PHP knowledge indicates that admin_level is not submited to the reloaded page, so the 'case save: option', having not received admin_level via POST, sets it to zero

look,
$admin_level = zen_db_prepare_input($_POST['admin_level']);
I added this line to force one
** $admin_level = 1;**

check edit_admin form code. In 1.3.8 admin_level is not posted

14 Apr 2009, 3:46 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: Why admin_level sets to '0' when creating new admins?

The admin_level field is not used in v1.3.8. Thus whether the value in the database for each user's admin_level is set to a 0 or a 1 doesn't make any difference.

14 Apr 2009, 4:04 AM
#5
calixto avatar

calixto

New Zenner

Join Date:
Mar 2009
Posts:
30
Plugin Contributions:
0

Re: Why admin_level sets to '0' when creating new admins?

thank you