00785: Notify also when uploads take place

Summary: Notify also when uploads take place
Created: 2006-08-14 11:39
Status: InProgress
Category: Feature
From: ThomasP
Assigned: UpdateMe
Priority: 55555 5433
Version: 2.1.11
OS: Linux/Apache/4.4.2

Description: Currently notifications are only triggered by (successful) page edits. Remembering pmwiki as a collaboration tool, one would surely also want to be notified if a colleague adds or updates a file on the site. (Actually every change on the site may be relevant.)

Thus I would like pmwiki to do also notifications on successful uploads.

An improvement of the solution that follows below can be found in recipe NotifyOnUpload. ThomasP August 14, 2006, at 05:50 PM

Reviewing the script/notify.php, it seems the only things needed are an array $UploadFunctions similar to $EditFunctions, code similar to

if ($upresult == "success")
  foreach((array)$UploadFunctions as $fn) $fn($pagename,...);

in HandleUpload() in scripts/upload.php that is executed on sucessful upload, and the registering of an UploadNotify() function (defined similar as PostNotify()) as one upload function in scripts/notify.php:

$UploadFunctions[] = 'UploadNotify';

The last line could of course be made optional using a config switch.


See also

Other Notify PITS entries

  • PITS.00867 (exclude originator of the event from being notified)
  • PITS.00772 (Group.NotifyList (to work like Site.NotifyList))
  • PITS.00870 (notification mechanism should take page permissions into account)

This feature would be very helpful! --Hagan