forum.coppermine-gallery.net
Support => cpg1.3.x Support => Older/other versions => cpg1.3 Permissions & Access Rights => Topic started by: CD69 on October 05, 2005, 08:16:01 pm
-
I upgraded to 1.3.5 today hoping I would find a way to stop registered users from being able to delete images. I want to protect all images once they are uploaded onto my server and allow Admin only to delete images.
Is there any way to remove the delete button for everyone but Admin's?
-
Unless there's a mod for it, I don't think that's possible in 1.35. It is a feature in the upcoming 1.4x, however. But 1.4x comes with no support at the present time.
Dennis
-
Thank you for replying so quick Dennis. This functionality exists in the new release (1.4) that I can download here?
-
Yes, but, as I mentioned there is currently no support for 1.4x.
If you go ahead with it, make sure you do a versioncheck and enable view link to devel CVS in the version check page. Then update all files. There have been a lot of recent changes to files in 1.4.
Dennis
-
What you are requesting is not available in 1.4. What you need to do is remove the button from the interface for regular users:
displayimage.php:
find
function html_picture_menu($id)
{
global $lang_display_image_php;
return <<<EOT
<a href="#" onClick="return MM_openBrWindow('picEditor.php?id=$id','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=$id&what=picture" class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id=$id&what=picture" class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>
EOT;
}
change to
function html_picture_menu($id)
{
global $lang_display_image_php;
$ret = "<a href=\"#\" onClick=\"return MM_openBrWindow('picEditor.php?id=$id','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=$id&what=picture\" class=\"admin_menu\">{$lang_display_image_php['edit_pic']}</a>";
if (GALLERY_ADMIN_MODE) $ret .= "<a href=\"delete.php?id=$id&what=picture\" class=\"admin_menu\" onclick=\"return confirm('{$lang_display_image_php['confirm_del']}'); return false; \">{$lang_display_image_php['del_pic']}</a>";
return $ret;
}
And then to stop the deletion if the url is manually entered, find in delete.php
} else {
$query = "SELECT {$CONFIG['TABLE_PICTURES']}.aid as aid, category, filepath, filename FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND pid='$pid'";
$result = 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) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
}
and replace with simply this:
} else {
cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
}
-
What you are requesting is not available in 1.4. What you need to do is remove the button from the interface for regular users:
I stand corrected, Nibbler.
I thought that's what the Config/Allow users to retain control over their pics in public galleries feature did in 1.4x
Dennis
-
That's a switch to toggle the new option of user control over pics in public galleries. It doesn't affect the pre-existing ability for users to delete pics from their own user gallery.
-
That's a switch to toggle the new option of user control over pics in public galleries. It doesn't affect the pre-existing ability for users to delete pics from their own user gallery.
Thanks Nibbler,
Now I know.
Dennis
-
Nibbler, thank you very much, you have solved a huge proble for me!
-
Everything has worked perfectly, it's very cool when that happens!
Here's where I push my luck a little ;)
How do I remove the Crop and Rotate option from everyone but the admins.