Last modified: 2011-03-13 18:06:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T5670, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3670 - PATCH: extension hook for RC notification
PATCH: extension hook for RC notification
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
1.6.x
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-10 13:56 UTC by Daniel Kinzler
Modified: 2011-03-13 18:06 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
patch for DefaultSettings.php, RecentChange.php, and Setup.php - includes compatibility hack (7.51 KB, patch)
2005-10-10 13:57 UTC, Daniel Kinzler
Details
revamped this patch to use wfRunHooks. Moved all notification code into an extension. (3.00 KB, patch)
2005-10-11 00:10 UTC, Daniel Kinzler
Details
extensions to handle rc notification via UDP and plain file output. Patched against a dummy, not CVS. (5.95 KB, patch)
2005-10-11 00:16 UTC, Daniel Kinzler
Details
extensions to handle rc notification via UDP and plain file output. Patched against a dummy, not CVS. (5.92 KB, patch)
2005-10-13 00:51 UTC, Daniel Kinzler
Details

Description Daniel Kinzler 2005-10-10 13:56:30 UTC
I propose to add an extension hook for RC notification. The current option of
sending UDP packets is not very flexible, and different ways of notification
would sometimes be helpful.

The following functionality is included in the patch:
* infrastructure for generic RC notification hooks. Each hook can also have
arbitrary, per-instance configuration (port, etc)
* UDP notification as before
* Writing notifications to a file (or, more sensibly, to a fifo)
* Three different formats: human-readable colorized (like is currently done),
plain text, and CSV

It would thus be for instance possible to send notifications to a separate IRC
channel in a format that can be parsed more easily by scripts (I know of at
least two scripts that currently parse the RC channels).

For low-traffic sites, extensions for notification via e-mail, jabber, etc could
be plugged in easily, as opposed to hacking the core code.

patch to follow in a minute
Comment 1 Daniel Kinzler 2005-10-10 13:57:21 UTC
Created attachment 964 [details]
patch for DefaultSettings.php, RecentChange.php, and Setup.php - includes compatibility hack
Comment 2 Daniel Kinzler 2005-10-11 00:10:34 UTC
Created attachment 972 [details]
revamped this patch to use wfRunHooks. Moved all notification code into an extension.

This only removes functionality from the main code. A patch containing
extensions to handle rc notifications will follow in a minute.
Comment 3 Daniel Kinzler 2005-10-11 00:16:10 UTC
Created attachment 973 [details]
extensions to handle rc notification via UDP and plain file output. Patched against a dummy, not CVS.

This provides a base class for hooks (RCHook.php) and two implementations
(RC2UDP.php and RC2File.php) that handle RC-notifications. They can be used
like this:


$wgHooks['RecentChange'][] = new RC2UDP('localhost', 6666, 
       array( 'prefix' => $wgSitename . ": ", 
	      'colorize' => true, 
	      'suffix' => "\n" ) );

$wgHooks['RecentChange'][] = new RC2File('/var/log/pub/testwiki.rc', 
       array( 'csv' => true ) );

The first one would send UDP packets that are compatible with the current UDP
nitification mechanism. The second would fill a file (or fifo) with entries in
CSV format. Other combinations are possible.
Comment 4 Mick Weiss 2005-10-12 06:54:46 UTC
RC2Email.php works. //the rc hook for emails

I sent it to Daniel. I'm going to rewrite one part to use UserMailer.php instead
of just using mail() - and perhaps I'll add formatting options.

If you really want this code now (and you aren't picky about how it looks) -
email me.

- Mick
Comment 5 Daniel Kinzler 2005-10-13 00:51:10 UTC
Created attachment 984 [details]
extensions to handle rc notification via UDP and plain file output. Patched against a dummy, not CVS.

removed print_r that was left over from debugging. oops!
Comment 6 Brion Vibber 2005-10-22 22:00:23 UTC
Security review:
* Remote code execution: RC2File.php, RC2UDP.php use an undefined variable as the 
prefix of a require_once, with no execution guard. Systems with register_globals on 
may be seriously compromised through these files.

* Information disclosure: RC2File.php, RC2UDP.php will show error messages 
including local path information if executed via web with display_errors on.

Compatibility review:
* All files should use full PHP open tags (<?php, not <?) or they won't work on 
systems with short tags disabled

Style review:
* Some instances of "$a= $b" where "$a = $b" is expected
* "else if" sometimes used where "elseif" is expected
* Inconsistent parenthesis spacing

Patch fails security review; needs fixing.
Comment 7 Roan Kattouw 2008-09-06 21:58:19 UTC
No activity in nearly 3 years, closing as WONTFIX.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links