After upgrade - stop users from deleting images in user albums After upgrade - stop users from deleting images in user albums
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

After upgrade - stop users from deleting images in user albums

Started by CD69, March 08, 2006, 05:19:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CD69

I have complete the upgrade and have only one problem, users can still delete images in their albums even though I have the Allow users to retain control over their pics in public galleries set to no.

Also, the resizing isn't working. It's allowing pictures to be uploaded that are huge with a max of 550 px.

Joachim Müller

Post a link and non-admin test user account. Post your resizing options (all of them) as well.

CD69

Quote from: GauGau on March 08, 2006, 06:18:00 AM
Post a link and non-admin test user account. Post your resizing options (all of them) as well.

GauGau, this morning with fresh eye's I realized I didn't have the Max Aspect selected. The resize is working.

The user account still allows a registered user to Edit or delete pictures/albums and the pictures are linked to my forums. When they delete the pictures it leaves the dreaded red X box.

Allow users to retain control over their pics in public galleries is set to no

Here's the link you requested Testers Gallery

And thank you for your help!

Nibbler

That's not a public gallery, it's a user gallery. The config option does not apply to user galleries.

CD69

Nibbler,

I tried to use the code updates you gave me for 1.3.5 but the scripts changed in the new release. Is there any way to mirror the functionality in 1.4?

http://forum.coppermine-gallery.net/index.php?topic=22459.msg103003#msg103003


Nibbler


CD69

Quote from: Nibbler on March 08, 2006, 04:48:08 PM
The code is still there, might be in the theme system now.

I've looked at a ton of code and can't find it.

Any hints would be great......please

I would be more then happy to pay for the assitance

Nibbler

It's still there in displayimage.php


function html_picture_menu()
{
    global $lang_display_image_php, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $CONFIG;

    $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);
    $picmenu = '';

  if (false) { //(!($mime_content['content']=='image')) {
    $picmenu = <<<EOT
     <a href="#" onclick="return MM_openBrWindow('setplayer.php?={$mime_content['extension']}','Set_Player','scrollbars=no,toolbar=no,status=no,resizable=no')" class="admin_menu" >{$lang_display_image_php['set_player']}</a>
EOT;
  }

  if ((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) {
    $picmenu .= <<<EOT
     <a href="javascript:;" onclick="return MM_openBrWindow('picEditor.php?id={$CURRENT_PIC_DATA['pid']}','Crop_Picture','scrollbars=yes,toolbar=no,status=yes,resizable=yes')" class="admin_menu" >{$lang_display_image_php['crop_pic']}</a> <a href="editOnePic.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture"  class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture"  class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>
EOT;
  }

  return $picmenu;
}


and delete.php


    } else {
        $query = "SELECT {$CONFIG['TABLE_PICTURES']}.aid as aid, category, filepath, filename, owner_id FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND pid='$pid'";
        $result = cpg_db_query($query);
        if (!mysql_num_rows($result)) cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
        $pic = mysql_fetch_array($result);
        if (!($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__);
    }

CD69

Nibbler,

First thanks for sticking with me on this question, I'm receiving an error.

Parse error: parse error, unexpected '}' in /home/www/chitown-angler/2fish/displayimage.php on line 78

Wish I knew enough about PHP to figure this out but I'm a rookie.

Paver

Try this plugin out.  If it works, let me know and I'll release it on the plugin contributions board (and we can mark this thread as solved).

You'll need to revert your scripts back to before you modified them, of course.

edit: plugin deleted since it's been replaced by a new version.

CD69

Paver,

Thanks, I dropped an unzipped version of delete_control into the plugins directory and I still have the delete functions on my user account.

What am I doing wrong.

Also, I would like to pay you for your time once we wrap this up. Do you have a pay-pal account?

Nibbler

You need to install the plugin using pluginmgr.php. There is no need to unzip and upload, the plugin manager will do that for you.

http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#plugin_manager

CD69

Thanks Nibbler, I have it installed and working.....on some pages.

Displayimage was resovled and pictures can't be deleted there but there are a couple pages where a member can still delete their image's. When they go into "My Gallery" the delete button remains. And when you select edit it takes you to editpic.php and the deleting function remains on this page and on modifyalb.php.

Is it possible to have those pages resolved also.

Paver

Yes, I can add that to the other pages as well.  I was following Nibbler's original mod and assumed that worked fine so I didn't look farther.  I'll do a comprehensive scan now and add it to the plugin.

edit: Err... I was a bit over-optimistic.  I'll post once it's done, but I'm not sure when that will be.


CD69

Excellent, thank you for your work.

I expect to pay for the work, is there a general coppermine fund that I can also drop a couple bucks into?

Joachim Müller


Paver

I have released a hopefully complete version of the plugin on this thread:
http://forum.coppermine-gallery.net/index.php?topic=29116

I didn't see any delete functions on the modifyalb script, so I assume you mean that modifyalb has a button to editpics which is where the delete functions are.  Please let me know if this is correct.

I have tested things out and think I have covered all delete buttons & associated functions.  Here's the list:

  • index.php - Delete button for albums
  • displayimage.php - Delete button for the specific photo shown
  • editpics.php - Delete checkbox for each photo

CD69

Took it out for a test spin Paver and all I can say is thank you and excellent work. It was a pleasure doing business with you and I appreciate you communicating with me during the process keeping me up to speed on your progress. Because of your efforts I dropped a couple bucks off to Coppermine too.



I guess we can call this one solved.