forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: jules_b on March 28, 2006, 02:29:58 pm

Title: You don't have permission to access this page - editing pic info
Post by: jules_b on March 28, 2006, 02:29:58 pm
Hi,

I'm using version 1.4.4 with the phpBB bridge. Everything's working lovely apart from this probem:

Members of the Registered group are unable to edit picture titles and descriptions in User Galleries after the photos have been uploaded.

User clicks on their album and clicks on an individual picture. Clicks EDIT FILE INFORMATION and can enter the information. Clicks on APPLY MODIFICATIONS and receives the following error: You don't have permission to access this page.

Same user is able to edit titles and description information by clicking on EDIT FILES next to the album.

I saw this thread but the line causing problems is not commented out in my editpics.php so it can't be that.

http://forum.coppermine-gallery.net/index.php?topic=17802.0

The gallery is at:

http://www.orionmountaineering.com/cpg144/

Grateful for any suggestions.

Jules.

Title: Re: You don't have permission to access this page - editing pic info
Post by: kyle1745 on April 01, 2006, 01:03:30 am
I am also having the same issue.  I checked the file in link jules_b posted and the line the ref to comment out is not commented in mine.

Any ideas?
Title: Re: You don't have permission to access this page - editing pic info
Post by: ernesto99 on April 02, 2006, 01:25:49 pm
I have the same problem but ....

the following setting has effect on this error :
Allow users to retain control over their pics in public galleries

If changed to "yes" the user can edit the file.
Title: Re: You don't have permission to access this page - editing pic info
Post by: Nibbler on April 02, 2006, 03:11:26 pm
Bug is likely here in editOnePic.php

Code: [Select]
    $result = cpg_db_query("SELECT p.* FROM {$CONFIG['TABLE_PICTURES']} AS p, {$CONFIG['TABLE_ALBUMS']} AS a WHERE a.aid = p.aid AND pid = '$pid'");
    if (!mysql_num_rows($result)) cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
    $pic = mysql_fetch_array($result);
    mysql_free_result($result);

    if (!(GALLERY_ADMIN_MODE || $pic['category'] == FIRST_USER_CAT + USER_ID || ($CONFIG['users_can_edit_pics'] && $pic['owner_id'] == USER_ID)) || !USER_ID) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

The query does not retrieve the category, so the test below fails.

Try changing the p.* to *
Title: Re: You don't have permission to access this page - editing pic info
Post by: kyle1745 on April 02, 2006, 06:31:00 pm
From what I can tell this corrects the issue.  Thank you I will have some more users test.
Title: Re: You don't have permission to access this page - editing pic info
Post by: OutKa5t on April 27, 2006, 03:53:04 pm
This fix does indeed cure the problem.

Thanks
Title: Re: You don't have permission to access this page - editing pic info
Post by: Nibbler on May 17, 2006, 06:12:44 pm
Fixed as of svn revision 3032.