Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Bug Reports / [Duplicate] Admin Profiles Not Updating

[Duplicate] Admin Profiles Not Updating

Locked

Started by caffeitalia on 25 Jan 2012, 1:43 PM · Views: 2,752

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
25 Jan 2012, 1:43 PM
#1
caffeitalia avatar

caffeitalia

New Zenner

Join Date:
Jan 2012
Location:
London / Roma
Posts:
31
Plugin Contributions:
0

[Duplicate] Admin Profiles Not Updating

Hi,

Just experimenting with zen cart 1.5.

I have set up several test zen cart websites and all seem to have the same problem.

I am unable to update or change an Admin's Profile setting.

For example, I create a new (Restricted) profile and assign rights to said profile.
I create a new Admin User.
I assign the new Admin User to the (Restricted) Admin profile.
I (Super User) log out.
I log in with (Restricted) Admin user account.

All is great. But I made a mistake in the restrictions.
I log out as the (Restricted) Admin User.

I log in as the Super User.
I edit the (Restricted) Admin Profiles permissions.
I click 'Update'
I am returned to the Admin dashboard (assuming everything is okay)
I log out from Super User and back in as (Restricted) User.

No changes have taken place???
Have I done something wrong?
There are no error messages, no errors in my cache folder etc.
**
Is this my fault? or a bug?**

This is a clean install of v1.5, not an upgrade.
Add-ons:
Categories Dressing
Easy Populate v4

Reverting back to the 'Classic' template does not fix the issue.

Hosting Details:
Server OS: Linux 2.6.18-274.12.1.el5
Database: MySQL 5.1.56-log
PHP Version: 5.3.8 (Zend: 2.3.0)
PHP Memory Limit: 64M
PHP Safe Mode: Off
PHP File Uploads: On
Max Size: 32M
POST Max Size: 32M
Database Data Size: 543 kB

25 Jan 2012, 2:15 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Duplicate] Admin Profiles Not Updating

Edit the file:
/admin/profiles.php

and add the code in RED:

  case 'update_name':
    if (trim($_POST['profile-name']) == '') {
      $messageStack->add_session(ERROR_INVALID_PROFILE_NAME, 'error');
      zen_redirect(zen_href_link(FILENAME_PROFILES));
    }
    zen_update_profile_name($profile, $_POST['profile-name']);

Does this correct the problem that you are having? :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Jan 2012, 3:54 PM
#3
caffeitalia avatar

caffeitalia

New Zenner

Join Date:
Jan 2012
Location:
London / Roma
Posts:
31
Plugin Contributions:
0

Re: [Duplicate] Admin Profiles Not Updating

Hi,

I added the suggested code block, so it now is ```php
case 'update':
zen_remove_profile_permits($profile);
zen_insert_pages_into_profile($profile, $_POST['p']);
$messageStack->add_session(SUCCESS_PROFILE_UPDATED, 'success');
zen_redirect(zen_href_link(FILENAME_PROFILES));
break;
case 'update_name':
if (trim($_POST['profile-name']) == '') {
$messageStack->add_session(ERROR_INVALID_PROFILE_NAME, 'error');
zen_redirect(zen_href_link(FILENAME_PROFILES));
}
zen_update_profile_name($profile, $_POST['profile-name']);
$messageStack->add_session(SUCCESS_PROFILE_NAME_UPDATED, 'success');
zen_redirect(zen_href_link(FILENAME_PROFILES));
break;
case 'rename':
default: // if no specific action requested prepare the listing data
$profileList = zen_get_profiles(TRUE);
break;


Saved, uploaded, sadly no change. It still does not save the profile edits :cry:

I mean, it's no major problem. The work around is to delete the 'restricted' profile and recreate it.

I will set up another Zen Cart site on another webspace and see if the problem persists. WLYK ASAP
25 Jan 2012, 4:10 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Duplicate] Admin Profiles Not Updating

/admin/profiles.php
For the error you are having, go to around line 199:

  <form id="profileBoxes" name="profileBoxes" action="<?php echo zen_href_link(FILENAME_PROFILES) ?>" method="post">

and replace that line with:

  <?php echo zen_draw_form('profileBoxes', FILENAME_PROFILES, 'action=insert') ?>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Jan 2012, 4:32 PM
#5
caffeitalia avatar

caffeitalia

New Zenner

Join Date:
Jan 2012
Location:
London / Roma
Posts:
31
Plugin Contributions:
0

Re: [Duplicate] Admin Profiles Not Updating

:clap:
All good
Thank you!
:clap: