summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorKate Arzamastseva <pshns@ukr.net>2011-07-18 13:47:16 +0300
committerKate Arzamastseva <pshns@ukr.net>2011-07-18 13:47:16 +0300
commit68ef894250134bcd8eec98765592c6564bc7e759 (patch)
tree797552b5ea43831b310e5f7b4ec301fdb41e5aca /inc
parentfa8e5c7713944541c907aea2b81c6a44382a15f0 (diff)
downloadrpg-68ef894250134bcd8eec98765592c6564bc7e759.tar.gz
rpg-68ef894250134bcd8eec98765592c6564bc7e759.tar.bz2
notification mails
Diffstat (limited to 'inc')
-rw-r--r--inc/lang/en/uploadmail.txt17
-rw-r--r--inc/media.php9
2 files changed, 16 insertions, 10 deletions
diff --git a/inc/lang/en/uploadmail.txt b/inc/lang/en/uploadmail.txt
index 6fa196730..932a1b704 100644
--- a/inc/lang/en/uploadmail.txt
+++ b/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
diff --git a/inc/media.php b/inc/media.php
index 141ba8c2c..76d25acd6 100644
--- a/inc/media.php
+++ b/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;