Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: After upgrade - stop users from deleting images in user albums  (Read 12946 times)

0 Members and 1 Guest are viewing this topic.

CD69

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56

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.
« Last Edit: March 14, 2006, 03:34:29 am by Paver »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de

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

CD69

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56

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!
Logged

Nibbler

  • Guest

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

CD69

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56

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

Logged

Nibbler

  • Guest

The code is still there, might be in the theme system now.
Logged

CD69

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56

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
« Last Edit: March 09, 2006, 03:41:50 am by CD69 »
Logged

Nibbler

  • Guest
Re: After upgrade - stop users from deleting images in user albums
« Reply #7 on: March 09, 2006, 02:18:10 pm »

It's still there in displayimage.php

Code: [Select]
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

Code: [Select]
    } 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__);
    }
Logged

CD69

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: After upgrade - stop users from deleting images in user albums
« Reply #8 on: March 09, 2006, 06:54:59 pm »

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.
« Last Edit: March 10, 2006, 03:25:58 am by CD69 »
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Paul Van Rompay
Re: After upgrade - stop users from deleting images in user albums
« Reply #9 on: March 10, 2006, 11:34:32 pm »

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.
« Last Edit: March 13, 2006, 08:20:08 pm by Paver »
Logged

CD69

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: After upgrade - stop users from deleting images in user albums
« Reply #10 on: March 11, 2006, 03:11:35 am »

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?
Logged

Nibbler

  • Guest
Re: After upgrade - stop users from deleting images in user albums
« Reply #11 on: March 11, 2006, 03:15:09 am »

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
Logged

CD69

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: After upgrade - stop users from deleting images in user albums
« Reply #12 on: March 11, 2006, 03:52:38 am »

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.
« Last Edit: March 11, 2006, 04:03:39 am by CD69 »
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Paul Van Rompay
Re: After upgrade - stop users from deleting images in user albums
« Reply #13 on: March 11, 2006, 04:50:56 am »

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.

« Last Edit: March 11, 2006, 07:51:50 am by Paver »
Logged

CD69

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: After upgrade - stop users from deleting images in user albums
« Reply #14 on: March 11, 2006, 03:30:17 pm »

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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Paul Van Rompay
Re: After upgrade - stop users from deleting images in user albums
« Reply #16 on: March 13, 2006, 08:33:42 pm »

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
Logged

CD69

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: After upgrade - stop users from deleting images in user albums
« Reply #17 on: March 14, 2006, 03:23:48 am »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.