Commit graph

103 commits

Author SHA1 Message Date
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
Brion Vibber
dc4e9a3db7 * (bug 4918) Clean up logic for email notification minor edit option. I haven't been able to reproduce the bug, though, so not sure if there's no effect or what. Seems to work equally before and after. 2007-09-20 19:55:22 +00:00
Nick Jenkins
786e93fb37 Static code analysis housekeeping time... things that could be double-checked are marked with "[Note: some-comment]" :
if-if-else without curly braces [api/ApiQuerySiteinfo.php] --> adding
Unused global declaration:  $wgGroupPermissions --> removing 
Unused global declaration:  $wgEmailConfirmToEdit (line 301) --> removing 
Variable $id appears only once (line 1021)  --> removing 
Variable $m was used before it was defined (line 805) --> defining.
Variable $retval was used before it was defined (line 2346) --> renaming to $result
Variable $rcid appears only once (line 244 of RecentChange.php)  --> using this instead of $change [Note: was left over from r24607 refactoring, revert if wrong please]
Unused global declaration:  $wgCommandLineMode (line 11) --> removing
Variable $k appears only once (line 132 of ImagePage.php) --> removing.
Variable $info appears only once (line 311 of ImagePage.php)  --> removing.
Unused global declaration:  $wgTitle (line 569 of ImagePage.php) -> removing.
Variable $handlerParams was used before it was defined (line 616 of Linker.php) --> resolved by Raymond in r24966
Variable $match was used before it was defined (line 1031 of Linker.php) --> defining.
Unused global declaration:  $wgEnotifWatchlist (line 253 of UserMailer.php) --> removing 
Unused global declaration:  $wgShowUpdatedMarker (line 253 of UserMailer.php) --> removing 
Variable $img appears only once (line 446 of SpecialUpload.php) --> added definition, defined as null, flagged with @todo  [Note: should $img be defined in this context, or is it intended to be null? And should the return value after the hook be checked in some way?]
Unused global declaration:  $wgEnableAPI (line 739 of SpecialUpload.php) --> removing.
Unused global declaration:  $wgNamespaceProtection (line 1030 of OutputPage.php) --> removing.
Unused global declaration:  $wgContLang (line 18 of SpecialWatchlist.php) --> removing.
Unused global declaration:  $wgRawHtml (line 269 of SpecialMovepage.php) --> removing.
The value of variable $page was never used (line 331 of SpecialUndelete.php) --> removing line, as $page gets redefined a few lines down.
Variable $synIndex appears only once (line 521 of MagicWord.php) --> commenting out.
Variable $case appears only once (line 539 of MagicWord.php) --> removing from foreach index key usage.
Variable $wgUser appears only once (line 1039 of Title.php) --> adding line to declare as a global, would be null otherwise.
Variable $m was used before it was defined (line 285 of Title.php) --> defining.
Variable $id appears only once (line 1150 of Title.php) --> removing from foreach index key usage.
Variable $subpage appears only once (line 1297 of Title.php) --> commenting out.
Variable $restrictions appears only once (line 1399 of Title.php) --> commenting out.
Variable $mime appears only once (line 210 of filerepo/OldLocalFile.php) --> removing.
Variable $deprefixedName appears only once (line 213 of filerepo/LocalFile.php) --> removing.
Variable $m appears only once (line 541 of filerepo/LocalFile.php) --> removing.
Variable $where appears only once (line 1245 of filerepo/LocalFile.php) --> removing.
Variable $info appears only once (line 1427 of filerepo/LocalFile.php) --> removing.
Variable $rel appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $zone appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $nbytes appears only once (line 208 of media/Generic.php) --> added a return line that uses $nbytes. [Note: I'm assuming that this was the intent]
Variable $offset appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $limit appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $groupTarget appears only once (line 203 of SpecialListusers.php) --> removing.
Unused global declaration:  $wgLang (line 74 of SpecialWantedpages.php) --> removing.
Variable $block appears only once (line 244 of SpecialProtectedpages.php) --> removing.
Variable $offset appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Variable $limit appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Unused global declaration:  $wgLang (line 30 of FileDeleteForm.php) --> removing.
Unused global declaration:  $wgServer (line 30 of FileDeleteForm.php) --> removing.
2007-08-21 03:57:54 +00:00
Steve Sanbeg
340eebc81a missed a brace. 2007-07-12 21:25:22 +00:00
Steve Sanbeg
0ab7cfaab9 Add error checking for mail() function 2007-07-12 21:16:03 +00:00
Brion Vibber
8466f9561e Fix regression from r23575 -- wl_notificationtimestamp didn't get updated anymore on update notification, leading to duplicate mails being sent out.
Doing a WHERE on x=NULL doesn't work; need to do 'x IS NULL' here.
Perhaps we should make the DB functions smarter to handle that case to do what we'd expect it to do (as we do turning arrays into 'IN (...)') but this'll fix it for now.
2007-07-11 19:21:34 +00:00
Rob Church
153a4e9b87 Revert bogus reversion 2007-07-10 08:10:04 +00:00
Aryeh Gregor
8609a52a76 Okay, use named constants that are actually equivalent to what they replace. But still use named constants. (Thanks, Raymond) 2007-07-09 22:12:55 +00:00
Aryeh Gregor
1c8ab4afee Magic numbers are evil, use named constants. 2007-07-09 21:16:58 +00:00
Rob Church
286a1124a6 Don't waste time queuing or checking email notifications for pages in the Special or Media namespaces 2007-07-09 14:21:49 +00:00
Aaron Schulz
d9796d048d *Mark all versions newer than the time of the latest revision viewed as "updated since last view", not just the current (bug 10277) 2007-06-30 01:03:21 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Rob Church
b6b52063ec Some job cleanup:
* Move Jobs left in JobQueue.php to their own file
* Ditch $wgCustomJobs in favour of $wgJobClasses, which acts as a dictionary and allows extensions to add custom jobs
* Standardise Job derivative constructors and update everywhere
* Make sure all overriding implementations of Job::run() return true to avoid bogus "Error" report in runJobs.php
2007-06-21 19:11:24 +00:00
River Tarnell
a6f6e04841 instead of storing every mail as a job, have a job to send enotif updates for the whole mail at once. 2007-05-11 16:42:18 +00:00
River Tarnell
af16ff1358 english stripping 2007-05-11 15:21:06 +00:00
River Tarnell
10b254085d mail() sending was not chucking recips properly in array path, from Nick Jenkins 2007-05-08 08:28:34 +00:00
River Tarnell
59d5f6a703 < brion-sushi> Error sending mail: Undefined variable: dest
- don't try to log destination in debug message
2007-05-07 17:56:00 +00:00
River Tarnell
67044a931c - default value of $wgEnotifImpersonal should be false
- userMailer() needs to handle multiple recips in mail() path
2007-05-06 07:14:10 +00:00
River Tarnell
848d8f4611 allow enotif mails to be sent via job queue 2007-05-05 12:44:55 +00:00
River Tarnell
03df01a7fa enotif should have a way to send bulk mail without customisations, for large sites 2007-05-05 12:08:24 +00:00
Tim Starling
644c2a89ff Added $wgUsersNotifedOnAllChanges, array of usernames who will be sent a notification email for every change which occurs on a wiki 2007-04-22 14:07:28 +00:00
Nick Jenkins
113bb1c772 Documentation tweaks to help documentation systems (Doxygen + PHPDocumentor)
pick up the appropriate tags, and documentation blobs for classes. This is 
the same as per r20769, but with the grouping changes (e.g. removing "@{{") omitted.
Please be advised that more related documentation tweaks may follow later - e.g. 
Doxygen generates a log file of warnings that is 574 Kb in size, when run over 
the just the trunk/phase3 code ... eek! Thankfully, much of that is just 
whining about functions without documentation   ;-)
2007-04-04 05:22:37 +00:00
Brion Vibber
3a6ac5a3c3 Revert r20769: we don't use PHPDocumentor anymore, we use doxygen.
If making mass changes to tweak to its preferences, probably better to do it for the tool we actually generate docs with. :)
2007-03-28 14:16:43 +00:00
Nick Jenkins
5fef2333d4 PHPDocumentor [http://en.wikipedia.org/wiki/PhpDocumentor] documentation tweaking stuff.
Minor doc tweaks to prevent some PHPDocumentor warnings or errors when run on the includes/ directory. PHPDocumentor uses a syntax very similar to javadoc - mostly we already use this, but there were a few scattered places that were adjusted to make them consistent with the rest of the code. In practical terms, these changes were made:
* @url becomes @link
* @fixme becomes @todo
* HTML tags in descriptions must be closed / balanced.
* @bug was removed (where the bug was long fixed), or changed into a @todo (in the few situations where the bug was still pending)
* @obsolete becomes @deprecated
* Things like "/**@{{" and "/**@}}*/" which cause "unknown tag" warnings were removed
* @access must be a valid access level.
* @desc tag not needed, removed.
* Doesn't seem to like @licence, will accept @license however.
* Use full comment block notation in a few places (i.e. open block with "/**", start each line with " *", and end block with " */")

Then additional to this, to get some class docs associated with their respective classes:
* Moved some docs to right above those classes (deleting blank lines, or moving descriptions from the file headers)
* Marked some classes without docs as "@todo document"
* (done up to "class MIMEsearchPage" on the "classtrees_MediaWiki.html" page for the includes/ directory)
2007-03-28 08:53:02 +00:00
Antoine Musso
520598e6e5 Fix #4347: use MailAddress object for reply-to 2007-02-03 22:55:01 +00:00