forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 upgrading => Topic started by: CD69 on March 08, 2006, 05:19:52 am

Title: After upgrade - stop users from deleting images in user albums
Post by: CD69 on March 08, 2006, 05:19:52 am
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.
Title: Re: After upgrade - Allow users to retain control over their pics in public gall
Post by: Joachim Müller 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.
Title: Re: After upgrade - Allow users to retain control over their pics in public gall
Post by: CD69 on March 08, 2006, 01:16:51 pm
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 (http://www.chitown-angler.com/2fish/index.php?cat=10223)

And thank you for your help!
Title: Re: After upgrade - Allow users to retain control over their pics in public gallerie
Post by: Nibbler on March 08, 2006, 01:58:17 pm
That's not a public gallery, it's a user gallery. The config option does not apply to user galleries.
Title: Re: After upgrade - Allow users to retain control over their pics in public gallery
Post by: CD69 on March 08, 2006, 04:42:01 pm
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

Title: Re: After upgrade - Allow users to retain control over their pics in public gallerie
Post by: Nibbler on March 08, 2006, 04:48:08 pm
The code is still there, might be in the theme system now.
Title: Re: After upgrade - Allow users to retain control over their pics in public gallerie
Post by: CD69 on March 09, 2006, 02:09:50 am
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
Title: Re: After upgrade - stop users from deleting images in user albums
Post by: Nibbler 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__);
    }
Title: Re: After upgrade - stop users from deleting images in user albums
Post by: CD69 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.
Title: Re: After upgrade - stop users from deleting images in user albums
Post by: Paver 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.
Title: Re: After upgrade - stop users from deleting images in user albums
Post by: CD69 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?
Title: Re: After upgrade - stop users from deleting images in user albums
Post by: Nibbler 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
Title: Re: After upgrade - stop users from deleting images in user albums
Post by: CD69 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.
Title: Re: After upgrade - stop users from deleting images in user albums
Post by: Paver 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.

Title: Re: After upgrade - stop users from deleting images in user albums
Post by: CD69 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?
Title: Re: After upgrade - stop users from deleting images in user albums
Post by: Joachim Müller on March 12, 2006, 01:07:12 pm
We need your help (http://forum.coppermine-gallery.net/index.php?topic=14227.0)
Title: Re: After upgrade - stop users from deleting images in user albums
Post by: Paver 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:
Title: Re: After upgrade - stop users from deleting images in user albums
Post by: CD69 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.