1 --- dokuwiki-2008-05-05/inc/common.php~ 2008-11-12 16:45:56.298338127 +0200
2 +++ dokuwiki-2008-05-05/inc/common.php 2008-11-12 16:56:31.711609436 +0200
9 + * Returns notify address for page $id
11 + * @param string $id The changed page
12 + * @param mixed $notify The address (string) or rules where to notify
14 + * @author Elan Ruusamäe <glen@delfi.ee>
16 +function notifyNS($id, $notify) {
17 + if (empty($notify)) {
21 + if (is_string($notify)) {
25 + // process $notify for pages
26 + foreach ($notify as $rule => $address) {
27 + if (preg_match('/'.$rule.'/ui',':'.$id)) {
36 * Sends a notify mail on page change
39 if(empty($conf['notify'])) return; //notify enabled?
40 if($conf['useacl'] && $_SERVER['REMOTE_USER'] && $minor) return; //skip minors
41 $text = rawLocale('mailtext');
42 - $to = $conf['notify'];
43 + $to = notifyNS($id, $conf['notify']);
45 }elseif($who == 'subscribers'){
46 if(!$conf['subscribers']) return; //subscribers enabled?
48 }elseif($who == 'register'){
49 if(empty($conf['registernotify'])) return;
50 $text = rawLocale('registermail');
51 - $to = $conf['registernotify'];
52 + $to = notifyNS($id, $conf['registernotify']);
55 return; //just to be safe
58 // decide if there is something to do
60 - if(empty($conf['notify'])) return; //notify enabled?
61 if($conf['useacl'] && $_SERVER['REMOTE_USER'] && $minor) return; //skip minors
62 + $to = notifyNS($id, $conf['notify']);
63 + if(empty($to)) return; //notify enabled?
64 $text = rawLocale('mailtext');
65 - $to = $conf['notify'];
67 }elseif($who == 'subscribers'){
68 if(!$conf['subscribers']) return; //subscribers enabled?
71 $text = rawLocale('subscribermail');
72 }elseif($who == 'register'){
73 - if(empty($conf['registernotify'])) return;
74 + $to = notifyNS($id, $conf['registernotify']);
75 + if(empty($to)) return;
76 $text = rawLocale('registermail');
77 - $to = $conf['registernotify'];
80 return; //just to be safe