Commit graph

127 commits

Author SHA1 Message Date
Chad Horohoe
966ecbaace (bug 17804) Make EmailNotification members protected 2009-06-25 00:41:29 +00:00
Brion Vibber
74016b7565 Move wfDebug() call about use of PHP mail() function to _before_ we mess around with warning/error reporting.
Previously, a failure to open the debug log file for writing would end up getting reported as a failure of mail delivery, even though we were successful.
It'll now fail silently (as it should) and won't interfere with the actual mail() call's error reporting.
2009-05-18 19:08:53 +00:00
Ilmari Karonen
72addd0bc8 fix regression from r47927 2009-04-20 23:14:58 +00:00
Niklas Laxström
8233b77030 * Don't use wgLang for dates in emails 2009-03-20 06:11:04 +00:00
Roan Kattouw
3241ebcbcc (bug 10172) Move setting the "changed since last visit" flags out of the job queue:
* Move up the UPDATE query on wl_notificationtimestamp up to before scheduling the EnotifyNotifyJob
* Move up the SELECT query fetching the users to be notified to before the UPDATE, and use its result for a more efficient UPDATE
* Pass actuallyNotifyOnPageChange() and the EnotifyNotifyJob an array of user IDs
* Add UserArray::newFromIDs()
2009-03-02 12:15:28 +00:00
Tim Starling
b45af1125c Added basic support for Wietse Venema's taint feature. Fixed a few instances of shoddy code that it turned up, no actual vulnerabilities yet. 2009-02-04 09:10:32 +00:00
Aaron Schulz
5dee7c5b43 Avoid slave lag on $title->getLatestRevID() 2009-01-24 18:37:52 +00:00
Aaron Schulz
fff4fe4c52 Hurry up and commit db op before doing mailing op to the users to notify 2009-01-24 18:35:13 +00:00
Jack Phoenix
9d67504d76 tweak UserMailer.php documentation. $replyto must be a MailAddress object and not a string or otherwise you'll get fatal errors like this: Fatal error: Call to a member function toString() on a non-object in ../includes/UserMailer.php on line 142 2009-01-19 18:55:14 +00:00
Aryeh Gregor
6cce173ce5 Fix typo in r43155
Pointed out by zocky on IRC.
2009-01-18 18:48:16 +00:00
Aaron Schulz
d473f63e50 Remove old comment 2009-01-03 21:34:44 +00:00
Aaron Schulz
b18384211d (bug 16429) "nominornewtalk" should not trigger e-mail notifications 2009-01-02 21:32:00 +00:00
Brion Vibber
97f77b9b1a Revert r44702, r44703, r44704 (wfInvoke and UserMailer refactor based on it) and r44715, r44721 (cleanup thereof)
As Tim notes, the weird callback setup in $wgHooks isn't really something we want to replicate or ever rely on ever again, as PHP's native callback syntax already handles things fine and is more consistent (and used extensively in the rest of MediaWiki).
May be other remaining issues with the refactor on top of bugs already discovered, but if it's going to be refactored to use callbacks it should be done using regular callbacks.
2008-12-23 18:08:43 +00:00
Alexandre Emsenhuber
a3cbeaeefd * Short circuit EmailNotification::notify() to not call EmailNotification::commonMessageKeys() if there're no users to notify. This is a hack to work arround the following exception:
A database query syntax error has occurred.
The last attempted database query was:
"SELECT gu_id, lu_wiki, gu_salt, gu_password,gu_auth_token, gu_locked,gu_hidden,gu_registration,gu_email,gu_email_authenticated FROM `parsertest_globaluser` LEFT OUTER JOIN `parsertest_localuser` ON gu_name=lu_name AND lu_wiki='test2wiki-parsertest_' WHERE gu_name='127.0.0.1'"
from within function "Database::safeQuery".
MySQL returned error "1146: Table 'centralauth.parsertest_globaluser' doesn't exist (127.0.0.1)"
* Whitespaces fixes
2008-12-17 17:27:43 +00:00
Niklas Laxström
a9beb0adab * Shut this up 2008-12-17 14:07:07 +00:00
David McCabe
43c9235283 UserMailer bigtime refactor. Please test. 2008-12-17 07:08:16 +00:00
David McCabe
64d53b6569 Revert r44386; depends on wfInvoke, also reverted. 2008-12-10 06:40:05 +00:00
David McCabe
cbafadf8d6 Refactored UserMailer.php. Please let me know if this breaks anything. 2008-12-10 06:02:14 +00:00
Siebrand Mazeland
eed9351741 As discussed with Aaron on irc. Remove "@param bool $wgEnotifUseRealName true will use real name instead of username" altogether. It is not a parameter, so it should not be there. The setting is documented in DefaultSettings.php. 2008-11-03 22:33:18 +00:00
Siebrand Mazeland
2651d131ad Update documentation as pointed out by Aaron. Fix on r43155. 2008-11-03 22:26:58 +00:00
Siebrand Mazeland
a8553af5d0 Add missing global $wgEnotifUseRealName. Fix for undefined variable notice in r43155. 2008-11-03 22:22:46 +00:00
Siebrand Mazeland
7ccff4543c (bug 15068) Added $wgEnotifUseRealName, which allows UserMailer to send out e-mails based on the user's real name if one is set. Defaults to false (use the username). Patch by ^demon (Chad Horohoe). Per suggestion of brion. 2008-11-03 21:31:47 +00:00
Aaron Schulz
e03787afd9 Make getTimestampFromId() need a title. Avoids some secondary lookups and orphans revs will be overlooked. 2008-10-30 10:04:30 +00:00
Aaron Schulz
05e2726ec8 Stop watchlist links from hoping around from bold to non-bold 2008-10-09 03:41:29 +00:00
David McCabe
fd2031a752 Use PHP-5 private members. 2008-09-26 06:01:57 +00:00
Greg Sabino Mullane
5f2042e3fa Duplicate code 2008-09-18 15:19:44 +00:00
Roan Kattouw
83922fa645 Revert part of r40107 (Revert r40042 because of regressions). The changes to UserMailer.php had nothing to do with that bug. 2008-08-27 21:15:42 +00:00
Brion Vibber
2b5f7032ec Revert r40042 "* In Article::replaceSection(), actually return null when $section is bogus. Used this in my half-complete and now kind of abandoned attempt at rewriting EditPage.php"
This causes regression bug 15340 -- null-edits to a section destroy the rest of the page.
2008-08-27 21:12:44 +00:00
Roan Kattouw
323c3a6e71 * In Article::replaceSection(), actually return null when $section is bogus. Used this in my half-complete and now kind of abandoned attempt at rewriting EditPage.php
* In UserMailer::send(), allow the caller to override the Content-type header so people can send multipart messages if they really want to. Using this in an extension I'm developing
2008-08-26 20:07:53 +00:00
Brion Vibber
f8625ed29d * (bug 15055) Talk page notifications no longer attempt to send mail when
user's e-mail address is invalid or unconfirmed
2008-08-06 23:43:17 +00:00
Brion Vibber
10a39c7e78 * (bug 13376) Use $wgPasswordSender, not $wgEmergencyContact, as return
address for page update notification mails.

