Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

notification mails

  • Loading branch information...
commit 68ef894250134bcd8eec98765592c6564bc7e759 1 parent fa8e5c7
@akate akate authored
Showing with 16 additions and 10 deletions.
  1. +9 −8 inc/lang/en/uploadmail.txt
  2. +7 −2 inc/media.php
View
17 inc/lang/en/uploadmail.txt
@@ -1,13 +1,14 @@
A file was uploaded to your DokuWiki. Here are the details:
-File : @MEDIA@
-Date : @DATE@
-Browser : @BROWSER@
-IP-Address : @IPADDRESS@
-Hostname : @HOSTNAME@
-Size : @SIZE@
-MIME Type : @MIME@
-User : @USER@
+File : @MEDIA@
+Old revision : @OLD@
+Date : @DATE@
+Browser : @BROWSER@
+IP-Address : @IPADDRESS@
+Hostname : @HOSTNAME@
+Size : @SIZE@
+MIME Type : @MIME@
+User : @USER@
--
This mail was generated by DokuWiki at
View
9 inc/media.php
@@ -398,7 +398,7 @@ function media_upload_finish($fn_tmp, $fn, $id, $imime, $overwrite, $move = 'mov
// (Should normally chmod to $conf['fperm'] only if $conf['fperm'] is set.)
chmod($fn, $conf['fmode']);
msg($lang['uploadsucc'],1);
- media_notify($id,$fn,$imime);
+ media_notify($id,$fn,$imime,$old);
// add a log entry to the media changelog
if ($REV){
addMediaLogEntry($new, $id, DOKU_CHANGE_TYPE_REVERT, $lang['restored'], $REV);
@@ -485,7 +485,7 @@ function media_contentcheck($file,$mime){
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function media_notify($id,$file,$mime){
+function media_notify($id,$file,$mime,$old_rev=false){
global $lang;
global $conf;
global $INFO;
@@ -503,6 +503,11 @@ function media_notify($id,$file,$mime){
$text = str_replace('@MIME@',$mime,$text);
$text = str_replace('@MEDIA@',ml($id,'',true,'&',true),$text);
$text = str_replace('@SIZE@',filesize_h(filesize($file)),$text);
+ if ($old_rev) {
+ $text = str_replace('@OLD@', ml($id, "rev=$old_rev", true, '&', true), $text);
+ } else {
+ $text = str_replace('@OLD@', '', $text);
+ }
if(empty($conf['mailprefix'])) {
$subject = '['.$conf['title'].'] '.$lang['mail_upload'].' '.$id;
Please sign in to comment.
Something went wrong with that request. Please try again.