From: <var...@us...> - 2012-12-05 18:09:44
|
Revision: 8605 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8605&view=rev Author: vargenau Date: 2012-12-05 18:09:33 +0000 (Wed, 05 Dec 2012) Log Message: ----------- Consistent returns Modified Paths: -------------- trunk/lib/MailNotify.php Modified: trunk/lib/MailNotify.php =================================================================== --- trunk/lib/MailNotify.php 2012-12-05 15:36:45 UTC (rev 8604) +++ trunk/lib/MailNotify.php 2012-12-05 18:09:33 UTC (rev 8605) @@ -126,8 +126,6 @@ $userids = array(); foreach ($notify as $page => $users) { if (glob_match($page, $this->pagename)) { - - global $request; $curuser = $request->getUser(); $curusername = $curuser->UserName(); $curuserprefs = $curuser->getPreferences(); @@ -204,7 +202,7 @@ $emails = $this->emails; // Do not send if modification is from FusionForge admin if (FUSIONFORGE and ($this->fromId() == ADMIN_USER)) { - return; + return true; } if (!$notice) { $notice = _("PageChange Notification of %s"); @@ -338,7 +336,6 @@ */ function onChangePage(&$wikidb, &$wikitext, $version, &$meta) { - $result = true; if (!isa($GLOBALS['request'], 'MockRequest')) { $notify = $wikidb->get('notify'); /* Generate notification emails? */ @@ -348,11 +345,10 @@ // TODO: Should be used for ModeratePage and RSS2 Cloud xml-rpc also. $this->getPageChangeEmails($notify); if (!empty($this->emails)) { - $result = $this->sendPageChangeNotification($wikitext, $version, $meta); + $this->sendPageChangeNotification($wikitext, $version, $meta); } } } - return $result; } function onDeletePage(&$wikidb, $pagename) @@ -375,7 +371,6 @@ function onRenamePage(&$wikidb, $oldpage, $new_pagename) { - $result = true; if (!isa($GLOBALS['request'], 'MockRequest')) { $notify = $wikidb->get('notify'); if (!empty($notify) and is_array($notify)) { @@ -385,7 +380,7 @@ $current = $newpage->getCurrentRevision(); $meta = $current->_data; $this->pagename = $oldpage; - $result = $this->sendPageRenameNotification($new_pagename, $meta); + $this->sendPageRenameNotification($new_pagename, $meta); } } } @@ -397,8 +392,9 @@ */ function sendEmailConfirmation($email, $userid) { + global $request; $id = rand_ascii_readable(16); - $wikidb = $GLOBALS['request']->getDbh(); + $wikidb = $request->getDbh(); $data = $wikidb->get('ConfirmEmail'); while (!empty($data[$id])) { // id collision $id = rand_ascii_readable(16); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |