Pedro Algarvio, aka, s0undt3ch wrote:
> I know I'm pushing, but would you be so kind to include an extra arg to
> at least 1 more of the 4 IWIkiChageListener's, ie, ipnr, the remote
> address because this is not a property of model.WikiPage(of course).

Well, the ipnr wouldn't be a property of the page since it's part of
the change, not the page itself.  So, you can get the IP from
page.get_history().

> I know that to delete a wiki page, one must have the right perm, so for
> this case, an  ip wouldn't be that necessary, the username would
> sufice, same for delete a version, but, for new wiki pages at least the
> ip should be accessible since open trac envs allow new wiki pages
> creation by default, and for bad users an ip would be great for further
> actions.
> Of course if all could have the ipnr argument, that wouldn't be that
> bad.

Maybe "wiki_page_added" should've been more similar to
"wiki_page_changed", though it's probably a bad time to change that
API, since it could break plugins right before the release.  And it
should be pretty easy to get that from the history:

version, time, author, comment, ipnr = page.get_history().next()
# there should only be one item in the history since it's a new page

However, since it sounds like you're looking to do something with spam
filtering, the filtering APIs provided by the SpamFilter plugin may be
more what you're looking for.  Those APIs have access to the request
object, so you can get the IP from there.  There is a filter included
in the plugin for checking IPs against DNS blacklists:
http://trac.edgewall.org/wiki/SpamFilter#IPBlacklisting

-- Matt Good


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/trac-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to