Note that $wgEmergencyContact is now not currently in active use, but could
in theory be used for some kinds of failure notifications or to provide to
users to contact in case of failure, which I think was its original intention.
Certainly it's silly to throw an "emergency" contact on auto-sent mails!

There's also a $wgNoReplyAddress, which is currently used to add a Reply-To
header on notification mails. WTF? :)

We should probably refactor all this address crap...
2008-08-01 16:38:15 +00:00
Brion Vibber
bb3faf9d9b Revert r37490, 37493 for now -- 'NotifyOnPageChangeComplete hook added'
The hook seems a bit odd; it triggers on some of the composes, but not all. There's another loop right after this one.
Also, there's no need to pass objects as references here.
2008-07-10 17:02:39 +00:00
Krzysztof Krzyzaniak
a8e647332b NotifyOnPageChangeComplete hook added 2008-07-10 11:10:48 +00:00
Brion Vibber
bbe8578150 Revert the rest of r37393 -- appears to be debugging stuff accidentally committed 2008-07-09 17:49:51 +00:00
Daniel Kinzler
438f6d2925 improved integration into category bar. Note: options is not functional until SkinJoinCategoryLinks hook is implemented (merge pending) 2008-07-09 15:05:25 +00:00
Alexandre Emsenhuber
ab89e683a4 * Fixed some Doxygen warnings
* Removed unused global declaration of $wgOut in AjaxFunctions.php
2008-06-27 10:24:00 +00:00
Krzysztof Krzyzaniak
9a747796bb $to could be array, replaced by $dest variable 2008-05-26 09:48:52 +00:00
Brion Vibber
a4ffac4063 Revert r35178 and normalize User's getID() and setID() methods to prettier getId() and setId()
This doesn't accomplish anything, of course, but if you're going to run around changing them, at least make em prettier eh? :)
2008-05-22 16:39:43 +00:00
Aaron Schulz
ae54dbbb3d *The function is User::getID() not getId() 2008-05-22 14:57:07 +00:00
Aaron Schulz
2cf12c973d * Make enotif job use user ID rather than name for users. Fallback to name for anons and for old job rows (B/C). This makes it rename safe.
* User->getID() already returns an integer
* Use != rather than <>, as it looks clearer
* Do not add "updated since" to users for their own edits
* Actually check $wgShowUpdatedMarker properly. It is it's own setting.
2008-05-17 23:34:28 +00:00
Aryeh Gregor
67d8295570 Make sure to use table prefixes correctly. Thanks to siebrand for reporting the bug. 2008-04-15 14:35:18 +00:00
Tim Starling
41d4882681 In User:
* Defer load of groups data
* Introduce newFromRow()/loadFromRow() to allow bulk loading of user objects from a result set
* Hook email and email authentication save/load to allow CentralAuth to provide a global email address
* Defer save of user data after confirmEmail() and invalidateEmail(). Caller must now also call saveSettings(). This reduces the master query count in some code paths.

