Commit Graph

147 Commits

Author SHA1 Message Date
Elián Hanisch c59d11c308 Fix searching in only bans, or only mutes.
We can't use LIMIT and OFFSET if we are going to filter mutes/bans later.
We have to get *all* bans and mutes, filter, and do the pagination manually.
2011-12-24 13:58:08 -03:00
Elián Hanisch 9c4c948a7f print pagination links at the bottom of the page.
highlight the current page between []
2011-12-22 21:03:33 -03:00
Elián Hanisch 7f104934ab fix the bans counter, it wasn't updated after filtering mutes. 2011-12-22 20:55:20 -03:00
Elián Hanisch aa88d5529e fix searching only mutes and add option for removed ones. 2011-12-22 20:52:37 -03:00
Elián Hanisch 4f8d1d1916 fix typos. 2011-12-22 19:36:58 -03:00
Terence Simpson fb7f9c7acf Added log.tmpl 2011-12-21 17:01:41 +00:00
Terence Simpson bb605749a5 Typo++ 2011-12-21 16:50:46 +00:00
Terence Simpson 3c9161db65 * Update symlinks in the root.
* Bantracker/cgi/bans.cgi:
 * Use action="" in forms, which default to whatever the current URL is
   (without query or fragment).
 * Make sure errors are printed to sys.stderr, so they show up in the
   right pace.
 * Added irc_network and irc_channel config options, so it's not
   hard-coded.
 * replace "X.has_key(Y)" with "Y in X", has_key is "depricated" and
   removed in 3.x (forward planning)
 * added isTrue() and isFalse() to test if a form value evaluates to
   boolean.
 * True or False, repectivly. Use these in isOn().
 * If a bad regex is passed in the log view, show that it was an error.
 * Wrap INSERT statements in a try block.
 * Put the generation time in a (X)HTML comment.
* Bantracker/config.py: Add SQL to create INDEX. 
* Bantracker/README.txt: Update with extra information on setting up the
  web interface.
2011-12-21 16:38:39 +00:00
Elián Hanisch e3669b4465 Don't show the last bans when the page is loaded, it takes a lot of time.
This is due to sqlite2, sqlite3 doesn't have this problem.
2011-11-07 19:13:43 -03:00
Elián Hanisch 9d69828d44 read config settings from 'bantracker.conf' so I don't have to edit the cgi script every bloody time I update it.
Also, handle errors more gracefully.
2011-11-07 18:29:16 -03:00
Elián Hanisch 0556d87d01 fix layout and other stuff, disable sorting since is broken. 2011-11-07 18:27:28 -03:00
Elián Hanisch 5583fc3f82 move everything to into a "cgi" dir.
Show the latest bans, paginate searches, so there's only 100 bans loaded at the time.
2011-11-06 22:36:36 -03:00
Elián Hanisch 583ea422d9 port changes from bantracker page. 2011-11-06 20:11:13 -03:00
Elián Hanisch 9d6dfd01f2 lets not hardcode "bans.cgi" in the page. 2011-11-06 09:52:17 -03:00
Elián Hanisch 838f807a3b Sqlite 2 doesn't have a way of escaping '%', so we can't search in mutes, but we can filter them. 2011-11-06 09:44:53 -03:00
Elián Hanisch e64b87fe89 add in the README about creating an INDEX for comments so it doesn't traverse
the whole table for each ban.
2011-11-05 20:34:21 -03:00
Elián Hanisch af95f4d3e0 make bantracker page go faster, like, 10 times faster. 2011-11-05 20:33:33 -03:00
Terence Simpson bed505399f Don't just give up if an SQL operation throws an error; try, try, try again... and then some 2011-08-26 07:48:13 +01:00
Elián Hanisch ed91a8a426 bantracker: When joining a channel, discard the ban list for that channel. 2011-06-18 23:14:35 -03:00
Elián Hanisch 8d61d972fd bantracker: remove an useless extra search 2011-06-18 22:43:43 -03:00
Elián Hanisch a9a111b8e6 Bantracker: Don't duplicate bans if for some reason the bot request a ban list.
Only sort bans when the ban list is over.
2011-06-18 22:39:16 -03:00
Elián Hanisch af068e2f91 Bantracker: when unbanning, if there was a problem reading the db,
bt would fail to remove the ban from self.bans.
2011-06-18 22:32:04 -03:00
Elián Hanisch 0a435b668c Bantracker: don't re-add bans that are out of sync into self.bans 2011-06-18 16:27:51 -03:00
Elián Hanisch 62936a986c bantracker: forgot about extbans. 2011-05-31 19:55:38 -03:00
Elián Hanisch d0d7fe616a bantracker: HACK assume bans with exact mask are marks, so they won't get a review. 2011-05-31 19:43:45 -03:00
Elián Hanisch e69ac691c6 Bantracker: trim messages so they are more to the point. 2011-05-31 03:39:28 -03:00
Elián Hanisch f71a3c9929 Bantracker: ignore reviews for bans with a #ubuntu-read-topic forward. 2011-05-31 03:15:58 -03:00
Elián Hanisch 638ccf7b47 Bantracker: strip '%' from quiets in the string that's send to channels/nicks. 2011-05-31 01:45:05 -03:00
Elián Hanisch 223c3f9229 Bantracker: add separate configs so comment request, and review requests,
can be configured independently.
2011-05-29 19:22:34 -03:00
Elián Hanisch 46d07b8095 bantracker: add options --verbose --view and --flush to banreview command.
intended for manually fix the review queue when the bot messes up.
2011-05-29 19:21:27 -03:00
Terence Simpson fd36bffcc0 (large commit, see bazaar log)
[Bantracker]
 * Less spaces in README.txt
 * Remove mention of table 'users' in README.txt
 * Add more detail on how to create the bans database in README.txt
 * Add note about supybot-wizard creating the initial database in README.txt
 * Don't hard-code default values in config.py:configure()
 * Tweak config.py
 * Clean up bans.cgi a bit

