Linked from subscription
It appears this is now included in DokuWiki 2009-02-14 (which confused me after upgrading, cos I initially thought the upgrade had broken subscriptions! subscriber_addresslist in inc/common.php so that the second parameter is true (the logic is inverted compared to the old workaround below). |
|---|
You may wish to avoid sending emails to the author of the change, if the author is subscribed. Because- of course the author already knows that he/she made a change. I submit the below code change in order to work around this issue. It may be desirable to add a config flag for this setting. Possibly something each individual user can toggle for him/herself. At this point, it is on for everyone. ~Sherri W (www.start.ofitall.com).
/**
* Return a string with the email addresses of all the
* users subscribed to a page
*
* @param string $id Page id.
* @param boolean $exclude_current_user Indicates whether to skip the currently logged in user. To prevent email of your OWN changes to you.
*
* @author Steven Danz <steven-danz@kc.rr.com>
* @author (Workaround to skip current user) Sherri Wheeler (www.start.ofitall.com)
*/
function subscriber_addresslist($id, $exclude_current_user=false){
global $conf;
global $auth;
global $USERINFO;
$emails = '';
if (!$conf['subscribers']) return;
$mlist = array();
$file=metaFN($id,'.mlist');
if (@file_exists($file)) {
$mlist = file($file);
}
foreach ($mlist as $who) {
$who = rtrim($who);
$info = $auth->getUserData($who);
$level = auth_aclcheck($id,$who,$info['grps']);
if( $exclude_current_user && ($info['mail'] == $USERINFO['mail']) ){
continue;
}
if ($level >= AUTH_READ) {
if (strcasecmp($info['mail'],$conf['notify']) != 0) {
if (empty($emails)) {
$emails = $info['mail'];
} else {
$emails = "$emails,".$info['mail'];
}
}
}
}
return $emails;
}
... $bcc = subscriber_addresslist($id, true); // Exclude current user (author of the changes). ...