Elsewhere:
* Introduce UserArray class, for bulk loading of user objects. Immediately useful in email notification, potentially useful for proposed user alias feature.
* In Special:Confirmemail, remove useless handling for impossible false return from confirmEmail()/invalidateEmail().
2008-04-15 09:04:45 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Aryeh Gregor
7faf44098f (bug 13562) Misspelled option $wgUserNotifedOnAllChanges changed to $wgUserNotifiedOnAllChanges 2008-04-02 00:45:15 +00:00
Greg Sabino Mullane
b5d183702f Don't call composeCommonMailtext() until we are sure we need to. 2008-03-21 00:39:32 +00:00
Brion Vibber
3ddc44c0aa * (bug 11567) Fix error checking for PEAR::Mail. UserMailer::send() now returns
true-or-WikiError, which seems to be the calling convention expected by half
  its callers already
2008-02-13 05:05:53 +00:00
Brion Vibber
345c9c948e * (bug 12327) Comma in username no longer disrupts mail headers 2008-01-22 03:52:14 +00:00
Nick Jenkins
3e5443d74d Minor tweak to prevent an E_STRICT warning:
"Object of class MailAddress to string conversion in includes/UserMailer.php on line 112"
(It seems a bit silly of PHP to give this warning when the class has a __toString method,
 but adding an explicit toString() call is easy enough)
2007-10-11 07:04:59 +00:00
Brion Vibber
def1cb2845 Fix for regression from r26357: send newtalk notifications only if user has that pref selected 2007-10-03 21:13:02 +00:00
Tim Starling
353f203ce2 WARNING! NEEDS CAREFUL DEPLOYMENT
* Bug 9213: Fixed the plainly broken user_newtalk updating and caching scheme. I tried to keep my changes roughly performance-neutral, but the update on Wikimedia should be watched carefully for performance problems.
* Made UserMailer a class, use the autoloader to load it
* General UserMailer refactoring
* If the user has email-on-newtalk enabled, send them an email for every change, not just the first one before they view the page again.
* Don't add a watchlist entry automatically on change of user talk page
2007-10-03 08:46:17 +00:00