[Bugtracker]
 * Comment-out obsolete "bug reporting" variables in config.py
 * Update README.txt and remove "bug reporting" stuff, also remove extraneous license info
 * Comment-out obsolete "bug reporting" code
 * Don't import imaplib

[Encyclopedia]
 * Don't hard-code default values in config.py:configure()
 * Check for 'owner' capability before checking if the hostmask is ignored in plugin.py:checkIgnored()
 * Clean up README.txt

[PackageInfo]
 * Don't hard-code default values in config.py:configure()
 * Update default distributions in config.py:configure()
 * Update defaultRelease in config.py 
 * Update README.txt

* Add a few docstrings to commoncgi.py
* Update COPYING
* Update README.txt
2011-05-28 07:33:21 +01:00
Elián Hanisch 5ed4e67b07 forgot to remove these debug lines. 2010-10-24 03:25:40 -03:00
Elián Hanisch 21c041631f workaround, remove duplicate reviews before sending any. 2010-10-24 03:13:43 -03:00
Terence Simpson 55ca23f755 Make configure() do something for all plugins, also fix a couple of things from r197-203 2010-05-29 14:36:43 +01:00
Terence Simpson 5082202a3e fix++ 2010-05-29 00:55:07 +01:00
Terence Simpson f3de8f84a6 Make a custom anything() function that follows the same form as every other function in supybot.questions, because apparently no one thought this was a good idea... 2010-05-28 23:51:28 +01:00
Terence Simpson ad7a493262 Update copyright/license/author/contributors information
Make sure all files have encoding set to utf-8 unless they already have an encoding
Added COPYING with contense of GPL-2
Added plugin name prefix to all log output. This should take the form of self.log.severity("Plugin: message"),
when not logging from plugin.py use: "Plugin/file_without_dot_py: message"
Bantracker: Made the confgure() function do something, it also creates an initial database if it doesn't exist
Encyclopedia: Made the configure() function do something, it also creates an initial database if it doesn't exist
PackageInfo: Improve the configure() function, it also now creates some initial .list files and prompts to run update_apt and update_apt_file
This goes some way to getting an "ubottu" package together, all we need to do is patch supybot-wizard to download the plugins
from bzr and put them somewhere supybot will see them, then the wizard will do all the initial setup
2010-05-24 14:38:06 +01:00
Terence Simpson b6465cc8bb Don't fetch bans/nicks for channels where Bantracker is disabled 2010-05-22 09:11:37 +01:00
Terence Simpson 0320609071 use /usr/bin/env for #! lines 2010-05-19 14:11:16 +01:00
Elián Hanisch a162404aec Bantracker: try to re-connect to the db if for some reason it didn't connect
or got closed.
2010-05-14 13:17:40 -03:00
Elián Hanisch 42a64c4c18 Bantracker: Don't enqueue ban reviews already in queue. Testcase updated. 2010-05-14 00:09:50 -03:00
Elián Hanisch e5801cf105 merge with devel 2010-04-26 17:37:37 -03:00
Elián Hanisch bb6c417989 fix error handling on cursor.execute
the previous code seemed to try 5 times before giving up, except that
it wasn't inside any loop, so it only tried once and there was no error msg.
Now at least log that there was an error.
2010-04-20 10:27:46 -03:00
Terence Simpson 9d99263232 Fix some IndexErrors 2010-04-20 12:27:35 +01:00
Terence Simpson 2a0e6a1f1a fix check_auth 2010-04-13 05:11:15 +01:00
Elián Hanisch 9ecf076312 new testcase: testReviewIgnore 2010-04-12 23:06:25 -03:00
Elián Hanisch 7538da2329 fix request ignores, It was matching against full hostmask instead of nick.
New testcase: testCommentIgnore
2010-04-12 23:02:07 -03:00
Elián Hanisch 62201d9a12 setup the db before loading the plugin during testing
this fixes a spurious ERROR when the testcase is run for the first time
2010-04-12 21:41:14 -03:00
Elián Hanisch 93f5ef5b9e fix testcases for forced parts 2010-04-12 21:33:15 -03:00
Terence Simpson 02f95832db Don't recognise /remove as a kick and fix hostmaskPatternEqual for 'new' ban-forward syntax 2010-04-13 01:24:45 +01:00