Commit Graph

25 Commits

Author SHA1 Message Date
Alex Schroeder
58e9a1e240 use v5.10 everywhere + enabled test in meta.t 2015-08-18 10:48:03 +02:00
Alex Schroeder
8e38179b66 our $q
The recent change to $q->remote_addr() necessitated the addition of our
$q to a few modules.
2015-08-15 10:32:11 +02:00
Alex Schroeder
823f518615 Replace GetRemoteHost with $q->remote_addr() 2015-07-31 09:35:51 +02:00
Alex Schroeder
dfa71cb2e3 Revert "Changed EN DASH to - in copyright lines"
This reverts commit 06c7fedec0.
2015-07-28 22:44:53 +02:00
Alex Schroeder
06c7fedec0 Changed EN DASH to - in copyright lines
The EN DASH is not really required in year ranges such as 2012–2015 when
we're talking about comments in source code that is probably being
displayed in a fixed font anyway. Changing back to an ordinary hypen
allows us to make a meaningful test for use utf8.
2015-07-28 22:14:37 +02:00
Aleks-Daniel Jakimenko
40ec24349a No more "*Sub = *NewSub", \&NewSub used instead. (Partial progress) 2015-04-11 23:41:33 +03:00
Aleks-Daniel Jakimenko
6f8d281d79 No more "use vars"! 2015-04-10 13:31:28 +03:00
Aleks-Daniel Jakimenko
88aac79df3 It is not that weird anymore! *Sub = *NewSub changed to *Sub = \&NewSub
We have just read-TFM and figured out that we can use \&Sub. This way it
passes "use strict" but produces a warning with "use warnings" (the
warning is "Subroutine package::Sub redefined at ...").

We can "fix" it with "no warnings 'redefine'"
2015-03-30 09:58:33 +03:00
Alex Schroeder
4df99dc798 Banning modules use our instead of my
All the banning modules have a problem. They use code like the
following:

*StrangeOldBannedContent = *BannedContent;
*BannedContent = *StrangeNewBannedContent;

The code above changes both the sub and the variable. $BannedContent now
points to $StrangeNewBannedContent (which is undefined) and the name of
the Banned Content page is only accessible via $StrangeOldBannedContent.
If we copy $StrangeOldBannedContent to $BannedContent, everything else
will keep working.

$BannedContent = $StrangeOldBannedContent;

But now use strict will not work. When we tried this:

my $StrangeOldBannedContent; # use strict

Then BannedContent disappeared from the admin page as shown by the tests
in strange-spam.t; the correct solution uses our instead of my.

I'm not sure why.
2015-03-30 00:29:39 +02:00
Alex Schroeder
c48a45d0b4 logbannedcontent.pl uses strict
Uses the same code and comment as banned-regexps.pl
2015-03-29 15:17:13 +02:00
Aleks-Daniel Jakimenko
4492ede096 "use strict;" in modules (some modules have problems) 2015-03-27 03:01:01 +02:00
Alex Schroeder
0f61a795ee Modules no longer refer to hostname banning
Hostnames are no longer tracked and therefore log messages such as
"hostname or IP number matched" no longer make sense.
2014-08-24 08:45:14 +02:00
Alex Schroeder
5aba2ae56f Fixed typo in AddModuleDescription sub name 2014-08-21 22:23:23 +02:00
Alex Jakimenko
ee932dee37 Automatically reformatted modules 2014-08-21 07:29:46 +03:00
Alex Schroeder
f276ae6469 Don't store host names.
Get rid of the option $UseLookup. Remove GetRemoteHost and rename
GetRemoteAddress to GetRemoteHost. Thus, it now returns IP number only.
2014-07-11 19:09:33 +02:00
Alex Jakimenko
6babcffd00 Consistency in file permissions.
Some modules are executable where as others are not. This patch fixes
this.
2014-06-16 11:19:24 +02:00
Alex Schroeder
53566c8434 Use a function instead of $ENV{REMOTE_ADDR}
When the webserver is behind a reverse proxy, $ENV{REMOTE_ADDR} is not
the actual remote client's address but the reverse proxy's address. The
actual remote client's address is available from an environment
variable. The name of this variable depends on the proxy, e.g. pound
uses $ENV{HTTP_X_FORWARDED_FOR}.

As suggested by tyatsumi on the wiki, all access $ENV{REMOTE_ADDR} now
happens via a new function which allows users to override it in their
config file.
2014-06-16 09:50:05 +02:00
Alex Schroeder
3c0c79a526 logbannedcontent.pl: Logging BannedHosts as well.
Renamed wrappers to make sure all have the Log prefix.

Moved log writing to a separate sub. Provide a little wrapper text for
banned hosts.

Using TimeToW3 to use a standard date and time format.

Use the id if no page has been opened yet (since DoEdit calls
UserIsBanned and DoPost calls UserCanEdit before either calls
OpenPage).
2013-01-31 09:21:54 +01:00
Alex Schroeder
f11e2a8731 getting rid of $Id$ tags in $WikiDescription
Replaced the $Id$ tags in $WikiDescription for all the modules and wiki.pl itself with a link to the source and an appropriate wiki page, if possible. This is shown in action=version and should help users figure out what another wiki has installed.
2012-04-19 02:18:45 +02:00
Alex Schroeder
6ec6d83fa7 Copy the $BannedContent variable. 2008-10-16 04:53:17 +00:00
Alex Schroeder
bf9223d2c3 Whitespace 2008-10-15 22:18:48 +00:00
Alex Schroeder
59958d551c (LogBannedContent): Don't remap
BannedContent again.
2008-10-15 22:17:47 +00:00
Fletcher T. Penney
ce5f169849 Fixed leading 0 in date field 2005-04-10 16:57:22 +00:00
Fletcher T. Penney
146ddfbf23 Update Copyright Dates 2005-04-08 21:23:43 +00:00
Fletcher T. Penney
4c8fcea049 Added my modules to source - FletcherPenney 2005-04-05 21:18:57 +00:00