Add a tick box option in single file upload form Add a tick box option in single file upload form
 

News:

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

Main Menu

Add a tick box option in single file upload form

Started by COS@RIN, January 29, 2006, 08:29:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

COS@RIN

Hi folks.

Hope someone can help with this.

I am using Coppermine for a simple galley of Cats available for adoption within a site for a local cat rescue centre.

The administrators (Staff of Cat Centre) can add details of cats that have arrived at the centre and ready for re-homing. However sometimes an image may not be available. For this reason I am looking for a solution to do the following.

In the single image upload form there is the File Browse input field......this is great and should stay.

I would like to add a "Select This Option If No Picture Is Available" tick box. The parameter of this tick box would be set to the URL of a pre-created "Awaiting Image" picture residing on the same server, so the gallery would use the following image instead.

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F82.110.105.18%2Fcatsprotectioncardiff.org.uk%2F%255Cimages%2Fgallery%2Fno-pic%2Fcpc-no-current-pic.jpg&hash=62368efb90d26b2f7160534566b9dbc9b03772ec)

http://82.110.105.18/catsprotectioncardiff.org.uk/\images/gallery/no-pic/cpc-no-current-pic.jpg

I guess it would work in the same manner as the URL upload feature, but have a pre-set value for the tick box.

Obviously there may be problems if the staff member entered a value in the Browse File field and checked the tick box. This would simply be avoided by necessary training.

Can anyone advise me how to add this tick box to the upload single file form.

Test login details are:
Username: Test
Password: Test

Login page found here: http://82.110.105.18/catsprotectioncardiff.org.uk/adopt/login.php

The current form can be found at http://82.110.105.18/catsprotectioncardiff.org.uk/adopt/upload.php


I really hope someone can help as this will really help this charity get maximum exposure for the animals they help.

Thank You In Advance

Cos@rin


Joachim Müller

edit upload.php, find<input type="file" name="$name" size="40" class="listbox">and replace with<input type="file" name="$name" size="40" class="listbox" value="path/to/local/cpc-no-current-pic.jpg">This will require training and every user of the staff to have the cpc-no-current-pic.jpg stored in exactly the same place locally on their PCs.

However, you have a major flaw in your setup: you have made every user an admin and only removed the admin menu entries for them. People who know their way around in coppermine can easily gain access to your site. I have used your test user account (which is in effect an admin account) to create another admin account named "GauGau" (for proof-of-concept, it's safe to delete it) and used the admin account I created as backdoor to make the Test user account a non-admin registered user. This was needed to close the security whole you have opened. I understand that it may be tempting to use security by obscurity and just remove admin controls from the admin's sight, but that's not a clever idea imo, your site is prone to be hacked in no time. I understand that you need moderator capabilities for the cat shelter staff to accomplish what you're up to, while coppermine doesn't have moderator capabilities yet, so you used the "hidden admin" setup.

P.S. I would consider upgrading to cpg1.4.3 anyway, as it has the option for users to retain control over pics they uploaded to public albums, which is all you need imo.