[pmwiki-users] Upload Enhancement for file deletion

Waylan Limberg waylan at gmail.com
Wed Dec 14 11:34:02 CST 2005


On 12/14/05, Dan Weber <webmaster at drwhosting.net> wrote:
> Hi,
> This is my first attempt in writing a modification to PmWiki.
>
> I am always missing a way to delete uploaded files from a Wiki but there was
> no built-in function for it. I looked at the upload.php script and
> "borrowed" some code to create the attached script attachdel.php.
>
> If you use the (:newattachlist:) directive in a wiki page it will show a
> list of files like the (:attachlist:) does but it also adds a <del> link
> that allows you to delete a file (with confirmation). If you a change the
> Site.UploadQuickReference page to use (:newattachlist:) then you get this
> new functionality for every upload page.
>
> The changes are quite minimal and the cleanest would be if they could be
> included in the standard upload.php script. Maybe use a config variable
> $EnableUploadDelete to control it?
>
> Comments welcome!
>
Cool!

I would suggest putting this into a cookbook page in pmwiki.org. That
way everyone can easily find it and that's the conventional way to to
release add-ons to PmWiki. Then, if its popular, after any bugs and/or
oversights have been worked out, and Patrick sees fit, he may add it
to the core.

Now for a few questions: Is there a way to set permissions on who can
delete etc? And what if I only want to enable delete on some uploads
but not others on the same page? Or perhaps set different permissions
for different files etc? Basically, I'm not going to want just anyone
to be able to delete my files.

While tying the above questions it occurred to me that the attachlist
is generally only on the upload page which could have permissions set,
but then I realized that all someone has to do is add (:attachlist:)
into the wikitext of any page to get a list of attachments (go ahead,
try it in the sandbox). If that list includes the ability to delete
the files, that could make for an easy way for someone to sabotage
your site. Without proper security measures in place, I wouldn't feel
comfortable using this.

Btw, its possible some of my concerns are addressed, but the
attachment was garbled by gmail (its just garbled text in the main
body), so I have no way of really checking it out. That's were a
cookbook recipe would come in.

--
----
Waylan Limberg
waylan at gmail.com




More information about the pmwiki-users mailing list