Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

notification mails

  • Loading branch information...
commit 68ef894250134bcd8eec98765592c6564bc7e759 1 parent fa8e5c7
Kate Arzamastseva authored July 18, 2011
17  inc/lang/en/uploadmail.txt
... ...
@@ -1,13 +1,14 @@
1 1
 A file was uploaded to your DokuWiki. Here are the details:
2 2
 
3  
-File        : @MEDIA@
4  
-Date        : @DATE@
5  
-Browser     : @BROWSER@
6  
-IP-Address  : @IPADDRESS@
7  
-Hostname    : @HOSTNAME@
8  
-Size        : @SIZE@
9  
-MIME Type   : @MIME@
10  
-User        : @USER@
  3
+File         : @MEDIA@
  4
+Old revision : @OLD@
  5
+Date         : @DATE@
  6
+Browser      : @BROWSER@
  7
+IP-Address   : @IPADDRESS@
  8
+Hostname     : @HOSTNAME@
  9
+Size         : @SIZE@
  10
+MIME Type    : @MIME@
  11
+User         : @USER@
11 12
 
12 13
 -- 
13 14
 This mail was generated by DokuWiki at
9  inc/media.php
@@ -398,7 +398,7 @@ function media_upload_finish($fn_tmp, $fn, $id, $imime, $overwrite, $move = 'mov
398 398
         // (Should normally chmod to $conf['fperm'] only if $conf['fperm'] is set.)
399 399
         chmod($fn, $conf['fmode']);
400 400
         msg($lang['uploadsucc'],1);
401  
-        media_notify($id,$fn,$imime);
  401
+        media_notify($id,$fn,$imime,$old);
402 402
         // add a log entry to the media changelog
403 403
         if ($REV){
404 404
             addMediaLogEntry($new, $id, DOKU_CHANGE_TYPE_REVERT, $lang['restored'], $REV);
@@ -485,7 +485,7 @@ function media_contentcheck($file,$mime){
485 485
  *
486 486
  * @author Andreas Gohr <andi@splitbrain.org>
487 487
  */
488  
-function media_notify($id,$file,$mime){
  488
+function media_notify($id,$file,$mime,$old_rev=false){
489 489
     global $lang;
490 490
     global $conf;
491 491
     global $INFO;
@@ -503,6 +503,11 @@ function media_notify($id,$file,$mime){
503 503
     $text = str_replace('@MIME@',$mime,$text);
504 504
     $text = str_replace('@MEDIA@',ml($id,'',true,'&',true),$text);
505 505
     $text = str_replace('@SIZE@',filesize_h(filesize($file)),$text);
  506
+    if ($old_rev) {
  507
+        $text = str_replace('@OLD@', ml($id, "rev=$old_rev", true, '&', true), $text);
  508
+    } else {
  509
+        $text = str_replace('@OLD@', '', $text);
  510
+    }
506 511
 
507 512
     if(empty($conf['mailprefix'])) {
508 513
         $subject = '['.$conf['title'].'] '.$lang['mail_upload'].' '.$id;

0 notes on commit 68ef894

Please sign in to comment.
Something went wrong with that request. Please try again.