forked from github/kensanata.oddmuse
Compare commits
184 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d94d571881 | ||
|
|
d663c2b61d | ||
|
|
a3cbd8db8b | ||
|
|
90e92c27b8 | ||
|
|
76b433c1da | ||
|
|
b116a0103e | ||
|
|
6a7a0dd24d | ||
|
|
c2366aa36f | ||
|
|
4da50ef125 | ||
|
|
2e0f293dcd | ||
|
|
d0095a36b5 | ||
|
|
1eae7852c4 | ||
|
|
da06278df8 | ||
|
|
bd8f914804 | ||
|
|
51b24309a7 | ||
|
|
60a4572087 | ||
|
|
248af821a7 | ||
|
|
c85e8b84b9 | ||
|
|
e4d159307b | ||
|
|
80a30a9102 | ||
|
|
299b94243d | ||
|
|
b7ab45a3a7 | ||
|
|
9d3deaff0f | ||
|
|
42a1e389a5 | ||
|
|
9883a064f3 | ||
|
|
52617b472d | ||
|
|
764c15e6c0 | ||
|
|
88b384c2b4 | ||
|
|
92e231b10c | ||
|
|
e9ce006444 | ||
|
|
bc5ee74ffd | ||
|
|
688cf9eea5 | ||
|
|
ad9a19d551 | ||
|
|
7595e6db36 | ||
|
|
74fd5c569c | ||
|
|
e4376c178b | ||
|
|
9e46438534 | ||
|
|
4dd29bd4a7 | ||
|
|
90af54b7ba | ||
|
|
cadcdde5f8 | ||
|
|
4c77bc11de | ||
|
|
05988eb899 | ||
|
|
040bd05333 | ||
|
|
5f03238f60 | ||
|
|
4c6d91a101 | ||
|
|
71b93887dc | ||
|
|
391049ef77 | ||
|
|
3d5aec5651 | ||
|
|
d976184e24 | ||
|
|
5a45c1191a | ||
|
|
07f315ca12 | ||
|
|
be1cf0e876 | ||
|
|
d4d0ed728f | ||
|
|
0f0f20b21c | ||
|
|
abdb9c973b | ||
|
|
4e0b287890 | ||
|
|
00308f9ed6 | ||
|
|
2488ccdb8c | ||
|
|
cec2f3cc1b | ||
|
|
5a19773dfa | ||
|
|
7c3bb0a0af | ||
|
|
90d44bf863 | ||
|
|
9d0ff86a44 | ||
|
|
d03bc9f40b | ||
|
|
863bda76dc | ||
|
|
fcbe01bbfd | ||
|
|
6178c46aec | ||
|
|
87110eef08 | ||
|
|
1bfeac5035 | ||
|
|
ef257b566f | ||
|
|
0fce2edcf8 | ||
|
|
152188503e | ||
|
|
d804c16a1c | ||
|
|
cb7f2e4634 | ||
|
|
b90695c7c8 | ||
|
|
e67c8bfda6 | ||
|
|
90eb428787 | ||
|
|
e3cacaa89f | ||
|
|
6167428ecf | ||
|
|
367f76b6f4 | ||
|
|
733b6dabb1 | ||
|
|
72cd669bf0 | ||
|
|
84f630af4a | ||
|
|
05df700140 | ||
|
|
f230a64e7d | ||
|
|
1855c84cec | ||
|
|
3c982a6cd4 | ||
|
|
7053561f89 | ||
|
|
02fcabfdbc | ||
|
|
0c0efdd2c8 | ||
|
|
9a93601a03 | ||
|
|
b68f2b6cd6 | ||
|
|
80d95e9225 | ||
|
|
04288eda8c | ||
|
|
3a7f75cf30 | ||
|
|
0ca64b2db0 | ||
|
|
81aaf49463 | ||
|
|
5c93616690 | ||
|
|
c1823bc59c | ||
|
|
1634859659 | ||
|
|
684781423d | ||
|
|
1f2507fc00 | ||
|
|
0644b63b67 | ||
|
|
64f6b267d9 | ||
|
|
528e9d8868 | ||
|
|
f618822f34 | ||
|
|
e9a5fcdc7c | ||
|
|
2a33e91167 | ||
|
|
77327ec06f | ||
|
|
f530b25d74 | ||
|
|
8db81914b1 | ||
|
|
5fce7f4b63 | ||
|
|
1ee235c949 | ||
|
|
be7d8d4460 | ||
|
|
f134283bae | ||
|
|
38d5d01ea1 | ||
|
|
8e3e186fab | ||
|
|
4b33b3afeb | ||
|
|
9beca5895a | ||
|
|
1afc03eee1 | ||
|
|
331b03f894 | ||
|
|
1c9b180b3a | ||
|
|
57a16e85f8 | ||
|
|
c7cd5bcc36 | ||
|
|
f571007516 | ||
|
|
fac3f03f7b | ||
|
|
7d85dd6570 | ||
|
|
a91ef8602f | ||
|
|
1bc670617e | ||
|
|
74288ba3f3 | ||
|
|
bf2856011d | ||
|
|
ca974a902d | ||
|
|
f992897e7a | ||
|
|
c121607f61 | ||
|
|
032c7aea73 | ||
|
|
f6c419746c | ||
|
|
83f13a9a1a | ||
|
|
2111af2ec8 | ||
|
|
648e6eb9bc | ||
|
|
994b4e8051 | ||
|
|
f2f464b1ca | ||
|
|
119d11b405 | ||
|
|
d7031198cd | ||
|
|
187d4020f5 | ||
|
|
0a77bd0b47 | ||
|
|
cb00e7e969 | ||
|
|
1b2fe0d713 | ||
|
|
8e73f6f0dd | ||
|
|
d3c7b45ad9 | ||
|
|
fee15fd880 | ||
|
|
196b960b47 | ||
|
|
241a88ef48 | ||
|
|
fdf0c2711b | ||
|
|
239a95e683 | ||
|
|
d3205d2425 | ||
|
|
681ba8068c | ||
|
|
d5429d276f | ||
|
|
746b10be81 | ||
|
|
b9aa27e406 | ||
|
|
00cf277156 | ||
|
|
75ce7d745e | ||
|
|
ee1bbca5c9 | ||
|
|
0effc86620 | ||
|
|
8a36970b24 | ||
|
|
8be87ede99 | ||
|
|
d61dd71627 | ||
|
|
755f742088 | ||
|
|
0107e41123 | ||
|
|
e58c8c2192 | ||
|
|
ee4518da9e | ||
|
|
64e7183896 | ||
|
|
bd2715a35e | ||
|
|
986e4fc65f | ||
|
|
908cecffb9 | ||
|
|
07226ae7a1 | ||
|
|
c90258ef4b | ||
|
|
f500092a6a | ||
|
|
d1f1f65c9b | ||
|
|
aae0cb6379 | ||
|
|
2b0a0d9a14 | ||
|
|
69fcb9646b | ||
|
|
a0bf615960 | ||
|
|
c024f553fd | ||
|
|
c97d6a576f |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.pl linguist-language=Perl
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,3 +8,4 @@
|
||||
.DS_Store
|
||||
wiki.log
|
||||
.prove
|
||||
TAGS
|
||||
|
||||
10
Makefile
10
Makefile
@@ -19,9 +19,13 @@ build:
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
prove t/setup.pl
|
||||
|
||||
release:
|
||||
perl stuff/release ~/oddmuse.org/releases 2.3.3
|
||||
|
||||
build/wiki.pl: wiki.pl
|
||||
perl -lne "s/(\\\$$q->a\({-href=>'http:\/\/www.oddmuse.org\/'}, 'Oddmuse'\))/\\\$$q->a({-href=>'http:\/\/git.savannah.gnu.org\/cgit\/oddmuse.git\/tag\/?id=$(VERSION_NO)'}, 'wiki.pl') . ' ($(VERSION_NO)), see ' . \$$1/; print" < $< > $@
|
||||
perl -lne "s/(\\\$$q->a\(\{-href=>'https:\/\/www.oddmuse.org\/'\}, 'Oddmuse'\))/\\\$$q->a({-href=>'https:\/\/git.savannah.gnu.org\/cgit\/oddmuse.git\/tag\/?id=$(VERSION_NO)'}, 'wiki.pl') . ' ($(VERSION_NO)), see ' . \$$1/; print" < $< > $@
|
||||
|
||||
build/%-utf8.pl: modules/translations/%-utf8.pl
|
||||
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
||||
@@ -32,8 +36,8 @@ build/national-%.pl: modules/translations/national-%.pl
|
||||
build/month-names-%.pl: modules/translations/month-names-%.pl
|
||||
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
||||
|
||||
# from: http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl
|
||||
# to: http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl?id=2.1-11-gd4f1e27
|
||||
# from: https://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl
|
||||
# to: https://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl?id=2.1-11-gd4f1e27
|
||||
|
||||
build/%.pl: modules/%.pl
|
||||
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, undef, '$(VERSION_NO)')/; print" < $< > $@
|
||||
|
||||
@@ -23,12 +23,21 @@ usermod -a -G sudo alex
|
||||
Now you can login as {{{alex}}} and do everything else using {{{sudo}}}.
|
||||
|
||||
You need to copy wiki.pl into your cgi-bin directory, and you need to
|
||||
make the script executable.
|
||||
make the script executable. You might also have to change its owner to
|
||||
an appropriate user on your system.
|
||||
|
||||
{{{
|
||||
sudo wget -O /usr/lib/cgi-bin/wiki.pl \
|
||||
http://git.savannah.gnu.org/cgit/oddmuse.git/plain/wiki.pl
|
||||
sudo chmod +x /usr/lib/cgi-bin/wiki.pl
|
||||
sudo chown www-data.www-data /usr/lib/cgi-bin/wiki.pl
|
||||
}}}
|
||||
|
||||
If you're on SUSE, the user might not be {{{www-data}}} but
|
||||
{{{wwwrun}}} without appropriate group:
|
||||
|
||||
{{{
|
||||
sudo chown wwwrun.root /usr/lib/cgi-bin/wiki.pl
|
||||
}}}
|
||||
|
||||
You should be able to test it right now! Visit
|
||||
@@ -85,7 +94,7 @@ Enjoy your wiki experience.
|
||||
Visit https://www.oddmuse.org/ to learn more about the translation
|
||||
files and modules that are part of this package.
|
||||
|
||||
== Apache
|
||||
== Checking the Apache Setup
|
||||
|
||||
If you think this information doesn't work for you, here are some things
|
||||
to check.
|
||||
@@ -119,7 +128,7 @@ The default site is configured in
|
||||
sudo a2ensite default
|
||||
}}}
|
||||
|
||||
This file also lists the directories we've used in out instructions
|
||||
This file also lists the directories we've used in our instructions
|
||||
above.
|
||||
|
||||
{{{
|
||||
@@ -136,6 +145,32 @@ simply restart it all:
|
||||
sudo service apache2 graceful
|
||||
}}}
|
||||
|
||||
== Using just Perl
|
||||
|
||||
You can use Mojolicious as your web server. There is a simple
|
||||
##server.pl## which you can use. Here's how you might start it:
|
||||
|
||||
{{{
|
||||
mkdir ~/oddmuse
|
||||
WikiDataDir=$HOME/oddmuse perl server.pl daemon
|
||||
}}}
|
||||
|
||||
This makes the server available on {{{http://localhost:3000/wiki}}}.
|
||||
|
||||
If it works for you, feel free to upgrade to Hypnotoad.
|
||||
|
||||
{{{
|
||||
WikiDataDir=$HOME/oddmuse hypnotoad server.pl
|
||||
}}}
|
||||
|
||||
Note: Hypnotoad uses a different default port. The above makes the
|
||||
server available on {{{http://localhost:8080/wiki}}}. Hypnotoad will
|
||||
keep forking new processes. To stop it, use the {{{-s}}} flag.
|
||||
|
||||
{{{
|
||||
hypnotoad -s server.pl
|
||||
}}}
|
||||
|
||||
== License
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
|
||||
14
contrib/campaignwiki/delete.sh
Executable file
14
contrib/campaignwiki/delete.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
if test -z "$2" -o ! -z "$3"; then
|
||||
echo "Usage: delete.sh USERNAME WIKI"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
username=$1
|
||||
wiki=$2
|
||||
|
||||
for p in $(curl --silent "https://campaignwiki.org/wiki/$wiki?action=index;raw=1"); do
|
||||
echo "Deleting: $p"
|
||||
curl -F frodo=1 -F "title=$p" -F text=DeletedPage -F summary=Deleted -F username="$username" "https://campaignwiki.org/wiki/$wiki"
|
||||
sleep 5
|
||||
done
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use CGI;
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
|
||||
131
contrib/no-flickr.pl
Normal file
131
contrib/no-flickr.pl
Normal file
@@ -0,0 +1,131 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2005-2016 Alex Schroeder <alex@gnu.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use Modern::Perl;
|
||||
use LWP::UserAgent;
|
||||
use utf8;
|
||||
binmode(STDOUT, ":utf8");
|
||||
|
||||
my $ua = LWP::UserAgent->new;
|
||||
|
||||
sub url_encode {
|
||||
my $str = shift;
|
||||
return '' unless $str;
|
||||
utf8::encode($str); # turn to byte string
|
||||
my @letters = split(//, $str);
|
||||
my %safe = map {$_ => 1} ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '-', '_', '.', '!', '~', '*', "'", '(', ')', '#');
|
||||
foreach my $letter (@letters) {
|
||||
$letter = sprintf("%%%02x", ord($letter)) unless $safe{$letter};
|
||||
}
|
||||
return join('', @letters);
|
||||
}
|
||||
|
||||
sub get_raw {
|
||||
my $uri = shift;
|
||||
my $response = $ua->get($uri);
|
||||
return $response->content if $response->is_success;
|
||||
}
|
||||
|
||||
sub get_wiki_page {
|
||||
my ($wiki, $id, $password) = @_;
|
||||
my $parameters = [
|
||||
pwd => $password,
|
||||
action => 'browse',
|
||||
id => $id,
|
||||
raw => 1,
|
||||
];
|
||||
my $response = $ua->post($wiki, $parameters);
|
||||
return $response->decoded_content if $response->is_success;
|
||||
die "Getting $id returned " . $response->status_line;
|
||||
}
|
||||
|
||||
sub get_wiki_index {
|
||||
my $wiki = shift;
|
||||
my $parameters = [
|
||||
search => "flickr.com",
|
||||
context => 0,
|
||||
raw => 1,
|
||||
];
|
||||
my $response = $ua->post($wiki, $parameters);
|
||||
return $response->decoded_content if $response->is_success;
|
||||
die "Getting the index returned " . $response->status_line;
|
||||
}
|
||||
|
||||
sub post_wiki_page {
|
||||
my ($wiki, $id, $username, $password, $text) = @_;
|
||||
my $parameters = [
|
||||
username => $username,
|
||||
pwd => $password,
|
||||
recent_edit => 'on',
|
||||
text => $text,
|
||||
title => $id,
|
||||
];
|
||||
my $response = $ua->post($wiki, $parameters);
|
||||
die "Posting to $id returned " . $response->status_line unless $response->code == 302;
|
||||
}
|
||||
|
||||
my %seen = ();
|
||||
|
||||
sub write_flickr {
|
||||
my ($id, $flickr, $dir, $file) = @_;
|
||||
say "Found $flickr";
|
||||
warn "$file was seen before: " . $seen{$file} if $seen{$file};
|
||||
die "$file contains unknown characters" if $file =~ /[^a-z0-9_.]/;
|
||||
$seen{$file} = "$id used $flickr";
|
||||
my $bytes = get_raw($flickr) or die("No data for $id");
|
||||
open(my $fh, '>', "$dir/$file") or die "Cannot write $dir/$file";
|
||||
binmode($fh);
|
||||
print $fh $bytes;
|
||||
close($fh);
|
||||
}
|
||||
|
||||
sub convert_page {
|
||||
my ($wiki, $pics, $dir, $username, $password, $id) = @_;
|
||||
say $id;
|
||||
my $text = get_wiki_page($wiki, $id, $password);
|
||||
my $is_changed = 0;
|
||||
while ($text =~ m!(https://[a-z0-9.]+.flickr.com/(?:[a-z0-9.]+/)?([a-z0-9_]+\.(?:jpg|png)))!) {
|
||||
my $flickr = $1;
|
||||
my $file = $2;
|
||||
write_flickr($id, $flickr, $dir, $file);
|
||||
$is_changed = 1;
|
||||
my $re = quotemeta($flickr);
|
||||
$text =~ s!$flickr!$pics/$file!g;
|
||||
}
|
||||
if ($is_changed) {
|
||||
post_wiki_page($wiki, $id, $username, $password, $text);
|
||||
} else {
|
||||
# die "$id has no flickr matches?\n$text";
|
||||
}
|
||||
sleep(5);
|
||||
}
|
||||
|
||||
sub convert_site {
|
||||
my ($wiki, $pics, $dir, $username, $password) = @_;
|
||||
my @ids = split(/\n/, get_wiki_index($wiki));
|
||||
for my $id (@ids) {
|
||||
convert_page($wiki, $pics, $dir, $username, $password, $id);
|
||||
}
|
||||
}
|
||||
|
||||
our $AdminPass;
|
||||
do "/home/alex/password.pl";
|
||||
convert_site('https://alexschroeder.ch/wiki',
|
||||
'https://alexschroeder.ch/pics',
|
||||
'/home/alex/alexschroeder.ch/pics',
|
||||
'Alex Schroeder',
|
||||
$AdminPass);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,168 +0,0 @@
|
||||
;;; vc-oddmuse.el -- add VC support to oddmuse-curl
|
||||
;;
|
||||
;; Copyright (C) 2014 Alex Schroeder <alex@gnu.org>
|
||||
;;
|
||||
;; Latest version:
|
||||
;; http://git.savannah.gnu.org/cgit/oddmuse.git/plain/contrib/vc-oddmuse.el
|
||||
;; Discussion, feedback:
|
||||
;; http://www.emacswiki.org/cgi-bin/wiki/OddmuseCurl
|
||||
;;
|
||||
;; This program is free software: you can redistribute it and/or modify it
|
||||
;; under the terms of the GNU General Public License as published by the Free
|
||||
;; Software Foundation, either version 3 of the License, or (at your option)
|
||||
;; any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
;; more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License along
|
||||
;; with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Add the following to your init file:
|
||||
;;
|
||||
;; (add-to-list 'vc-handled-backends 'oddmuse)
|
||||
|
||||
(add-to-list 'vc-handled-backends 'oddmuse)
|
||||
|
||||
(require 'oddmuse-curl)
|
||||
(require 'diff)
|
||||
|
||||
(defun vc-oddmuse-revision-granularity () 'file)
|
||||
|
||||
(defun vc-oddmuse-registered (file)
|
||||
"Handle files in `oddmuse-directory'."
|
||||
(string-match (concat "^" (expand-file-name oddmuse-directory))
|
||||
(file-name-directory file)))
|
||||
|
||||
(defun vc-oddmuse-state (file)
|
||||
"Return the current version control state of FILE.
|
||||
For a list of possible values, see `vc-state'."
|
||||
;; Avoid downloading the current version from the wiki and comparing
|
||||
;; the text: Too much traffic!
|
||||
'edited)
|
||||
|
||||
(defun vc-oddmuse-working-revision (file)
|
||||
"The current revision based on `oddmuse-revisions'."
|
||||
(oddmuse-revision-get oddmuse-wiki oddmuse-page-name))
|
||||
|
||||
(defun vc-oddmuse-checkout-model (files)
|
||||
"No locking."
|
||||
'implicit)
|
||||
|
||||
(defun vc-oddmuse-create-repo (file)
|
||||
(error "You cannot create Oddmuse wikis using Emacs."))
|
||||
|
||||
(defun vc-oddmuse-register (files &optional rev comment)
|
||||
"This always works.")
|
||||
|
||||
(defun vc-oddmuse-revert (file &optional contents-done)
|
||||
"No idea"
|
||||
nil)
|
||||
|
||||
(defvar vc-oddmuse-log-command
|
||||
(concat "curl --silent %w"
|
||||
" --form action=rc"
|
||||
" --form showedit=1"
|
||||
" --form all=1"
|
||||
" --form from=1"
|
||||
" --form raw=1"
|
||||
" --form match='%r'")
|
||||
"Command to use for publishing index pages.
|
||||
It must print the page to stdout.
|
||||
|
||||
See `oddmuse-format-command' for the formatting options.")
|
||||
|
||||
(defun vc-oddmuse-print-log (files buffer &optional shortlog start-revision limit)
|
||||
"Load complete recent changes for the files."
|
||||
;; Derive `oddmuse-wiki' from the first file
|
||||
(with-oddmuse-file (car files)
|
||||
;; The wiki expects a Perl regular expression!
|
||||
(let ((regexp (concat "^(" (mapconcat 'file-name-nondirectory files "|") ")$")))
|
||||
(oddmuse-run "Getting recent changes" vc-oddmuse-log-command nil nil buffer)))
|
||||
(with-current-buffer buffer
|
||||
(oddmuse-render-rss3))
|
||||
'limit-unsupported)
|
||||
|
||||
(defun vc-oddmuse-log-outgoing ()
|
||||
(error "This is not supported."))
|
||||
|
||||
(defun vc-oddmuse-log-incoming ()
|
||||
(error "This is not supported."))
|
||||
|
||||
(defvar vc-oddmuse-get-revision-command
|
||||
(concat "curl --silent"
|
||||
" --form action=browse"
|
||||
" --form id=%t"
|
||||
" --form revision=%v"
|
||||
" --form raw=1"
|
||||
" '%w'")
|
||||
"Command to use to get older revisions of a page.
|
||||
It must print the page to stdout.
|
||||
|
||||
%? '?' character
|
||||
%w URL of the wiki as provided by `oddmuse-wikis'
|
||||
%t Page title as provided by `oddmuse-page-name'
|
||||
%v Revision to retrieve as provided by `oddmuse-revision'")
|
||||
|
||||
(defun oddmuse-revision-filename (rev)
|
||||
"Return filename for revision REV.
|
||||
This uses `oddmuse-directory', `wiki' and `pagename' as bound by
|
||||
`with-oddmuse-file'."
|
||||
(concat oddmuse-directory
|
||||
"/" wiki
|
||||
"/" pagename
|
||||
".~" rev "~"))
|
||||
|
||||
(defun vc-oddmuse-diff (files &optional rev1 rev2 buffer)
|
||||
"Report the differences for FILES."
|
||||
(setq buffer (or buffer (get-buffer-create "*vc-diff*")))
|
||||
(dolist (file files)
|
||||
(with-oddmuse-file file
|
||||
(setq rev1 (or rev1 (oddmuse-get-latest-revision wiki pagename)))
|
||||
(dolist (rev (list rev1 rev2))
|
||||
(when (and rev (not (file-readable-p (oddmuse-revision-filename rev))))
|
||||
(let* ((oddmuse-revision rev)
|
||||
(command vc-oddmuse-get-revision-command)
|
||||
(filename (oddmuse-revision-filename rev)))
|
||||
(with-temp-buffer
|
||||
(oddmuse-run
|
||||
(concat "Downloading revision " rev)
|
||||
command wiki pagename)
|
||||
(write-file filename)))))
|
||||
(diff-no-select
|
||||
(if rev1 (oddmuse-revision-filename rev1) file)
|
||||
(if rev2 (oddmuse-revision-filename rev2) file)
|
||||
nil
|
||||
(vc-switches 'oddmuse 'diff)
|
||||
buffer))))
|
||||
|
||||
(defun vc-oddmuse-revert (file &optional contents-done)
|
||||
"Revert FILE back to the wiki revision.
|
||||
If optional arg CONTENTS-DONE is non-nil, then nothing needs to
|
||||
be done, as the contents of FILE have already been reverted from
|
||||
a version backup."
|
||||
(unless contents-done
|
||||
(with-oddmuse-file file
|
||||
(let ((command (oddmuse-format-command vc-oddmuse-get-revision-command)))
|
||||
(with-temp-buffer
|
||||
(oddmuse-run "Loading" command)
|
||||
(write-file file))))))
|
||||
|
||||
(defun vc-oddmuse-checkin (files rev comment)
|
||||
"Commit changes in FILES to this backend.
|
||||
REV is a historical artifact and should be ignored. COMMENT is
|
||||
used as a check-in comment."
|
||||
(dolist (file files)
|
||||
(with-oddmuse-file file
|
||||
(let* ((summary comment)
|
||||
(command (oddmuse-format-command oddmuse-post-command))
|
||||
(buf (get-buffer-create " *oddmuse-response*")))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents file)
|
||||
(oddmuse-run "Posting" command wiki pagename buf t 302))))))
|
||||
|
||||
(provide 'vc-oddmuse)
|
||||
536
css/alex-2016.css
Normal file
536
css/alex-2016.css
Normal file
@@ -0,0 +1,536 @@
|
||||
/* This file is in the public domain. */
|
||||
html{ text-align: center; }
|
||||
|
||||
body, rss {
|
||||
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
|
||||
font-style: normal;
|
||||
font-size: 14pt;
|
||||
padding: 1em 3em;
|
||||
max-width: 72ex;
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
color: #000;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
/* hide all the crap */
|
||||
div.diff, div.diff+hr, div.refer, div.near, div.definition, div.sister,
|
||||
div.cal, div.footer, span.specialdays, span.gotobar, a.edit, a.number span,
|
||||
div.rc form, form.tiny, p.comment, p#plus1, div.g-plusone, div.content a.feed {
|
||||
display:none;
|
||||
}
|
||||
div.content a.book,
|
||||
div.content a.movie {
|
||||
text-decoration: none;
|
||||
}
|
||||
a cite {
|
||||
font-style: italic;
|
||||
}
|
||||
img[alt="RSS"] { display: none }
|
||||
a.rss { font-size: 8pt }
|
||||
}
|
||||
|
||||
/* headings: we can use larger sizes if we use a lighter color.
|
||||
we cannot inherit the font-family because header and footer use a narrow font. */
|
||||
|
||||
h1, h2, h3, title {
|
||||
font-family: inherit;
|
||||
font-weight: normal;
|
||||
}
|
||||
h1, channel title {
|
||||
font-size: 32pt;
|
||||
margin: 1em 0 0.5em 0;
|
||||
padding: 0.4em 0;
|
||||
}
|
||||
h2 {
|
||||
font-size: 18pt;
|
||||
margin: 2em 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
h3 {
|
||||
font-size: inherit;
|
||||
font-weight: bold;
|
||||
padding: 0;
|
||||
margin: 1em 0 0 0;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* headers in the journal are smaller */
|
||||
|
||||
div.journal h1, item title {
|
||||
font-size: inherit;
|
||||
padding: 0;
|
||||
clear: both;
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
div.journal h2 {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
div.journal h3 {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
font-style: italic;
|
||||
}
|
||||
div.journal hr {
|
||||
visibility: hidden;
|
||||
}
|
||||
p.more {
|
||||
margin-top: 3em;
|
||||
}
|
||||
/* Links in headings appear on journal pages. */
|
||||
|
||||
h1 a, h2 a, h3 a {
|
||||
color:inherit;
|
||||
text-decoration:none;
|
||||
font-weight: normal;
|
||||
}
|
||||
h1 a:visited, h2 a:visited, h3 a:visited {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
/* for download buttons and the like */
|
||||
|
||||
.button {
|
||||
display: inline-block;
|
||||
font-size: 120%;
|
||||
cursor: pointer;
|
||||
padding: 0.4em 0.6em;
|
||||
text-shadow: 0px -1px 0px #ccc;
|
||||
background-color: #cfa;
|
||||
border: 1px solid #9d8;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0px 1px 3px white inset, 0px 1px 3px black;
|
||||
}
|
||||
|
||||
.button .icon {
|
||||
color: #363;
|
||||
text-shadow: 0px -1px 1px white, 0px 1px 3px #666;
|
||||
}
|
||||
|
||||
.button a {
|
||||
text-decoration: none;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* links */
|
||||
|
||||
a.pencil {
|
||||
padding-left: 1ex;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
visibility: hidden;
|
||||
transition: visibility 0s 1s, opacity 1s linear;
|
||||
opacity: 0;
|
||||
}
|
||||
*:hover > a.pencil {
|
||||
visibility: visible;
|
||||
transition: opacity .5s linear;
|
||||
opacity: 1;
|
||||
}
|
||||
@media print {
|
||||
a.pencil {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
a.number {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* stop floating content from flowing over the footer */
|
||||
|
||||
hr {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* the distance between links in the navigation bars */
|
||||
|
||||
span.bar a {
|
||||
margin-right: 1ex;
|
||||
}
|
||||
|
||||
a img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* search box in the top bar */
|
||||
|
||||
.header form, .header p {
|
||||
display: inline;
|
||||
white-space: nowrap;
|
||||
}
|
||||
label[for="searchlang"], #searchlang, .header input[type="submit"] {
|
||||
/* don't use display: none! http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form */
|
||||
visibility: hidden; position: absolute;
|
||||
}
|
||||
/* wrap on the iphone */
|
||||
@media only screen and (max-device-width: 480px) {
|
||||
}
|
||||
|
||||
.header input {
|
||||
width: 10ex;
|
||||
}
|
||||
|
||||
/* other form fields */
|
||||
|
||||
input[type="text"] {
|
||||
padding: 0;
|
||||
font-size: 80%;
|
||||
line-height: 125%;
|
||||
}
|
||||
|
||||
/* code */
|
||||
|
||||
textarea, pre, code, tt {
|
||||
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, "Symbola";
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
pre {
|
||||
overflow:hidden;
|
||||
white-space: pre-wrap; /* CSS 3 */
|
||||
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
}
|
||||
|
||||
/* styling for divs that will be invisible when printing
|
||||
when printing. */
|
||||
|
||||
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
|
||||
|
||||
font-size: 14pt;
|
||||
}
|
||||
@media print {
|
||||
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
|
||||
font-size: 8pt;
|
||||
}
|
||||
}
|
||||
|
||||
div.footer form.search {
|
||||
display: none;
|
||||
}
|
||||
div.rc li + li {
|
||||
margin-top: 1em;
|
||||
}
|
||||
div.rc li strong, table.history strong, strong.description {
|
||||
font-family: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
div.diff {
|
||||
padding-left: 5%;
|
||||
padding-right: 5%;
|
||||
font-size: 12pt;
|
||||
color: #000;
|
||||
|
||||
}
|
||||
div.old {
|
||||
background-color: #ffffaf;
|
||||
}
|
||||
div.new {
|
||||
background-color: #cfffcf;
|
||||
}
|
||||
|
||||
div.refer {
|
||||
padding-left: 5%;
|
||||
padding-right: 5%;
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
div.message {
|
||||
background-color:#fee;
|
||||
color:#000;
|
||||
}
|
||||
|
||||
img.xml {
|
||||
border:none;
|
||||
padding:1px;
|
||||
}
|
||||
a.small img {
|
||||
max-width:300px;
|
||||
}
|
||||
a.large img {
|
||||
max-width:600px;
|
||||
}
|
||||
div.sister {
|
||||
margin-right:1ex;
|
||||
background-color:inherit;
|
||||
}
|
||||
div.sister p {
|
||||
margin-top:0;
|
||||
}
|
||||
div.sister hr {
|
||||
display:none;
|
||||
}
|
||||
div.sister img {
|
||||
border:none;
|
||||
}
|
||||
|
||||
div.near, div.definition {
|
||||
background-color:#efe;
|
||||
}
|
||||
|
||||
div.sidebar {
|
||||
float:right;
|
||||
border:1px dotted #000;
|
||||
padding:0 1em;
|
||||
}
|
||||
div.sidebar ul {
|
||||
padding-left:1em;
|
||||
}
|
||||
|
||||
/* replacements, features */
|
||||
|
||||
ins {
|
||||
font-style: italic;
|
||||
text-decoration: none;
|
||||
}
|
||||
acronym, abbr {
|
||||
letter-spacing:0.1em;
|
||||
font-variant:small-caps;
|
||||
}
|
||||
|
||||
/* Interlink prefix not shown */
|
||||
a .site, a .separator {
|
||||
display: none;
|
||||
}
|
||||
a cite { font:inherit; }
|
||||
/* browser borkage */
|
||||
textarea[name="text"] { width:97%; height:80%; }
|
||||
textarea[name="summary"] { width:97%; height:3em; }
|
||||
/* comments */
|
||||
textarea[name="aftertext"] { width:97%; height:10em; }
|
||||
div.commentshown {
|
||||
font-size: 12pt;
|
||||
padding: 2em 0;
|
||||
}
|
||||
div.commenthidden {
|
||||
display:none;
|
||||
}
|
||||
div.commentshown {
|
||||
display:block;
|
||||
}
|
||||
p.comment {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
div.comment {
|
||||
font-size: 14pt;
|
||||
}
|
||||
div.comment h2 {
|
||||
margin-top: 5em;
|
||||
}
|
||||
/* comment pages with username, homepage, and email subscription */
|
||||
.comment form span { display: block; }
|
||||
.comment form span label { display: inline-block; width: 10em; }
|
||||
/* IE sucks */
|
||||
.comment input#username,
|
||||
.comment input#homepage,
|
||||
.comment input#mail { width: 20em; }
|
||||
|
||||
/* cal */
|
||||
div.month { padding:0; margin:0 2ex; }
|
||||
body > div.month {
|
||||
float:right;
|
||||
background-color: inherit;
|
||||
border:solid thin;
|
||||
padding:0 1ex;
|
||||
}
|
||||
.year > .month {
|
||||
float:left;
|
||||
}
|
||||
.footer {
|
||||
clear:both;
|
||||
}
|
||||
.month .title a.local {
|
||||
background-color: inherit;
|
||||
}
|
||||
.month a.local {
|
||||
background-color: #ddf;
|
||||
}
|
||||
.month a.today {
|
||||
background-color: #fdd;
|
||||
}
|
||||
.month a {
|
||||
color:inherit;
|
||||
font-weight:inherit;
|
||||
text-decoration: none;
|
||||
background-color: #eee;
|
||||
}
|
||||
/* history tables and other tables */
|
||||
table.history {
|
||||
border: none;
|
||||
}
|
||||
td.history {
|
||||
border: none;
|
||||
}
|
||||
|
||||
table.user {
|
||||
border: none;
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 1em;
|
||||
margin: 1em 2em;
|
||||
}
|
||||
table.user tr td, table.user tr th {
|
||||
border: none;
|
||||
padding: 0.2em 0.5em;
|
||||
vertical-align: top;
|
||||
}
|
||||
table.arab tr th {
|
||||
font-weight:normal;
|
||||
text-align:left;
|
||||
vertical-align:top;
|
||||
}
|
||||
table.arab, table.arab tr th, table.arab tr td {
|
||||
border:none;
|
||||
}
|
||||
th.nobreak {
|
||||
white-space:nowrap;
|
||||
}
|
||||
table.full { width:99%; margin-left:1px; }
|
||||
table.j td, table.j th, table tr td.j, table tr th.j, .j { text-align:justify; }
|
||||
table.l td, table.l th, table tr td.l, table tr th.l, .l { text-align:left; }
|
||||
table.r td, table.r th, table tr td.r, table tr th.r, .r { text-align:right; }
|
||||
table.c td, table.c th, table tr td.c, table tr th.c, .c { text-align:center; }
|
||||
table.t td { vertical-align: top; }
|
||||
td.half { width:50%; }
|
||||
td.third { width:33%; }
|
||||
|
||||
form table td { padding:5px; }
|
||||
|
||||
/* lists */
|
||||
dd { padding-bottom:0.5ex; }
|
||||
dl.inside dt { float:left; }
|
||||
/* search */
|
||||
div.search span.result { font-size:larger; }
|
||||
div.search span.info { font-size:smaller; font-style:italic; }
|
||||
div.search p.result { display:none; }
|
||||
|
||||
img.logo {
|
||||
float: right;
|
||||
margin: 0 0 0 1ex;
|
||||
padding: 0;
|
||||
border: 1px solid #000;
|
||||
opacity: 0.3;
|
||||
background-color:#ffe;
|
||||
}
|
||||
|
||||
/* images */
|
||||
|
||||
div.content a.feed img, div.journal a.feed img,
|
||||
div.content a img.smiley, div.journal a img.smiley, img.smiley,
|
||||
div.content a.inline img, div.journal a.inline img,
|
||||
div.content li a.image img, div.journal li a.image img {
|
||||
margin: 0; padding: 0; border: none;
|
||||
}
|
||||
div.image a img {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
div.image span.caption {
|
||||
margin: 0 1em;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.left { float:left; margin-right: 1em; }
|
||||
.right { float:right; margin-left: 1em; }
|
||||
.half img { height: 50%; width: 50%; }
|
||||
.face img { width: 200px; }
|
||||
div.left .left, div.right .right {
|
||||
float:none;
|
||||
}
|
||||
.center { text-align:center; }
|
||||
table.aside {
|
||||
float:right;
|
||||
width:40%;
|
||||
margin-left: 1em;
|
||||
padding: 1ex;
|
||||
border: 1px dotted #666;
|
||||
}
|
||||
table.aside td {
|
||||
text-align:left;
|
||||
}
|
||||
div.sidebar {
|
||||
float:right; width: 250px;
|
||||
text-align: right;
|
||||
border: none;
|
||||
margin: 1ex;
|
||||
}
|
||||
|
||||
.bigsidebar {
|
||||
float:right;
|
||||
width: 500px;
|
||||
border: none;
|
||||
margin-left: 1ex;
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
dl.irc dt { width:20ex; float:left; text-align:right; clear:left; }
|
||||
dl.irc dt span.time { float:left; }
|
||||
dl.irc dd { margin-left:22ex; }
|
||||
|
||||
/* portrait */
|
||||
|
||||
div.footer, div.comment, hr { clear: both; }
|
||||
.portrait { float: left; font-size: small; margin-right: 1em; }
|
||||
.portrait a { color: #999; }
|
||||
|
||||
div.left { float:left; margin:1em; padding: 0.5em; }
|
||||
div.left p { display:table-cell; }
|
||||
div.left p + p { display:table-caption; caption-side:bottom; }
|
||||
|
||||
p.table a { float:left; width:20ex; }
|
||||
p.table + p { clear:both; }
|
||||
|
||||
/* rss */
|
||||
|
||||
channel * { display: block; }
|
||||
|
||||
channel title {
|
||||
margin-top: 30pt;
|
||||
}
|
||||
copyright {
|
||||
font-size: 14pt;
|
||||
margin-top: 1em;
|
||||
}
|
||||
channel > link:before {
|
||||
font-size: 18pt;
|
||||
display: block;
|
||||
margin: 1em;
|
||||
padding: 0.5em;
|
||||
content: "This is an RSS feed, designed to be read in a feed reader.";
|
||||
color: red;
|
||||
border: 1px solid red;
|
||||
}
|
||||
link, license {
|
||||
font-size: 11pt;
|
||||
margin-bottom: 9pt;
|
||||
}
|
||||
username:before { content: "Last edited by "; }
|
||||
username:after { content: "."; }
|
||||
generator:before { content: "Feed generated by "; }
|
||||
generator:after { content: "."; }
|
||||
channel description {
|
||||
font-weight: bold;
|
||||
}
|
||||
item description {
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
docs, language,
|
||||
pubDate, lastBuildDate, ttl, guid, category, comments,
|
||||
docs, image title, image link,
|
||||
status, version, diff, history, importance {
|
||||
display: none;
|
||||
}
|
||||
@@ -321,7 +321,6 @@ div.sister {
|
||||
float:left;
|
||||
margin-right:1ex;
|
||||
padding-right:1ex;
|
||||
border-right:1px dashed;
|
||||
}
|
||||
div.sister p { padding:1ex; margin:0; }
|
||||
div.sister hr { display:none; }
|
||||
|
||||
@@ -27,6 +27,10 @@ textarea, pre, code, tt {
|
||||
font-family: Times, serif;
|
||||
font-size:10pt;
|
||||
}
|
||||
/* Printing from Firefox */
|
||||
svg {
|
||||
transform: translate(-1.5cm, -1cm);
|
||||
}
|
||||
}
|
||||
|
||||
/* iPhone */
|
||||
@@ -47,9 +51,10 @@ textarea, pre, code, tt {
|
||||
.browse { min-height: 3em; }
|
||||
.header form, .header p { margin: 0; }
|
||||
/* hide the buttons but don't use display:none because of
|
||||
http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form */
|
||||
.header input[type="submit"] { position: absolute; visibility: hidden; }
|
||||
.header input { width: 5em; font-size: 80%; }
|
||||
http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form
|
||||
.header input[type="submit"] { position: absolute; visibility: hidden; } */
|
||||
.header input { width: 6em; font-size: 80%; }
|
||||
.header input[type="checkbox"] { width: 1em; }
|
||||
.footer { clear:both; font-size: 90%; }
|
||||
.content input { font-size: 80%; line-height: 125%; }
|
||||
|
||||
@@ -201,10 +206,12 @@ div.message {
|
||||
}
|
||||
table.history { border-style:none; }
|
||||
td.history { border-style:none; }
|
||||
div.history span.dash + strong { font-weight: normal; }
|
||||
span.result { font-size:larger; }
|
||||
span.info { font-size:smaller; font-style:italic; }
|
||||
div.rc hr { display: none; }
|
||||
div.rc li { padding-bottom: 0.5em; }
|
||||
div.rc li strong { font-weight: normal; }
|
||||
|
||||
/* Tables */
|
||||
table.user {
|
||||
|
||||
51
css/wiki.css
51
css/wiki.css
@@ -51,13 +51,13 @@ a.image:hover img {
|
||||
}
|
||||
|
||||
/* a.definition soll aussehen wie h2 */
|
||||
h2, p a.definition {
|
||||
h2, p > a.definition {
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* Such Link im h1 soll nicht auffallen. */
|
||||
h1, h2, h3, h4, h1 a, h1 a:visited, p a.definition {
|
||||
h1, h2, h3, h4, h1 a, h1 a:visited, p > a.definition {
|
||||
color: #666;
|
||||
font-size: 30pt;
|
||||
font-weight: normal;
|
||||
@@ -219,50 +219,3 @@ code {
|
||||
background: #eee;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Gentium Basic';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Gentium Basic Bold'), local('GentiumBasic-Bold'), url(/fonts/GenBasB.woff) format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Gentium Basic';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Gentium Basic Italic'), local('GentiumBasic-Italic'), url(/fonts/GenBasI.woff) format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Gentium Basic';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('Gentium Basic Bold Italic'), local('GentiumBasic-BoldItalic'), url(/fonts/GenBasBI.woff) format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Gentium Basic';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Gentium Basic'), local('GentiumBasic'), url(/fonts/GenBasR.woff) format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Gentium Plus';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Gentium Plus'), local('GentiumPlus'), url(/fonts/GentiumPlus-R.woff) format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Gentium Plus';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Gentium Plus Italic'), local('GentiumPlus-Italic'), url(/fonts/GentiumPlus-I.woff) format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Symbola';
|
||||
src: local('Symbola'), url('/fonts/Symbola.woff') format('woff') url('/fonts/Symbola.ttf') format('truetype');
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package OddMuse;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
@@ -44,7 +41,7 @@ sub AdminPowerDelete {
|
||||
GetCluster($Page{text}));
|
||||
}
|
||||
# Regenerate index on next request
|
||||
unlink($IndexFile);
|
||||
Unlink($IndexFile);
|
||||
ReleaseLock();
|
||||
print $q->p(T('Main lock released.'));
|
||||
PrintFooter();
|
||||
@@ -61,30 +58,30 @@ sub AdminPowerRename {
|
||||
print $q->p(T('Main lock obtained.'));
|
||||
# page file -- only check for existing or missing pages here
|
||||
my $fname = GetPageFile($id);
|
||||
ReportError(Ts('The page %s does not exist', $id), '400 BAD REQUEST') unless -f $fname;
|
||||
ReportError(Ts('The page %s does not exist', $id), '400 BAD REQUEST') unless IsFile($fname);
|
||||
my $newfname = GetPageFile($new);
|
||||
ReportError(Ts('The page %s already exists', $new), '400 BAD REQUEST') if -f $newfname;
|
||||
ReportError(Ts('The page %s already exists', $new), '400 BAD REQUEST') if IsFile($newfname);
|
||||
# Regenerate index on next request -- remove this before errors can occur!
|
||||
unlink($IndexFile);
|
||||
Unlink($IndexFile);
|
||||
# page file
|
||||
CreateDir($PageDir); # It might not exist yet
|
||||
rename($fname, $newfname)
|
||||
Rename($fname, $newfname)
|
||||
or ReportError(Tss('Cannot rename %1 to %2', $fname, $newfname) . ": $!", '500 INTERNAL SERVER ERROR');
|
||||
# keep directory
|
||||
my $kdir = GetKeepDir($id);
|
||||
my $newkdir = GetKeepDir($new);
|
||||
CreateDir($KeepDir); # It might not exist yet (only the parent directory!)
|
||||
rename($kdir, $newkdir)
|
||||
Rename($kdir, $newkdir)
|
||||
or ReportError(Tss('Cannot rename %1 to %2', $kdir, $newkdir) . ": $!", '500 INTERNAL SERVER ERROR')
|
||||
if -d $kdir;
|
||||
if IsDir($kdir);
|
||||
# refer file
|
||||
if (defined(&GetRefererFile)) {
|
||||
my $rdir = GetRefererFile($id);
|
||||
my $newrdir = GetRefererFile($new);
|
||||
CreateDir($RefererDir); # It might not exist yet
|
||||
rename($rdir, $newrdir)
|
||||
Rename($rdir, $newrdir)
|
||||
or ReportError(Tss('Cannot rename %1 to %2', $rdir, $newrdir) . ": $!", '500 INTERNAL SERVER ERROR')
|
||||
if -d $rdir;
|
||||
if IsDir($rdir);
|
||||
}
|
||||
# RecentChanges
|
||||
OpenPage($new);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -29,7 +29,7 @@ $NewQuestion = 'Write your question here:';
|
||||
|
||||
sub IncrementInFile {
|
||||
my $filename = shift;
|
||||
sysopen my $fh, $filename, O_RDWR|O_CREAT or die "can't open $filename: $!";
|
||||
sysopen my $fh, encode_utf8($filename), O_RDWR|O_CREAT or die "can't open $filename: $!";
|
||||
flock $fh, LOCK_EX or die "can't flock $filename: $!";
|
||||
my $num = <$fh> || 1;
|
||||
seek $fh, 0, 0 or die "can't rewind $filename: $!";
|
||||
|
||||
@@ -171,9 +171,9 @@ sub UserCanEditAutoLockFix {
|
||||
return 0 if $id eq 'SampleUndefinedPage' or $id eq T('SampleUndefinedPage')
|
||||
or $id eq 'Sample_Undefined_Page' or $id eq T('Sample_Undefined_Page');
|
||||
return 1 if UserIsAdmin() || UserIsEditor();
|
||||
return 0 if $id ne '' and -f GetLockedPageFile($id);
|
||||
return 0 if $LockOnCreation{$id} and not -f GetPageFile($id); # new page
|
||||
return 0 if !$EditAllowed or -f $NoEditFile;
|
||||
return 0 if $id ne '' and IsFile(GetLockedPageFile($id));
|
||||
return 0 if $LockOnCreation{$id} and not IsFile(GetPageFile($id)); # new page
|
||||
return 0 if !$EditAllowed or IsFile($NoEditFile);
|
||||
return 0 if $editing and UserIsBanned(); # this call is more expensive
|
||||
return 0 if $EditAllowed >= 2 and (not $CommentsPrefix or $id !~ /^$CommentsPrefix/);
|
||||
return 1 if $EditAllowed >= 3 and ($comment or (GetParam('aftertext', '') and not GetParam('text', '')));
|
||||
@@ -206,18 +206,17 @@ except where noted.
|
||||
|
||||
Copyleft 2008 by B.w.Curry <http://www.raiazome.com>.
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this file; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Grab MLDBM at http://search.cpan.org/dist/MLDBM/lib/MLDBM.pm
|
||||
# ie: http://search.cpan.org/CPAN/authors/id/C/CH/CHAMAS/MLDBM-2.01.tar.gz
|
||||
@@ -44,8 +41,8 @@ sub BacklinksMenu {
|
||||
$Action{buildback} = \&BuildBacklinkDatabase;
|
||||
sub BuildBacklinkDatabase {
|
||||
print GetHttpHeader('text/plain');
|
||||
unlink $backfile; # Remove old database
|
||||
tie my %backhash, 'MLDBM', $backfile or die "Cannot open file $backfile $!\n";
|
||||
Unlink($backfile); # Remove old database
|
||||
tie my %backhash, 'MLDBM', encode_utf8($backfile) or die "Cannot open file $backfile $!\n";
|
||||
log1("Starting Database Store Process ... please wait\n\n");
|
||||
|
||||
foreach my $name (AllPagesList()) {
|
||||
@@ -101,7 +98,7 @@ sub GetBackLink {
|
||||
|
||||
our ($BacklinkBanned);
|
||||
$BacklinkBanned = "HomePage|ScratchPad" if !$BacklinkBanned;
|
||||
tie my %backhash, 'MLDBM', $backfile, O_CREAT|O_RDWR, oct(644) or die "Cannot open file $backfile $!\n";
|
||||
tie my %backhash, 'MLDBM', encode_utf8($backfile), O_CREAT|O_RDWR, oct(644) or die "Cannot open file $backfile $!\n";
|
||||
|
||||
# Search database for matches
|
||||
while ( my ($source, $hashes) = each %backhash ) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2013 Alex Schroeder <alex@gnu.org>
|
||||
# Copyright (C) 2013-2016 Alex Schroeder <alex@gnu.org>
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
@@ -21,11 +21,12 @@ compared to the list of regular expressions on the C<BannedHosts> page
|
||||
(see C<$BannedHosts>). If the contributor is already banned, this is
|
||||
mentioned. If the contributor is not banned, you'll see a button
|
||||
allowing you to ban him or her immediately. If you click the button,
|
||||
the IP or hostname will be added to the C<BannedHosts> page for you.
|
||||
the IP will be added to the C<BannedHosts> page for you.
|
||||
|
||||
=cut
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
our ($q, $Now, %Page, $OpenPageName, %Action, $UrlPattern, $BannedContent, $BannedHosts, @MyAdminCode);
|
||||
|
||||
AddModuleDescription('ban-contributors.pl', 'Ban Contributors Extension');
|
||||
@@ -56,17 +57,18 @@ sub IsItBanned {
|
||||
sub DoBanHosts {
|
||||
my $id = shift;
|
||||
my $content = GetParam('content', '');
|
||||
my $host = GetParam('host', '');
|
||||
my $range = GetParam('range', '');
|
||||
my $regexp = GetParam('regexp', '');
|
||||
if ($content) {
|
||||
SetParam('text', GetPageContent($BannedContent)
|
||||
. $content . " # " . CalcDay($Now) . " "
|
||||
. NormalToFree($id) . "\n");
|
||||
SetParam('summary', NormalToFree($id));
|
||||
DoPost($BannedContent);
|
||||
} elsif ($host) {
|
||||
$host =~ s/\./\\./g;
|
||||
} elsif ($regexp) {
|
||||
SetParam('text', GetPageContent($BannedHosts)
|
||||
. "^" . $host . " # " . CalcDay($Now) . " "
|
||||
. $regexp . " # " . CalcDay($Now)
|
||||
. " $range "
|
||||
. NormalToFree($id) . "\n");
|
||||
SetParam('summary', NormalToFree($id));
|
||||
DoPost($BannedHosts);
|
||||
@@ -94,10 +96,14 @@ sub DoBanHosts {
|
||||
if (IsItBanned($_, \@regexps)) {
|
||||
print $q->p(Ts("%s is banned", $name));
|
||||
} else {
|
||||
my ($start, $end) = BanContributors::get_range($_);
|
||||
$range = "[$start - $end]";
|
||||
$name .= " " . $range;
|
||||
print GetFormStart(undef, 'get', 'ban'),
|
||||
GetHiddenValue('action', 'ban'),
|
||||
GetHiddenValue('id', $id),
|
||||
GetHiddenValue('host', $_),
|
||||
GetHiddenValue('range', $range),
|
||||
GetHiddenValue('regexp', BanContributors::get_regexp_ip($start, $end)),
|
||||
GetHiddenValue('recent_edit', 'on'),
|
||||
$q->p($name, $q->submit(T('Ban!'))), $q->end_form();
|
||||
}
|
||||
@@ -158,3 +164,95 @@ sub NewBanContributorsWriteRcLog {
|
||||
};
|
||||
return OldBanContributorsWriteRcLog(@_);
|
||||
}
|
||||
|
||||
package BanContributors;
|
||||
use Net::Whois::Parser qw/parse_whois/;
|
||||
|
||||
sub get_range {
|
||||
my $ip = shift;
|
||||
my $response = parse_whois(domain => $ip);
|
||||
my ($start, $end);
|
||||
my $re = '(?:[0-9]{1,3}\.){3}[0-9]{1,3}';
|
||||
my ($start, $end) = $response->{inetnum} =~ /($re) *- *($re)/;
|
||||
return $start, $end;
|
||||
}
|
||||
|
||||
sub get_groups {
|
||||
my ($from, $to) = @_;
|
||||
my @groups;
|
||||
if ($from < 10) {
|
||||
my $to = $to >= 10 ? 9 : $to;
|
||||
push(@groups, [$from, $to]);
|
||||
$from = $to + 1;
|
||||
}
|
||||
while ($from < $to) {
|
||||
my $to = int($from/100) < int($to/100) ? $from + 99 - $from % 100 : $to;
|
||||
if ($from % 10) {
|
||||
push(@groups, [$from, $from + 9 - $from % 10]);
|
||||
$from += 10 - $from % 10;
|
||||
}
|
||||
if (int($from/10) < int($to/10)) {
|
||||
if ($to % 10 == 9) {
|
||||
push(@groups, [$from, $to]);
|
||||
$from = 1 + $to;
|
||||
} else {
|
||||
push(@groups, [$from, $to - 1 - $to % 10]);
|
||||
$from = $to - $to % 10;
|
||||
}
|
||||
} else {
|
||||
push(@groups, [$from - $from % 10, $to]);
|
||||
last;
|
||||
}
|
||||
if ($to % 10 != 9) {
|
||||
push(@groups, [$from, $to]);
|
||||
$from = 1 + $to; # jump from 99 to 100
|
||||
}
|
||||
}
|
||||
return \@groups;
|
||||
}
|
||||
|
||||
sub get_regexp_range {
|
||||
my @chars;
|
||||
for my $group (@{get_groups(@_)}) {
|
||||
my ($from, $to) = @$group;
|
||||
my $char;
|
||||
for (my $i = length($from); $i >= 1; $i--) {
|
||||
if (substr($from, - $i, 1) eq substr($to, - $i, 1)) {
|
||||
$char .= substr($from, - $i, 1);
|
||||
} else {
|
||||
$char .= '[' . substr($from, - $i, 1) . '-' . substr($to, - $i, 1). ']';
|
||||
}
|
||||
}
|
||||
push(@chars, $char);
|
||||
}
|
||||
return join('|', @chars);
|
||||
}
|
||||
|
||||
sub get_regexp_ip {
|
||||
my ($from, $to) = @_;
|
||||
my @start = split(/\./, $from);
|
||||
my @end = split(/\./, $to);
|
||||
my $regexp = "^";
|
||||
for my $i (0 .. 3) {
|
||||
if ($start[$i] eq $end[$i]) {
|
||||
$regexp .= $start[$i];
|
||||
} elsif ($start[$i] eq '0' and $end[$i] eq '255') {
|
||||
last;
|
||||
} elsif ($start[$i + 1] > 0) {
|
||||
$regexp .= '(' . $start[$i] . '\.('
|
||||
. get_regexp_range($start[$i + 1], '255') . ')|'
|
||||
. get_regexp_range($start[$i] + 1, $end[$i + 1]) . ')';
|
||||
$regexp .= '\.';
|
||||
last;
|
||||
} else {
|
||||
$regexp .= '(' . get_regexp_range($start[$i], $end[$i]) . ')$';
|
||||
last;
|
||||
}
|
||||
$regexp .= '\.' if $i < 3;
|
||||
}
|
||||
return $regexp;
|
||||
}
|
||||
|
||||
# this is required in case we concatenate other modules to this one
|
||||
package OddMuse;
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ This extension works with logbannedcontent.pl.
|
||||
|
||||
=cut
|
||||
|
||||
our (%AdminPages, %LockOnCreation, @MyInitVariables, %PlainTextPages, $BannedContent, $BannedFile);
|
||||
our (%AdminPages, %LockOnCreation, @MyInitVariables, %PlainTextPages, $BannedContent, $BannedFile,
|
||||
$FullUrlPattern);
|
||||
our ($BannedRegexps);
|
||||
|
||||
$BannedRegexps = 'BannedRegexps';
|
||||
@@ -61,6 +62,8 @@ push(@MyInitVariables, sub {
|
||||
|
||||
sub RegexpNewBannedContent {
|
||||
my $str = shift;
|
||||
# remove URLs as they are controlled by $BannedContent
|
||||
$str =~ s/$FullUrlPattern//g;
|
||||
my $rule = RegexpOldBannedContent($str, @_);
|
||||
if (not $rule) {
|
||||
foreach (split(/\n/, GetPageContent($BannedRegexps))) {
|
||||
|
||||
@@ -19,7 +19,7 @@ AddModuleDescription('bbcode.pl', 'bbCode Extension');
|
||||
|
||||
our ($q, @HtmlStack, @MyRules, %RuleOrder, $UrlProtocols, $FullUrlPattern);
|
||||
push(@MyRules, \&bbCodeRule);
|
||||
$RuleOrder{\&bbCodeRule} = 100; # must come after PortraitSupportRule
|
||||
$RuleOrder{\&bbCodeRule} = 300; # must come after PortraitSupportRule, MarkdownRule
|
||||
|
||||
our ($bbBlock);
|
||||
my %bbTitle = qw(h1 1 h2 1 h3 1 h4 1 h5 1 h6 1);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
@@ -26,6 +23,7 @@ our ($q, %Page, %Action, $Now, $OpenPageName, $CollectingJournal, $FreeLinkPatte
|
||||
our ($CalendarOnEveryPage, $CalAsTable, $CalStartMonday);
|
||||
|
||||
$CalendarOnEveryPage = 0; # 1=on every page is a month-div situated in the header, use css to control
|
||||
# 2=this month and the previous month; 3=this, previous and next month
|
||||
$CalAsTable = 0; # 0=every month-div is "free", 1=every month-div is caught in a table, use css to control
|
||||
$CalStartMonday = 0; # 0=week starts with Su, 1=week starts with Mo
|
||||
|
||||
@@ -37,8 +35,22 @@ sub NewCalendarGetHeader {
|
||||
return $header unless $CalendarOnEveryPage;
|
||||
my $action = GetParam('action', 'browse');
|
||||
return $header if grep(/^$action$/, ('calendar', 'edit'));
|
||||
my $cal = Cal();
|
||||
$header =~ s/<div class="header">/$cal<div class="header">/;
|
||||
my $cal;
|
||||
my ($sec, $min, $hour, $mday, $mon, $year) = localtime($Now);
|
||||
$year += 1900;
|
||||
# $mon is 0 based and thus good for previous month
|
||||
if ($mon < 1) { $year -= 1; $mon += 12; };
|
||||
$cal .= Cal($year, $mon) if $CalendarOnEveryPage > 1;
|
||||
# the current month
|
||||
$mon += 1;
|
||||
if ($mon > 12) { $year += 1; $mon -= 12; };
|
||||
$cal .= Cal($year, $mon) if $CalendarOnEveryPage;
|
||||
# the next month
|
||||
$mon += 1;
|
||||
if ($mon > 12) { $year += 1; $mon -= 12; };
|
||||
$cal .= Cal($year, $mon) if $CalendarOnEveryPage > 2;
|
||||
# insert calendars before header div
|
||||
$header =~ s!<div class="header">!<div class="cal">$cal</div><div class="header">!;
|
||||
return $header;
|
||||
}
|
||||
|
||||
@@ -88,7 +100,7 @@ sub Cal {
|
||||
$year_text, 'local collection year'));
|
||||
}
|
||||
}}e;
|
||||
return "<div class=\"cal month\"><pre>$cal</pre></div>";
|
||||
return "<div class=\"month\"><pre>$cal</pre></div>";
|
||||
}
|
||||
|
||||
$Action{collect} = \&DoCollect;
|
||||
@@ -129,7 +141,7 @@ sub CalendarRule {
|
||||
my $oldpos = pos;
|
||||
Clean(CloseHtmlEnvironments());
|
||||
Dirty($1);
|
||||
print Cal($2, $3);
|
||||
print $q->div({-class => 'cal'}, Cal($2, $3));
|
||||
pos = $oldpos;
|
||||
return AddHtmlEnvironment('p');
|
||||
} elsif (/\G(month:([+-]\d\d?))/cg
|
||||
@@ -144,7 +156,7 @@ sub CalendarRule {
|
||||
$mon += 1 + $delta;
|
||||
while ($mon < 1) { $year -= 1; $mon += 12; };
|
||||
while ($mon > 12) { $year += 1; $mon -= 12; };
|
||||
print Cal($year, $mon, undef, $id);
|
||||
print $q->div({-class => 'cal'}, Cal($year, $mon, undef, $id));
|
||||
pos = $oldpos;
|
||||
return AddHtmlEnvironment('p');
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,8 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
use utf8;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
|
||||
@@ -1,34 +1,35 @@
|
||||
# Copyright (C) 2005 Fletcher T. Penney <fletcher@freeshell.org>
|
||||
# Copyright (C) 2016 Alex Schroeder <alex@gnu.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 3 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
#
|
||||
# This module stores additional information about a page when it is
|
||||
# first created:
|
||||
# created = the date the page is FIRST saved
|
||||
# originalAuthor = the username that first created a page
|
||||
#
|
||||
# Of course, you can customize this to store more information
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
=head1 Creation Date Extension
|
||||
|
||||
This module stores additional information about a page when it is first created:
|
||||
|
||||
=over
|
||||
=item C<created> is the date the page is first saved
|
||||
=item C<originalAuthor> is the username that first created a page
|
||||
=back
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('creationdate.pl', 'CreationDate Module');
|
||||
|
||||
our (%Page, $Now);
|
||||
our (%Page, $Now, @MyAdminCode, %Action, $q, $FS, $RcOldFile, $RcFile);
|
||||
|
||||
*CreationDateOldOpenPage = \&OpenPage;
|
||||
*OpenPage = \&CreationDateOpenPage;
|
||||
@@ -39,3 +40,45 @@ sub CreationDateOpenPage{
|
||||
$Page{originalAuthor} = GetParam('username','') unless $Page{originalAuthor}
|
||||
or $Page{revision};
|
||||
}
|
||||
|
||||
# Allow administrators to add the 'created' item to page files, based on rc log
|
||||
# files.
|
||||
|
||||
push(@MyAdminCode, \&CreationDateMenu);
|
||||
|
||||
sub CreationDateMenu {
|
||||
my ($id, $menuref, $restref) = @_;
|
||||
push(@$menuref,
|
||||
ScriptLink('action=add-creation-date',
|
||||
T('Add creation date to page files'),
|
||||
'creationdate')) if UserIsAdmin();
|
||||
}
|
||||
|
||||
$Action{'add-creation-date'} = \&AddCreationDate;
|
||||
|
||||
sub AddCreationDate {
|
||||
print GetHeader('', T('Add creation date to page files'));
|
||||
print $q->start_div({-class=>'creationdate'});
|
||||
print '<ul>';
|
||||
RequestLockOrError();
|
||||
for my $file ($RcOldFile, $RcFile) {
|
||||
open(my $F, '<:encoding(UTF-8)', encode_utf8($file)) or next;
|
||||
while (my $line = <$F>) {
|
||||
chomp($line);
|
||||
my ($ts, $id, $minor, $summary, $host, $username, $revision)
|
||||
= split(/$FS/, $line);
|
||||
next unless $revision == 1;
|
||||
print $q->li(NormalToFree($id));
|
||||
OpenPage($id);
|
||||
next unless $Page{revision}; # skip if page no longer exists
|
||||
next if $Page{created} and $Page{originalAuthor};
|
||||
$Page{created} = $ts unless $Page{created};
|
||||
$Page{originalAuthor} = $username unless $Page{originalAuthor};
|
||||
SavePage();
|
||||
}
|
||||
}
|
||||
ReleaseLock();
|
||||
print '</ul>';
|
||||
print $q->end_div();
|
||||
PrintFooter();
|
||||
}
|
||||
|
||||
@@ -405,8 +405,7 @@ sub CreoleRule {
|
||||
if ($is_left_justified and
|
||||
$is_right_justified) { $attributes .= 'align="center"' }
|
||||
elsif ($is_right_justified) { $attributes .= 'align="right"' }
|
||||
# this is the default:
|
||||
# elsif ($is_left_justified) { $attributes .= 'align="left"' }
|
||||
elsif ($is_left_justified) { $attributes .= 'align="left"' }
|
||||
|
||||
return
|
||||
(InElement('td') || InElement('th') ? CloseHtmlEnvironmentUntil('tr') : '')
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -77,8 +77,7 @@ sub DoUnifiedDiff { # copied from DoDiff
|
||||
RequestLockDir('diff') or return '';
|
||||
WriteStringToFile($oldName, $_[0]);
|
||||
WriteStringToFile($newName, $_[1]);
|
||||
my $diff_out = `diff -U 99999 -- \Q$oldName\E \Q$newName\E | tail -n +7`; # should be +4, but we always add extra line # TODO that workaround is ugly, fix it!
|
||||
utf8::decode($diff_out); # needs decoding
|
||||
my $diff_out = decode_utf8(`diff -U 99999 -- \Q$oldName\E \Q$newName\E | tail -n +7`); # should be +4, but we always add extra line # TODO that workaround is ugly, fix it!
|
||||
$diff_out =~ s/\n\K\\ No newline.*\n//g; # Get rid of common complaint.
|
||||
ReleaseLockDir('diff');
|
||||
# No need to unlink temp files--next diff will just overwrite.
|
||||
|
||||
49
modules/ditaa.pl
Normal file
49
modules/ditaa.pl
Normal file
@@ -0,0 +1,49 @@
|
||||
#! /usr/bin/perl
|
||||
# Copyright (C) 2015–2017 Alex Schroeder <alex@gnu.org>
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, either version 3 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('ditaa.pl', 'Ditaa for Diagrams');
|
||||
|
||||
our ($q, $bol, @MyRules, @KnownLocks, $TempDir);
|
||||
|
||||
push (@MyRules, \&DitaaRule);
|
||||
push(@KnownLocks, 'diagram');
|
||||
|
||||
sub DitaaRule {
|
||||
if ($bol && m/\G<diagram(\s+style=".*")?>\n((.*\n)+)<\/diagram>/cg) {
|
||||
return "MIME::Base64 not installed" unless eval { require MIME::Base64; };
|
||||
my $style = $1;
|
||||
my $map = UnquoteHtml($2);
|
||||
RequestLockDir('diagram', undef, undef, 1);
|
||||
WriteStringToFile("$TempDir/diagram.txt", $map);
|
||||
$ENV{LANG}='en_US.UTF-8'; # Java needs Locale to match as well!
|
||||
my $output = `ditaa "$TempDir/diagram.txt" "$TempDir/diagram.png"`;
|
||||
my $image = '';
|
||||
# not UTF-8 layer!
|
||||
if (open(IN, '<', "$TempDir/diagram.png")) {
|
||||
local $/ = undef; # Read complete files
|
||||
$image = <IN>;
|
||||
close IN;
|
||||
}
|
||||
ReleaseLockDir('diagram');
|
||||
my $data = MIME::Base64::encode_base64($image);
|
||||
my $url = "data:image/png;base64,$data";
|
||||
return CloseHtmlEnvironments()
|
||||
. "<div$style>" . $q->img({-src=>$url, -alt=>$map}) . "</div>";
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This module offers the user the additional possibility to
|
||||
# edit a page by double-clicking on it. The user must have
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -29,7 +29,7 @@ push(@MyInitVariables, \&DraftInit);
|
||||
sub DraftInit {
|
||||
if (GetParam('Draft', '')) {
|
||||
SetParam('action', 'draft') ; # Draft button used
|
||||
} elsif (-f "$DraftDir/" . GetParam('username', $q->remote_addr()) # draft exists
|
||||
} elsif (IsFile("$DraftDir/" . GetParam('username', $q->remote_addr())) # draft exists
|
||||
and $FooterNote !~ /action=draft/) { # take care of mod_perl persistence
|
||||
$FooterNote = $q->p(ScriptLink('action=draft', T('Recover Draft'))) . $FooterNote;
|
||||
}
|
||||
@@ -47,9 +47,9 @@ sub DoDraft {
|
||||
WriteStringToFile($draft, EncodePage(text=>$text, id=>$id));
|
||||
SetParam('msg', T('Draft saved')); # invalidate cache
|
||||
print GetHttpHeader('', T('Draft saved'), '204 NO CONTENT');
|
||||
} elsif (-f $draft) {
|
||||
} elsif (IsFile($draft)) {
|
||||
my $data = ParseData(ReadFileOrDie($draft));
|
||||
unlink ($draft);
|
||||
Unlink($draft);
|
||||
$Message .= $q->p(T('Draft recovered'));
|
||||
DoEdit($data->{id}, $data->{text}, 1);
|
||||
} else {
|
||||
@@ -76,22 +76,19 @@ push(@MyMaintenance, \&DraftCleanup);
|
||||
|
||||
sub DraftFiles {
|
||||
return map {
|
||||
my $x = $_;
|
||||
$x = substr($x, length($DraftDir) + 1);
|
||||
utf8::decode($x);
|
||||
$x;
|
||||
} bsd_glob("$DraftDir/*"), bsd_glob("$DraftDir/.*");
|
||||
substr($_, length($DraftDir) + 1);
|
||||
} Glob("$DraftDir/*"), Glob("$DraftDir/.*");
|
||||
}
|
||||
|
||||
sub DraftCleanup {
|
||||
print '<p>' . T('Draft Cleanup');
|
||||
foreach my $draft (DraftFiles()) {
|
||||
next if $draft eq '.' or $draft eq '..';
|
||||
my $ts = (stat("$DraftDir/$draft"))[9];
|
||||
my $ts = Modified("$DraftDir/$draft");
|
||||
if ($Now - $ts < 1209600) { # 14*24*60*60
|
||||
print $q->br(), Tss("%1 was last modified %2 and was kept",
|
||||
$draft, CalcTimeSince($Now - $ts));
|
||||
} elsif (unlink("$DraftDir/$draft")) {
|
||||
} elsif (Unlink("$DraftDir/$draft")) {
|
||||
print $q->br(), Tss("%1 was last modified %2 and was deleted",
|
||||
$draft, CalcTimeSince($Now - $ts));
|
||||
} else {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Makes the wiki logo depend on the current date.
|
||||
#
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -9,10 +9,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This module creates a list of all questions on the page, e.g.
|
||||
# for a faq. It does so by recognizing all lines that begin with
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA,
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -27,8 +27,7 @@ sub FixEncoding {
|
||||
ValidIdOrDie($id);
|
||||
RequestLockOrError();
|
||||
OpenPage($id);
|
||||
my $text = $Page{text};
|
||||
utf8::decode($text);
|
||||
my $text = decode_utf8($Page{text});
|
||||
Save($id, $text, T('Fix character encoding'), 1) if $text ne $Page{text};
|
||||
ReleaseLock();
|
||||
ReBrowsePage($id);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -12,8 +12,8 @@ our ($q, $OpenPageName, @MyRules, $CrossbarPageName);
|
||||
push(@MyRules, \&FormsRule);
|
||||
|
||||
sub FormsRule {
|
||||
if (-f GetLockedPageFile($OpenPageName) or (InElement('div', '^class="crossbar"$') and
|
||||
-f GetLockedPageFile($CrossbarPageName))) {
|
||||
if (IsFile(GetLockedPageFile($OpenPageName)) or (InElement('div', '^class="crossbar"$') and
|
||||
IsFile(GetLockedPageFile($CrossbarPageName)))) {
|
||||
if (/\G(\<form.*?\<\/form\>)/cgs) {
|
||||
my $form = $1;
|
||||
my $oldpos = pos;
|
||||
|
||||
@@ -163,8 +163,7 @@ sub GdSecurityImageGenerate {
|
||||
my ($imgData) = $img->out(force => 'png');
|
||||
my $ticketId = Digest::MD5::md5_hex(rand());
|
||||
CreateDir($GdSecurityImageDir);
|
||||
my $file = GdSecurityImageGetImageFile($ticketId);
|
||||
open my $fh, ">:raw", $file
|
||||
open my $fh, ">:raw", encode_utf8(GdSecurityImageGetImageFile($ticketId))
|
||||
or ReportError(Ts('Image storing failed. (%s)', $!), '500 INTERNAL SERVER ERROR');
|
||||
print $fh $imgData;
|
||||
#print $fh $png; ### experimental ###
|
||||
@@ -187,9 +186,7 @@ sub GdSecurityImageIsValidId {
|
||||
}
|
||||
|
||||
sub GdSecurityImageReadImageFile {
|
||||
my $file = shift;
|
||||
utf8::encode($file); # filenames are bytes!
|
||||
if (open(my $IN, '<:raw', $file)) {
|
||||
if (open(my $IN, '<:raw', encode_utf8(shift))) {
|
||||
local $/ = undef; # Read complete files
|
||||
my $data=<$IN>;
|
||||
close $IN;
|
||||
@@ -211,7 +208,7 @@ sub GdSecurityImageDoImage {
|
||||
print $q->header(-type=>'image/png');
|
||||
print $data;
|
||||
|
||||
unlink(GdSecurityImageGetImageFile($id));
|
||||
Unlink(GdSecurityImageGetImageFile($id));
|
||||
}
|
||||
|
||||
sub GdSecurityImageCleanup {
|
||||
@@ -219,10 +216,10 @@ sub GdSecurityImageCleanup {
|
||||
if (!GdSecurityImageIsValidId($id)) {
|
||||
return;
|
||||
}
|
||||
my @files = (bsd_glob("$GdSecurityImageDir/*.png"), bsd_glob("$GdSecurityImageDir/*.ticket"));
|
||||
my @files = (Glob("$GdSecurityImageDir/*.png"), Glob("$GdSecurityImageDir/*.ticket"));
|
||||
foreach my $file (@files) {
|
||||
if ($Now - (stat $file)[9] > $GdSecurityImageDuration) {
|
||||
unlink($file);
|
||||
if ($Now - Modified($file) > $GdSecurityImageDuration) {
|
||||
Unlink($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -255,7 +252,7 @@ sub GdSecurityImageCheck {
|
||||
}
|
||||
|
||||
if (GdSecurityImageIsValidId($id)) {
|
||||
unlink(GdSecurityImageGetTicketFile($id));
|
||||
Unlink(GdSecurityImageGetTicketFile($id));
|
||||
}
|
||||
|
||||
$GdSecurityImageId = GdSecurityImageGenerate();
|
||||
|
||||
@@ -30,18 +30,18 @@ $GitMail = 'unknown@oddmuse.org';
|
||||
sub GitCommit {
|
||||
my ($message, $author) = @_;
|
||||
my $oldDir = cwd;
|
||||
chdir("$DataDir/page");
|
||||
ChangeDir("$DataDir/page");
|
||||
capture {
|
||||
system($GitBinary, qw(add -A));
|
||||
system($GitBinary, qw(commit -q -m), $message, "--author=$author <$GitMail>");
|
||||
};
|
||||
chdir($oldDir);
|
||||
ChangeDir($oldDir);
|
||||
}
|
||||
|
||||
sub GitInitRepository {
|
||||
return if -d "$DataDir/page/.git";
|
||||
return if IsDir("$DataDir/page/.git");
|
||||
capture {
|
||||
system($GitBinary, qw(init -q --), "$DataDir/page");
|
||||
system($GitBinary, qw(init -q --), encode_utf8("$DataDir/page"));
|
||||
};
|
||||
GitCommit('Initial import', 'Oddmuse');
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ sub GitRun {
|
||||
my $exitStatus;
|
||||
# warn join(' ', $GitBinary, @_) . "\n";
|
||||
|
||||
chdir($GitRepo);
|
||||
ChangeDir($GitRepo);
|
||||
if ($GitDebug) {
|
||||
# TODO use ToString here
|
||||
# capture the output of the git comand in a temporary file
|
||||
@@ -99,7 +99,7 @@ sub GitRun {
|
||||
} else {
|
||||
$exitStatus = system($GitBinary, @_);
|
||||
}
|
||||
chdir($oldDir);
|
||||
ChangeDir($oldDir);
|
||||
return $exitStatus;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ sub GitInitVariables {
|
||||
}
|
||||
|
||||
sub GitInitRepository {
|
||||
return if -d "$GitRepo/.git";
|
||||
return if IsDir("$GitRepo/.git");
|
||||
my $exception = shift;
|
||||
CreateDir($GitRepo);
|
||||
GitRun(qw(init --quiet));
|
||||
@@ -187,17 +187,16 @@ sub DoGitCleanup {
|
||||
}
|
||||
|
||||
sub GitCleanup {
|
||||
if (-d $GitRepo) {
|
||||
if (IsDir($GitRepo)) {
|
||||
print $q->p('Git cleanup starting');
|
||||
AllPagesList();
|
||||
# delete all the files including all the files starting with a dot
|
||||
opendir(DIR, $GitRepo) or ReportError("cannot open directory $GitRepo: $!");
|
||||
opendir(DIR, encode_utf8($GitRepo)) or ReportError("cannot open directory $GitRepo: $!");
|
||||
foreach my $file (readdir(DIR)) {
|
||||
my $name = $file;
|
||||
utf8::decode($name); # filenames are bytes
|
||||
my $name = decode_utf8($file);
|
||||
next if $file eq '.git' or $file eq '.' or $file eq '..' or $IndexHash{$name};
|
||||
print $q->p("Deleting left over file $name");
|
||||
unlink "$GitRepo/$file" or ReportError("cannot delete $GitRepo/$name: $!");
|
||||
Unlink("$GitRepo/$file") or print $q->p("Cannot delete $GitRepo/$name: $!");
|
||||
}
|
||||
closedir DIR;
|
||||
# write all the files again, just to be sure
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright (C) 2006-2014 Alex Schroeder <alex@gnu.org>
|
||||
# Copyright (C) 2016 Ingo Belka
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
@@ -25,6 +26,9 @@ our ($GotobarName);
|
||||
|
||||
$GotobarName = 'GotoBar';
|
||||
|
||||
our ($GotobarSetHome, $GotobarSetRC);
|
||||
# 0 does set home-link and/or rc-link automatically, 1 doesn't
|
||||
|
||||
# do this later so that the user can customize $GotobarName
|
||||
push(@MyInitVariables, \&GotobarInit);
|
||||
|
||||
@@ -53,10 +57,10 @@ sub GotobarInit {
|
||||
# is the list of recent changes.
|
||||
$count++;
|
||||
if ($count == 1) {
|
||||
$HomePage = FreeToNormal($page);
|
||||
} elsif ($count == 2) {
|
||||
$RCName = FreeToNormal($page);
|
||||
}
|
||||
unless ($GotobarSetHome) {$HomePage = FreeToNormal($page)};
|
||||
} elsif ($count == 2) {
|
||||
unless ($GotobarSetRC) {$RCName = FreeToNormal($page);}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
@@ -43,7 +40,7 @@ sub HtmlTemplate {
|
||||
my $type = shift;
|
||||
# return header.de.html, or header.html, or error.html, or report an error...
|
||||
foreach my $f ((map { "$type.$_" } HtmlTemplateLanguage()), $type, "error") {
|
||||
return "$HtmlTemplateDir/$f.html" if -r "$HtmlTemplateDir/$f.html";
|
||||
return "$HtmlTemplateDir/$f.html" if IsFile("$HtmlTemplateDir/$f.html");
|
||||
}
|
||||
ReportError(Tss('Could not find %1.html template in %2', $type, $HtmlTemplateDir),
|
||||
'500 INTERNAL SERVER ERROR');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -14,10 +14,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This module offers the possibility to restrict viewing of "hidden"
|
||||
# pages to only editors or admins. The restriction may be based
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
@@ -87,7 +84,7 @@ sub GetActionHtmlTemplate {
|
||||
my $action = GetParam('action', 'browse');
|
||||
# return browse.de.html, or browse.html, or error.html, or report an error...
|
||||
foreach my $f ((map { "$action.$_" } HtmlTemplateLanguage()), $action, "error") {
|
||||
return "$HtmlTemplateDir/$f.html" if -r "$HtmlTemplateDir/$f.html";
|
||||
return "$HtmlTemplateDir/$f.html" if IsFile("$HtmlTemplateDir/$f.html");
|
||||
}
|
||||
ReportError(Tss('Could not find %1.html template in %2', $action, $HtmlTemplateDir),
|
||||
'500 INTERNAL SERVER ERROR');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
@@ -31,7 +28,7 @@ push(@MyRules, \&HtmlLinksRule);
|
||||
$RuleOrder{\&HtmlLinksRule} = 105;
|
||||
|
||||
sub HtmlLinksRule {
|
||||
if (-f GetLockedPageFile($OpenPageName)) {
|
||||
if (IsFile(GetLockedPageFile($OpenPageName))) {
|
||||
$HtmlLinks = 1;
|
||||
} else {
|
||||
$HtmlLinks = 0;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -32,7 +32,7 @@ sub DivFooRule {
|
||||
my $str = $1;
|
||||
CreateDir($ImagifyDir);
|
||||
my $fileName = sha256_hex($str) . '.' . $ImagifyFormat;
|
||||
system('convert', %ImagifyParams, "caption:$str", "$ImagifyDir/$fileName") unless -e "$ImagifyDir/$fileName";
|
||||
system('convert', %ImagifyParams, "caption:$str", "$ImagifyDir/$fileName") unless IsFile("$ImagifyDir/$fileName");
|
||||
my $src = $ScriptName . "/imagify/" . UrlEncode($fileName);
|
||||
return CloseHtmlEnvironments() . $q->img({-class => 'imagify', -src => $src, -alt => '(rendered text)'}) . AddHtmlEnvironment('p');
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# In your CSS file, use something like this, for example:
|
||||
|
||||
|
||||
@@ -131,8 +131,8 @@ sub MakeLaTeX {
|
||||
|
||||
# Select which binary to use for conversion of dvi to images
|
||||
my $useConvert = 0;
|
||||
if (not -e $dvipngPath) {
|
||||
if (not -e $convertPath) {
|
||||
if (not IsFile($dvipngPath)) {
|
||||
if (not IsFile($convertPath)) {
|
||||
return "[Error: dvipng binary and convert binary not found at $dvipngPath or $convertPath ]";
|
||||
}
|
||||
else {
|
||||
@@ -155,13 +155,13 @@ sub MakeLaTeX {
|
||||
}
|
||||
|
||||
# check cache
|
||||
if (not -f "$LatexDir/$hash.png" or -z "$LatexDir/$hash.png") { #If file doesn't exist or is zero bytes
|
||||
if (not IsFile("$LatexDir/$hash.png") or ZeroSize("$LatexDir/$hash.png")) {
|
||||
# Then create the image
|
||||
|
||||
# read template and replace <math>
|
||||
mkdir($LatexDir) unless -d $LatexDir;
|
||||
if (not -f $LatexDefaultTemplateName) {
|
||||
open (my $F, '>', $LatexDefaultTemplateName) or return '[Unable to write template]';
|
||||
CreateDir($LatexDir);
|
||||
if (not IsFile($LatexDefaultTemplateName)) {
|
||||
open (my $F, '>', encode_utf8($LatexDefaultTemplateName)) or return '[Unable to write template]';
|
||||
print $F $LatexDefaultTemplate;
|
||||
close $F;
|
||||
}
|
||||
@@ -169,12 +169,12 @@ sub MakeLaTeX {
|
||||
$template =~ s/<math>/$latex/gi;
|
||||
#setup rendering directory
|
||||
my $dir = "$LatexDir/$hash";
|
||||
if (-d $dir) {
|
||||
unlink (bsd_glob('$dir/*'));
|
||||
if (IsDir($dir)) {
|
||||
Unlink((Glob("$dir/*")));
|
||||
} else {
|
||||
mkdir($dir) or return "[Unable to create $dir]";
|
||||
CreateDir($dir);
|
||||
}
|
||||
chdir ($dir) or return "[Unable to switch to $dir]";
|
||||
ChangeDir($dir) or return "[Unable to switch to $dir]";
|
||||
WriteStringToFile ("srender.tex", $template);
|
||||
my $errorText = qx(latex srender.tex);
|
||||
|
||||
@@ -197,16 +197,16 @@ sub MakeLaTeX {
|
||||
$error = "[dvipng error $? ($output)]" if $?;
|
||||
}
|
||||
|
||||
if (not $error and -f 'srender1.png' and not -z 'srender1.png') {
|
||||
if (not $error and IsFile('srender1.png') and not ZeroSize('srender1.png')) {
|
||||
my $png = ReadFileOrDie("srender1.png");
|
||||
WriteStringToFile ("$LatexDir/$hash.png", $png);
|
||||
} else {
|
||||
$error = "[Error retrieving image for $latex]";
|
||||
}
|
||||
}
|
||||
unlink (glob('*'));
|
||||
chdir ($LatexDir);
|
||||
rmdir ($dir);
|
||||
Unlink(glob('*'));
|
||||
ChangeDir($LatexDir);
|
||||
RemoveDir($dir);
|
||||
|
||||
return $error if $error;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,13 +11,8 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Based on code of tagmap.pl module by Fletcher T. Penney
|
||||
# and searchtags.pl module by Brock Wilcox
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ sub DoListLocked {
|
||||
print $q->start_div({-class=>'content list locked'}), $q->start_p();
|
||||
}
|
||||
foreach my $id (AllPagesList()) {
|
||||
PrintPage($id) if -f GetLockedPageFile($id);
|
||||
PrintPage($id) if IsFile(GetLockedPageFile($id));
|
||||
}
|
||||
if (not $raw) {
|
||||
print $q->end_p(), $q->end_div();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Copyright (C) 2008 Weakish Jiang <weakish@gmail.com>
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -29,6 +29,7 @@ our %TranslationsLibrary = (
|
||||
'bg' => 'bulgarian-utf8.pl',
|
||||
'ca' => 'catalan-utf8.pl',
|
||||
'de' => 'german-utf8.pl',
|
||||
'et' => 'estonian-utf8.pl',
|
||||
'es' => 'spanish-utf8.pl',
|
||||
'fi' => 'finnish-utf8.pl',
|
||||
'fr' => 'french-utf8.pl',
|
||||
@@ -72,10 +73,11 @@ sub LoadLanguage {
|
||||
foreach (@prefs) {
|
||||
last if $Lang{$_} eq 'en'; # the default
|
||||
my $file = $TranslationsLibrary{$Lang{$_}};
|
||||
next unless $file; # file is not listed, eg. there is no file for "de-ch"
|
||||
$file = "$LoadLanguageDir/$file" if defined $LoadLanguageDir;
|
||||
if (-r $file) {
|
||||
if (IsFile($file)) {
|
||||
do $file;
|
||||
do "$ConfigFile-$Lang{$_}" if -r "$ConfigFile-$Lang{$_}";
|
||||
do "$ConfigFile-$Lang{$_}" if IsFile("$ConfigFile-$Lang{$_}");
|
||||
$CurrentLanguage = $Lang{$_};
|
||||
last;
|
||||
}
|
||||
|
||||
@@ -64,9 +64,9 @@ You can change this expiry time by setting C<$LnCacheHours>.
|
||||
push (@MyMaintenance, \&LnMaintenance);
|
||||
|
||||
sub LnMaintenance {
|
||||
if (opendir(DIR, $RssDir)) { # cleanup if they should expire anyway
|
||||
foreach (readdir(DIR)) {
|
||||
unlink "$RssDir/$_" if $Now - (stat($_))[9] > $LnCacheHours * 3600;
|
||||
if (opendir(DIR, encode_utf8($RssDir))) { # cleanup if they should expire anyway
|
||||
foreach my $file (readdir(DIR)) {
|
||||
Unlink("$RssDir/$file") if $Now - Modified($file) > $LnCacheHours * 3600;
|
||||
}
|
||||
closedir DIR;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ sub LocalNamesInit {
|
||||
my %data = ();
|
||||
if (GetParam('cache', $UseCache) > 0) {
|
||||
foreach my $uri (keys %todo) { # read cached rss files if possible
|
||||
if ($Now - (stat($todo{$uri}))[9] < $LnCacheHours * 3600) {
|
||||
if ($Now - Modified($todo{$uri}) < $LnCacheHours * 3600) {
|
||||
$data{$uri} = ReadFile($todo{$uri});
|
||||
delete($todo{$uri}); # no need to fetch them below
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
@@ -22,7 +19,7 @@ use v5.10;
|
||||
AddModuleDescription('login.pl', 'Login Module');
|
||||
|
||||
our ($q, %Action, $SiteName, @MyAdminCode, $IndexFile, $DataDir, $FullUrl);
|
||||
our ($RegistrationForm, $MinimumPasswordLength, $RegistrationsMustBeApproved, $LoginForm, $PasswordFile, $PasswordFileToUse, $PendingPasswordFile, $RequireLoginToEdit, $ConfirmEmailAddress, $UncomfirmedPasswordFile, $EmailSenderAddress, $EmailCommand, $EmailRegExp, $NotifyPendingRegistrations, $EmailConfirmationMessage, $ResetPasswordMessage, $LogoutForm, $ResetForm, $ChangePassForm, $RequireCamelUserName, $UsernameRegExp);
|
||||
our ($RegistrationForm, $MinimumPasswordLength, $RegistrationsMustBeApproved, $LoginForm, $PasswordFile, $PasswordFileToUse, $PendingPasswordFile, $RequireLoginToEdit, $ConfirmEmailAddress, $UnconfirmedPasswordFile, $EmailSenderAddress, $EmailCommand, $EmailRegExp, $NotifyPendingRegistrations, $EmailConfirmationMessage, $ResetPasswordMessage, $LogoutForm, $ResetForm, $ChangePassForm, $RequireCamelUserName, $UsernameRegExp);
|
||||
|
||||
my $EncryptedPassword = "";
|
||||
|
||||
@@ -40,7 +37,7 @@ $RegistrationsMustBeApproved = 1 unless defined $RegistrationsMustBeApproved;
|
||||
$PendingPasswordFile = "$DataDir/pending" unless defined $PendingPasswordFile;
|
||||
|
||||
$ConfirmEmailAddress = 1 unless defined $ConfirmEmailAddress;
|
||||
$UncomfirmedPasswordFile = "$DataDir/uncomfirmed" unless defined $UncomfirmedPasswordFile;
|
||||
$UnconfirmedPasswordFile = "$DataDir/uncomfirmed" unless defined $UnconfirmedPasswordFile;
|
||||
|
||||
$EmailSenderAddress = "fletcher\@freeshell.org" unless defined $EmailSenderAddress;
|
||||
$EmailCommand = "/usr/sbin/sendmail -oi -t" unless defined $EmailCommand;
|
||||
@@ -71,7 +68,7 @@ $PasswordFileToUse = $RegistrationsMustBeApproved
|
||||
? $PendingPasswordFile : $PasswordFile;
|
||||
|
||||
$PasswordFileToUse = $ConfirmEmailAddress
|
||||
? $UncomfirmedPasswordFile : $PasswordFileToUse;
|
||||
? $UnconfirmedPasswordFile : $PasswordFileToUse;
|
||||
|
||||
$RegistrationForm = <<'EOT' unless defined $RegistrationForm;
|
||||
<p>Your Username should be a CamelCase form of your real name, e.g. JohnDoe.</p>
|
||||
@@ -290,7 +287,7 @@ sub DoProcessLogin {
|
||||
ReportError(T('Username and/or password are incorrect.'))
|
||||
unless (AuthenticateUser($username,$pwd));
|
||||
|
||||
unlink($IndexFile);
|
||||
Unlink($IndexFile);
|
||||
print GetHeader('', Ts('Register for %s', $SiteName), '');
|
||||
print '<div class="content">';
|
||||
print Ts('Logged in as %s.', $username);
|
||||
@@ -318,7 +315,7 @@ $Action{process_logout} = \&DoProcessLogout;
|
||||
sub DoProcessLogout {
|
||||
SetParam('pwd','');
|
||||
SetParam('username','');
|
||||
unlink($IndexFile); # I shouldn't have to do this...
|
||||
Unlink($IndexFile); # I shouldn't have to do this...
|
||||
print GetHeader('', Ts('Logged out of %s', $SiteName), '');
|
||||
print '<div class="content">';
|
||||
print T('You are now logged out.');
|
||||
@@ -328,7 +325,7 @@ sub DoProcessLogout {
|
||||
|
||||
sub UserExists {
|
||||
my $username = shift;
|
||||
if (open (my $PASSWD, '<', $PasswordFile)) {
|
||||
if (open (my $PASSWD, '<', encode_utf8($PasswordFile))) {
|
||||
while ( <$PASSWD> ) {
|
||||
if ($_ =~ /^$username:/) {
|
||||
return 1;
|
||||
@@ -338,7 +335,7 @@ sub UserExists {
|
||||
}
|
||||
|
||||
if ($RegistrationsMustBeApproved) {
|
||||
if (open (my $PASSWD, '<', $PendingPasswordFile)) {
|
||||
if (open (my $PASSWD, '<', encode_utf8($PendingPasswordFile))) {
|
||||
while ( <$PASSWD> ) {
|
||||
if ($_ =~ /^$username:/) {
|
||||
return 1;
|
||||
@@ -349,7 +346,7 @@ sub UserExists {
|
||||
}
|
||||
|
||||
if ($ConfirmEmailAddress) {
|
||||
if (open (my $PASSWD, '<', $UncomfirmedPasswordFile)) {
|
||||
if (open (my $PASSWD, '<', encode_utf8($UnconfirmedPasswordFile))) {
|
||||
while ( <$PASSWD> ) {
|
||||
if ($_ =~ /^$username:/) {
|
||||
return 1;
|
||||
@@ -490,14 +487,13 @@ sub ConfirmUser {
|
||||
my ($username, $key) = @_;
|
||||
my $FileToUse = $RegistrationsMustBeApproved
|
||||
? $PendingPasswordFile : $PasswordFileToUse;
|
||||
|
||||
if (open(my $PASSWD, '<', $UncomfirmedPasswordFile)) {
|
||||
if (open(my $PASSWD, '<', encode_utf8($UnconfirmedPasswordFile))) {
|
||||
while (<$PASSWD>) {
|
||||
if ($_ =~ /^$username:(.*):(.*)/) {
|
||||
if (crypt($1,$key) eq $key) {
|
||||
AddUser($username,$1,$2,$FileToUse);
|
||||
close $PASSWD;
|
||||
RemoveUser($username,$UncomfirmedPasswordFile);
|
||||
RemoveUser($username,$UnconfirmedPasswordFile);
|
||||
if ($RegistrationsMustBeApproved) {
|
||||
SendNotification($username);
|
||||
}
|
||||
@@ -515,8 +511,7 @@ sub RemoveUser {
|
||||
|
||||
my %passwords = ();
|
||||
my %emails = ();
|
||||
|
||||
if (open (my $PASSWD, '<', $FileToUse)) {
|
||||
if (open (my $PASSWD, '<', encode_utf8($FileToUse))) {
|
||||
while ( <$PASSWD> ) {
|
||||
if ($_ =~ /^(.*):(.*):(.*)$/) {
|
||||
next if ($1 eq $username);
|
||||
@@ -599,8 +594,7 @@ sub ChangePassword {
|
||||
|
||||
my %passwords = ();
|
||||
my %emails = ();
|
||||
|
||||
if (open (my $PASSWD, '<', $PasswordFile)) {
|
||||
if (open (my $PASSWD, '<', encode_utf8($PasswordFile))) {
|
||||
while ( <$PASSWD> ) {
|
||||
if ($_ =~ /^(.*):(.*):(.*)$/) {
|
||||
$passwords{$1}=$2;
|
||||
@@ -612,7 +606,7 @@ sub ChangePassword {
|
||||
|
||||
$passwords{$user} = $hash;
|
||||
|
||||
open (my $PASSWD, '>', $PasswordFile);
|
||||
open (my $PASSWD, '>', encode_utf8($PasswordFile));
|
||||
foreach my $key ( sort keys(%passwords)) {
|
||||
print $PASSWD "$key:$passwords{$key}:$emails{$key}\n";
|
||||
}
|
||||
@@ -719,7 +713,7 @@ sub DoApprovePending {
|
||||
}
|
||||
} else {
|
||||
print '<ul>';
|
||||
if (open(my $PASSWD, '<', $PendingPasswordFile)) {
|
||||
if (open(my $PASSWD, '<', encode_utf8($PendingPasswordFile))) {
|
||||
while (<$PASSWD>) {
|
||||
if ($_ =~ /^(.*):(.*):(.*)$/) {
|
||||
print '<li>' . ScriptLink("action=approve_pending;user=$1;",$1) . ' - ' . $3 . '</li>';
|
||||
@@ -740,8 +734,7 @@ sub DoApprovePending {
|
||||
|
||||
sub ApproveUser {
|
||||
my ($username) = @_;
|
||||
|
||||
if (open(my $PASSWD, '<', $PendingPasswordFile)) {
|
||||
if (open(my $PASSWD, '<', encode_utf8($PendingPasswordFile))) {
|
||||
while (<$PASSWD>) {
|
||||
if ($_ =~ /^$username:(.*):(.*)/) {
|
||||
AddUser($username,$1,$2,$PasswordFile);
|
||||
|
||||
@@ -266,18 +266,17 @@ except where noted.
|
||||
|
||||
Copyleft 2008 by B.w.Curry <http://www.raiazome.com>.
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this file; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -56,14 +56,12 @@ sub MacFixEncoding {
|
||||
return unless %Namespaces;
|
||||
my %hash = ();
|
||||
for my $key (keys %Namespaces) {
|
||||
utf8::decode($key);
|
||||
$key = NFC($key);
|
||||
$hash{$key} = $NamespaceRoot . '/' . $key . '/';
|
||||
}
|
||||
%Namespaces = %hash;
|
||||
%hash = ();
|
||||
for my $key (keys %InterSite) {
|
||||
utf8::decode($key);
|
||||
$key = NFC($key);
|
||||
$hash{$key} = $Namespaces{$key} if $Namespaces{$key};
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ sub MailIsSubscribed {
|
||||
return 0 unless $mail;
|
||||
# open the DB file
|
||||
require DB_File;
|
||||
tie my %h, "DB_File", $MailFile;
|
||||
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||
my %subscribers = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($id)}));
|
||||
untie %h;
|
||||
return $subscribers{$mail};
|
||||
@@ -197,7 +197,7 @@ sub NewMailDeletePage {
|
||||
sub MailDeletePage {
|
||||
my $id = shift;
|
||||
require DB_File;
|
||||
tie my %h, "DB_File", $MailFile;
|
||||
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||
foreach my $mail (split(/$FS/, UrlDecode(delete $h{UrlEncode($id)}))) {
|
||||
my %subscriptions = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
||||
delete $subscriptions{$id};
|
||||
@@ -274,7 +274,7 @@ sub MailSubscription {
|
||||
my $mail = shift;
|
||||
return unless $mail;
|
||||
require DB_File;
|
||||
tie my %h, "DB_File", $MailFile;
|
||||
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||
my @result = split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
||||
untie %h;
|
||||
@result = sort @result;
|
||||
@@ -303,8 +303,7 @@ sub DoMailSubscriptionList {
|
||||
'<ul>';
|
||||
}
|
||||
require DB_File;
|
||||
|
||||
tie my %h, "DB_File", $MailFile;
|
||||
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||
foreach my $encodedkey (sort keys %h) {
|
||||
my @values = sort split(/$FS/, UrlDecode($h{$encodedkey}));
|
||||
my $key = UrlDecode($encodedkey);
|
||||
@@ -383,7 +382,7 @@ sub MailSubscribe {
|
||||
return unless $mail and @pages;
|
||||
# open the DB file
|
||||
require DB_File;
|
||||
tie my %h, "DB_File", $MailFile;
|
||||
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||
# add to the mail entry
|
||||
my %subscriptions = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
||||
for my $id (@pages) {
|
||||
@@ -442,7 +441,7 @@ sub MailUnsubscribe {
|
||||
my ($mail, @pages) = @_;
|
||||
return unless $mail and @pages;
|
||||
require DB_File;
|
||||
tie my %h, "DB_File", $MailFile;
|
||||
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||
my %subscriptions = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
||||
foreach my $id (@pages) {
|
||||
delete $subscriptions{$id};
|
||||
@@ -481,8 +480,7 @@ sub DoMailMigration {
|
||||
$q->start_div({-class=>'content mailmigrate'});
|
||||
|
||||
require DB_File;
|
||||
|
||||
tie my %h, "DB_File", $MailFile;
|
||||
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||
my $found = 0;
|
||||
foreach my $key (keys %h) {
|
||||
if (index($key, '@') != -1) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#! /usr/bin/perl
|
||||
# Copyright (C) 2014 Alex Schroeder <alex@gnu.org>
|
||||
# Copyright (C) 2014–2017 Alex Schroeder <alex@gnu.org>
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
@@ -18,7 +18,7 @@ use v5.10;
|
||||
|
||||
AddModuleDescription('markdown-rule.pl', 'Markdown Rule Extension');
|
||||
|
||||
our ($q, $bol, %RuleOrder, @MyRules, $UrlProtocols, $FullUrlPattern);
|
||||
our ($q, $bol, %RuleOrder, @MyRules, $UrlProtocols, $FullUrlPattern, @HtmlStack);
|
||||
|
||||
push(@MyRules, \&MarkdownRule);
|
||||
# Since we want this package to be a simple add-on, we try and avoid
|
||||
@@ -31,16 +31,20 @@ $RuleOrder{\&MarkdownRule} = 200;
|
||||
# https://help.github.com/articles/github-flavored-markdown
|
||||
|
||||
sub MarkdownRule {
|
||||
# \escape
|
||||
if (m/\G\\([-#>*`=])/cg) {
|
||||
return $1;
|
||||
}
|
||||
# atx headers
|
||||
if ($bol and m~\G(\s*\n)*(#{1,6})[ \t]*~cg) {
|
||||
elsif ($bol and m~\G(\s*\n)*(#{1,6})[ \t]*~cg) {
|
||||
my $header_depth = length($2);
|
||||
return CloseHtmlEnvironments()
|
||||
. AddHtmlEnvironment("h" . $header_depth);
|
||||
}
|
||||
# end atx header at a newline
|
||||
elsif ((InElement('h1') or InElement('h2') or InElement('h3') or
|
||||
InElement('h4') or InElement('h5') or InElement('h6'))
|
||||
and m/\G\n/cg) {
|
||||
InElement('h4') or InElement('h5') or InElement('h6'))
|
||||
and m/\G\n/cg) {
|
||||
return CloseHtmlEnvironments()
|
||||
. AddHtmlEnvironment("p");
|
||||
}
|
||||
@@ -56,33 +60,71 @@ sub MarkdownRule {
|
||||
return CloseHtmlEnvironments()
|
||||
. AddHtmlEnvironment('blockquote');
|
||||
}
|
||||
# ``` = code
|
||||
elsif ($bol and m/\G```[ \t]*\n(.*?)\n```[ \t]*(\n|$)/cgs) {
|
||||
return CloseHtmlEnvironments() . $q->pre($1)
|
||||
. AddHtmlEnvironment("p");
|
||||
}
|
||||
# ` = code
|
||||
elsif (m/\G`([^`].*?)`/cg) {
|
||||
return $q->code($1);
|
||||
}
|
||||
# ***bold and italic***
|
||||
elsif (not InElement('strong') and not InElement('em') and m/\G\*\*\*/cg) {
|
||||
return AddHtmlEnvironment('em') . AddHtmlEnvironment('strong');
|
||||
}
|
||||
elsif (InElement('strong') and InElement('em') and m/\G\*\*\*/cg) {
|
||||
return CloseHtmlEnvironment('strong') . CloseHtmlEnvironment('em');
|
||||
}
|
||||
# **bold**
|
||||
elsif (m/\G\*\*/cg) {
|
||||
return AddOrCloseHtmlEnvironment('strong');
|
||||
}
|
||||
# *italic*
|
||||
elsif (m/\G\*/cg) {
|
||||
return AddOrCloseHtmlEnvironment('em');
|
||||
# *italic* (closing before adding environment!)
|
||||
elsif (InElement('em') and m/\G\*/cg) {
|
||||
return CloseHtmlEnvironment('em');
|
||||
}
|
||||
elsif ($bol and m/\G\*/cg or m/\G(?<=\P{Word})\*/cg) {
|
||||
return AddHtmlEnvironment('em');
|
||||
}
|
||||
# ~~strikethrough~~ (deleted)
|
||||
elsif (m/\G~~/cg) {
|
||||
return AddOrCloseHtmlEnvironment('del');
|
||||
}
|
||||
# - bullet list
|
||||
elsif ($bol and m/\G(\s*\n)*-[ \t]*/cg
|
||||
or InElement('li') and m/\G(\s*\n)+-[ \t]*/cg) {
|
||||
return CloseHtmlEnvironment('li')
|
||||
. OpenHtmlEnvironment('ul',1) . AddHtmlEnvironment('li');
|
||||
}
|
||||
# 1. numbered list
|
||||
elsif ($bol and m/\G(\s*\n)*\d+\.[ \t]*/cg
|
||||
or InElement('li') and m/\G(\s*\n)+\d+\.[ \t]*/cg) {
|
||||
return CloseHtmlEnvironment('li')
|
||||
. OpenHtmlEnvironment('ol',1) . AddHtmlEnvironment('li');
|
||||
# indented lists = nested lists
|
||||
elsif ($bol and m/\G(\s*\n)*()([*-]|\d+\.)[ \t]*/cg
|
||||
or InElement('li') && m/\G(\s*\n)+( *)([*-]|\d+\.)[ \t]*/cg) {
|
||||
my $nesting_goal = int(length($2)/4) + 1;
|
||||
my $tag = ($3 eq '*' or $3 eq '-') ? 'ul' : 'ol';
|
||||
my $nesting_current = 0;
|
||||
my @nesting = grep(/^[uo]l$/, @HtmlStack);
|
||||
my $html = CloseHtmlEnvironmentUntil('li'); # but don't close li element
|
||||
# warn "\@nesting is (@nesting)\n";
|
||||
# warn " goal is $nesting_goal\n";
|
||||
# warn " tag is $3 > $tag\n";
|
||||
while (@nesting > $nesting_goal) {
|
||||
$html .= CloseHtmlEnvironment(pop(@nesting));
|
||||
# warn " pop\n";
|
||||
}
|
||||
# if have the correct nesting level, but the wrong type, close it
|
||||
if (@nesting == $nesting_goal
|
||||
and $nesting[$#nesting] ne $tag) {
|
||||
$html .= CloseHtmlEnvironment(pop(@nesting));
|
||||
# warn " switch\n";
|
||||
}
|
||||
# now add a list of the appropriate type
|
||||
if (@nesting < $nesting_goal) {
|
||||
$html .= AddHtmlEnvironment($tag);
|
||||
# warn " add $tag\n";
|
||||
}
|
||||
# and a new list item
|
||||
if (InElement('li')) {
|
||||
$html .= CloseHtmlEnvironmentUntil($nesting[$#nesting]);
|
||||
# warn " close li\n";
|
||||
}
|
||||
$html .= AddHtmlEnvironment('li');
|
||||
# warn " add li\n";
|
||||
return $html;
|
||||
}
|
||||
# beginning of a table
|
||||
elsif ($bol and !InElement('table') and m/\G\|/cg) {
|
||||
@@ -124,11 +166,6 @@ sub MarkdownRule {
|
||||
}
|
||||
return OpenHtmlEnvironment('pre',1) . $str; # always level 1
|
||||
}
|
||||
# ``` = code
|
||||
elsif ($bol and m/\G```[ \t]*\n(.*?)\n```[ \t]*(\n|$)/cgs) {
|
||||
return CloseHtmlEnvironments() . $q->pre($1)
|
||||
. AddHtmlEnvironment("p");
|
||||
}
|
||||
# [an example](http://example.com/ "Title")
|
||||
elsif (m/\G\[(.+?)\]\($FullUrlPattern(\s+"(.+?)")?\)/cg) {
|
||||
my ($text, $url, $title) = ($1, $2, $4);
|
||||
@@ -141,3 +178,31 @@ sub MarkdownRule {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
push(@MyRules, \&MarkdownExtraRule);
|
||||
|
||||
sub MarkdownExtraRule {
|
||||
# __italic underline__
|
||||
if (m/\G__/cg) {
|
||||
return AddOrCloseHtmlEnvironment('em', 'style="font-style: normal; text-decoration: underline"');
|
||||
}
|
||||
# _underline_ (closing before adding environment!)
|
||||
elsif (InElement('em', 'style="font-style: normal; text-decoration: underline"') and m/\G_/cg) {
|
||||
return CloseHtmlEnvironment('em');
|
||||
}
|
||||
elsif ($bol and m/\G_/cg or m/\G(?<=\P{Word})_/cg) {
|
||||
return AddHtmlEnvironment('em', 'style="font-style: normal; text-decoration: underline"');
|
||||
}
|
||||
# //italic//
|
||||
elsif (m/\G\/\//cg) {
|
||||
return AddOrCloseHtmlEnvironment('em');
|
||||
}
|
||||
# /italic/ (closing before adding environment!)
|
||||
elsif (InElement('em') and m/\G\//cg) {
|
||||
return CloseHtmlEnvironment('em');
|
||||
}
|
||||
elsif ($bol and m/\G\//cg or m/\G(?<=\P{Word})\//cg) {
|
||||
return AddHtmlEnvironment('em');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
73
modules/mermaid.pl
Normal file
73
modules/mermaid.pl
Normal file
@@ -0,0 +1,73 @@
|
||||
#! /usr/bin/perl
|
||||
# Copyright (C) 2017 Alex Schroeder <alex@gnu.org>
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, either version 3 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('mermaid.pl', 'Mermaid for Diagrams');
|
||||
|
||||
our ($bol, @MyRules, $MermaidCss, $MermaidJs, $HtmlHeaders, %Page);
|
||||
|
||||
$MermaidCss = '/mermaid/mermaid.css';
|
||||
$MermaidJs = '/mermaid/mermaid.min.js';
|
||||
|
||||
# When browsing a page containing mermaid markup, load the mermaid Javascript and CSS
|
||||
|
||||
*MermaidOldBrowsePage = *BrowsePage;
|
||||
*BrowsePage = *MermaidNewBrowsePage;
|
||||
|
||||
sub MermaidNewBrowsePage {
|
||||
my ($id) = @_;
|
||||
OpenPage($id);
|
||||
# Uses <mermaid> to render graphs
|
||||
if ($Page{text} =~ /<mermaid>/
|
||||
and $HtmlHeaders !~ /mermaid/) {
|
||||
$HtmlHeaders .= qq{
|
||||
<link type="text/css" rel="stylesheet" href="$MermaidCss" />
|
||||
<script type="text/javascript" src="$MermaidJs"></script>
|
||||
};
|
||||
}
|
||||
return MermaidOldBrowsePage(@_);
|
||||
}
|
||||
|
||||
# When previewing an edit containing mermaid markup, load the mermaid Javascript
|
||||
# and CSS
|
||||
|
||||
*MermaidOldDoEdit = *DoEdit;
|
||||
*DoEdit = *MermaidNewDoEdit;
|
||||
|
||||
sub MermaidNewDoEdit {
|
||||
# Uses <mermaid> to render graphs
|
||||
if (GetParam('text') =~ /<mermaid>/
|
||||
and $HtmlHeaders !~ /mermaid/) {
|
||||
$HtmlHeaders = q{
|
||||
<link rel="stylesheet" href="/mermaid/mermaid.css" />
|
||||
<script type="text/javascript" src="/mermaid/mermaid.min.js"></script>
|
||||
};
|
||||
}
|
||||
return MermaidOldDoEdit(@_);
|
||||
}
|
||||
|
||||
# And a formatting rule, of course.
|
||||
|
||||
push(@MyRules, \&MermaidRule);
|
||||
|
||||
sub MermaidRule {
|
||||
if ($bol && m/\G\<mermaid\>\n(.+?)\n\<\/mermaid\>/cgs) {
|
||||
return CloseHtmlEnvironments()
|
||||
. '<div class="mermaid">' . UrlDecode($1) . '</div>';
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
@@ -54,10 +54,10 @@ sub BisectAction {
|
||||
sub BisectInitialScreen {
|
||||
print GetFormStart(undef, 'get', 'bisect');
|
||||
print GetHiddenValue('action', 'bisect');
|
||||
my @disabledFiles = bsd_glob("$ModuleDir/*.p[ml].disabled");
|
||||
my @disabledFiles = Glob("$ModuleDir/*.p[ml].disabled");
|
||||
if (@disabledFiles == 0) {
|
||||
print T('Test / Always enabled / Always disabled'), $q->br();
|
||||
my @files = bsd_glob("$ModuleDir/*.p[ml]");
|
||||
my @files = Glob("$ModuleDir/*.p[ml]");
|
||||
for (my $i = 0; $i < @files; $i++) {
|
||||
my $moduleName = fileparse($files[$i]);
|
||||
my @disabled = ($moduleName eq 'module-bisect.pl' ? (-disabled=>'disabled') : ());
|
||||
@@ -78,7 +78,7 @@ sub BisectProcess {
|
||||
my ($isGood) = @_;
|
||||
my $parameterHandover = '';
|
||||
BisectEnableAll();
|
||||
my @files = bsd_glob("$ModuleDir/*.p[ml]");
|
||||
my @files = Glob("$ModuleDir/*.p[ml]");
|
||||
for (my $i = @files - 1; $i >= 0; $i--) { # handle user choices
|
||||
if (GetParam("m$i") eq 'on') {
|
||||
$parameterHandover .= GetHiddenValue("m$i", GetParam("m$i"));
|
||||
@@ -131,7 +131,7 @@ sub BisectProcess {
|
||||
}
|
||||
|
||||
sub BisectEnableAll {
|
||||
for (bsd_glob("$ModuleDir/*.p[ml].disabled")) { # reenable all modules
|
||||
for (Glob("$ModuleDir/*.p[ml].disabled")) { # reenable all modules
|
||||
my $oldName = $_;
|
||||
s/\.disabled$//;
|
||||
print Ts('Enabling %s', (fileparse($_))[0]), '...', $q->br() if $_[0];
|
||||
|
||||
@@ -40,8 +40,8 @@ sub ModuleUpdaterAction {
|
||||
if (GetParam('ok')) {
|
||||
ModuleUpdaterApply();
|
||||
} else {
|
||||
unlink bsd_glob("$TempDir/*.p[ml]"); # XXX is it correct to use $TempDir for such stuff? What if something else puts .pm files there?
|
||||
for (bsd_glob("$ModuleDir/*.p[ml]")) {
|
||||
Unlink(Glob("$TempDir/*.p[ml]")); # XXX is it correct to use $TempDir for such stuff? What if something else puts .pm files there?
|
||||
for (Glob("$ModuleDir/*.p[ml]")) {
|
||||
my $curModule = fileparse($_);
|
||||
ProcessModule($curModule);
|
||||
}
|
||||
@@ -58,7 +58,7 @@ sub ModuleUpdaterAction {
|
||||
}
|
||||
|
||||
sub ModuleUpdaterApply {
|
||||
for (bsd_glob("$TempDir/*.p[ml]")) {
|
||||
for (Glob("$TempDir/*.p[ml]")) {
|
||||
my $moduleName = fileparse($_);
|
||||
if (move($_, "$ModuleDir/$moduleName")) {
|
||||
print $q->strong("Module $moduleName updated successfully!"), $q->br();
|
||||
@@ -66,7 +66,7 @@ sub ModuleUpdaterApply {
|
||||
print $q->strong("Unable to replace module $moduleName: $!"), $q->br();
|
||||
}
|
||||
}
|
||||
unlink bsd_glob("$TempDir/*.p[ml]"); # XXX same as above
|
||||
Unlink(Glob("$TempDir/*.p[ml]")); # XXX same as above
|
||||
print $q->br(), $q->strong('Done!');
|
||||
}
|
||||
|
||||
@@ -81,15 +81,14 @@ sub ProcessModule {
|
||||
. ' If this is your own module, please contribute it to Oddmuse!'), $q->br();
|
||||
return;
|
||||
}
|
||||
open my $fh, ">", "$TempDir/$module" or die("Could not open file. $!");
|
||||
utf8::encode($moduleData);
|
||||
open my $fh, ">:utf8", encode_utf8("$TempDir/$module") or die("Could not open file $TempDir/$module: $!");
|
||||
print $fh $moduleData;
|
||||
close $fh;
|
||||
|
||||
my $diff = DoModuleDiff("$ModuleDir/$module", "$TempDir/$module");
|
||||
if (not $diff) {
|
||||
print $q->strong('This module is up to date, there is no need to update it.'), $q->br();
|
||||
unlink "$TempDir/$module";
|
||||
Unlink("$TempDir/$module");
|
||||
return;
|
||||
}
|
||||
print $q->strong('There is a newer version of this module. Here is a diff:'), $q->br();
|
||||
@@ -109,7 +108,5 @@ sub ProcessModule {
|
||||
}
|
||||
|
||||
sub DoModuleDiff {
|
||||
my $diff = `diff -U 3 -- \Q$_[0]\E \Q$_[1]\E`;
|
||||
utf8::decode($diff); # needs decoding
|
||||
return $diff;
|
||||
decode_utf8(`diff -U 3 -- \Q$_[0]\E \Q$_[1]\E`);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -80,14 +80,28 @@ $NamespaceSlashing = 0; # affects : decoding NamespaceRcLines
|
||||
# variables (eg. localnames.pl)
|
||||
unshift(@MyInitVariables, \&NamespacesInitVariables);
|
||||
|
||||
sub GetNamespace {
|
||||
my $ns = GetParam('ns', '');
|
||||
if (not $ns and $UsePathInfo) {
|
||||
my $path_info = decode_utf8($q->path_info());
|
||||
# make sure ordinary page names are not matched!
|
||||
if ($path_info =~ m|^/($InterSitePattern)(/.*)?|
|
||||
and ($2 or $q->keywords or NamespaceRequiredByParameter())) {
|
||||
$ns = $1;
|
||||
}
|
||||
}
|
||||
ReportError(Ts('%s is not a legal name for a namespace', $ns))
|
||||
if $ns and $ns !~ m/^($InterSitePattern)$/;
|
||||
return $ns;
|
||||
}
|
||||
|
||||
sub NamespacesInitVariables {
|
||||
%Namespaces = ();
|
||||
# Do this before changing the $DataDir and $ScriptName
|
||||
if ($UsePathInfo) {
|
||||
$Namespaces{$NamespacesMain} = $ScriptName . '/';
|
||||
foreach my $name (bsd_glob("$DataDir/*")) {
|
||||
utf8::decode($name);
|
||||
if (-d $name
|
||||
foreach my $name (Glob("$DataDir/*")) {
|
||||
if (IsDir($name)
|
||||
and $name =~ m|/($InterSitePattern)$|
|
||||
and $name ne $NamespacesMain
|
||||
and $name ne $NamespacesSelf) {
|
||||
@@ -97,18 +111,7 @@ sub NamespacesInitVariables {
|
||||
}
|
||||
$NamespaceRoot = $ScriptName; # $ScriptName may be changed below
|
||||
$NamespaceCurrent = '';
|
||||
my $ns = GetParam('ns', '');
|
||||
if (not $ns and $UsePathInfo) {
|
||||
my $path_info = $q->path_info();
|
||||
utf8::decode($path_info);
|
||||
# make sure ordinary page names are not matched!
|
||||
if ($path_info =~ m|^/($InterSitePattern)(/.*)?|
|
||||
and ($2 or $q->keywords or NamespaceRequiredByParameter())) {
|
||||
$ns = $1;
|
||||
}
|
||||
}
|
||||
ReportError(Ts('%s is not a legal name for a namespace', $ns))
|
||||
if $ns and $ns !~ m/^($InterSitePattern)$/;
|
||||
my $ns = GetNamespace();
|
||||
if ($ns
|
||||
and $ns ne $NamespacesMain
|
||||
and $ns ne $NamespacesSelf) {
|
||||
@@ -137,13 +140,8 @@ sub NamespacesInitVariables {
|
||||
$StaticUrl .= UrlEncode($NamespaceCurrent) . '/'
|
||||
if substr($StaticUrl,-1) eq '/'; # from static-copy.pl
|
||||
$WikiDescription .= "<p>Current namespace: $NamespaceCurrent</p>";
|
||||
# override LastUpdate
|
||||
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks)
|
||||
= stat($IndexFile);
|
||||
$LastUpdate = $mtime;
|
||||
CreateDir($DataDir); # Create directory if it doesn't exist
|
||||
ReportError(Ts('Cannot create %s', $DataDir) . ": $!", '500 INTERNAL SERVER ERROR')
|
||||
unless -d $DataDir;
|
||||
$LastUpdate = Modified($IndexFile);
|
||||
CreateDir($DataDir);
|
||||
}
|
||||
$Namespaces{$NamespacesSelf} = $ScriptName . '?';
|
||||
# reinitialize
|
||||
@@ -224,19 +222,19 @@ sub NewNamespaceGetRcLines { # starttime, hash of seen pages to use as a second
|
||||
# opening a rcfile, compare the first timestamp with the
|
||||
# starttime. If any rcfile exists with no timestamp before the
|
||||
# starttime, we need to open its rcoldfile.
|
||||
foreach my $file (@rcfiles) {
|
||||
open(my $F, '<:encoding(UTF-8)', $file);
|
||||
foreach my $rcfile (@rcfiles) {
|
||||
open(my $F, '<:encoding(UTF-8)', encode_utf8($rcfile));
|
||||
my $line = <$F>;
|
||||
my ($ts) = split(/$FS/, $line); # the first timestamp in the regular rc file
|
||||
my @new;
|
||||
if (not $ts or $ts > $starttime) { # we need to read the old rc file, too
|
||||
push(@new, GetRcLinesFor($rcoldfiles{$file}, $starttime,\%match, \%following));
|
||||
push(@new, GetRcLinesFor($rcoldfiles{$rcfile}, $starttime,\%match, \%following));
|
||||
}
|
||||
push(@new, GetRcLinesFor($file, $starttime, \%match, \%following));
|
||||
push(@new, GetRcLinesFor($rcfile, $starttime, \%match, \%following));
|
||||
# strip rollbacks in each namespace separately
|
||||
@new = StripRollbacks(@new);
|
||||
# prepend the namespace to both pagename and author
|
||||
my $ns = $namespaces{$file};
|
||||
my $ns = $namespaces{$rcfile};
|
||||
if ($ns) {
|
||||
for (my $i = $#new; $i >= 0; $i--) {
|
||||
# page id
|
||||
@@ -407,7 +405,7 @@ $Action{namespaces} = \&DoNamespacesList;
|
||||
sub DoNamespacesList {
|
||||
if (GetParam('raw', 0)) {
|
||||
print GetHttpHeader('text/plain');
|
||||
print join("\n", keys %Namespaces), "\n";
|
||||
print join("\n", sort keys %Namespaces), "\n";
|
||||
} else {
|
||||
print GetHeader('', T('Namespaces')),
|
||||
$q->start_div({-class=>'content namespaces'}),
|
||||
@@ -415,7 +413,7 @@ sub DoNamespacesList {
|
||||
GetHiddenValue('id', $HomePage);
|
||||
my $new = $q->textfield('ns') . ' ' . $q->submit('donamespace', T('Go!'));
|
||||
print $q->ul($q->li([map { $q->a({-href => $Namespaces{$_} . $HomePage},
|
||||
$_); } keys %Namespaces]), $q->li($new));
|
||||
$_); } sort keys %Namespaces]), $q->li($new));
|
||||
print $q->end_form() . $q->end_div();
|
||||
PrintFooter();
|
||||
}
|
||||
@@ -441,8 +439,6 @@ sub NamespacesNewGetId {
|
||||
# In this case GetId() will have set the parameter Test to 1.
|
||||
# http://example.org/cgi-bin/wiki.pl/Test?rollback-1234=foo
|
||||
# This doesn't set the Test parameter.
|
||||
if ($UsePathInfo and $id eq $NamespaceCurrent and not GetParam($id) and not GetParam('ns')) {
|
||||
$id = undef;
|
||||
}
|
||||
return if $id and $UsePathInfo and $id eq $NamespaceCurrent and not GetParam($id) and not GetParam('ns');
|
||||
return $id;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ use v5.10;
|
||||
|
||||
AddModuleDescription('near-links.pl', 'Near Links');
|
||||
|
||||
our ($q, %AdminPages, %InterSite, $CommentsPrefix, $DataDir, $UseCache, @MyFooters, @MyMaintenance, @MyInitVariables, @Debugging, $InterSitePattern, @UserGotoBarPages, @IndexOptions);
|
||||
our ($q, $Now, %AdminPages, %InterSite, $CommentsPrefix, $DataDir, $UseCache, @MyFooters, @MyMaintenance, @MyInitVariables, @Debugging, $InterSitePattern, @UserGotoBarPages, @IndexOptions);
|
||||
|
||||
=head1 Near Links
|
||||
|
||||
@@ -128,7 +128,8 @@ sub NearLinksMaintenance {
|
||||
# skip if less than 12h old and caching allowed (the default)
|
||||
foreach my $site (keys %NearSite) {
|
||||
next if GetParam('cache', $UseCache) > 0
|
||||
and -f "$NearDir/$site" and -M "$NearDir/$site" < 0.5;
|
||||
and IsFile("$NearDir/$site")
|
||||
and $Now - Modified("$NearDir/$site") < 0.5;
|
||||
print $q->p(Ts('Getting page index file for %s.', $site));
|
||||
my $data = GetRaw($NearSite{$site});
|
||||
print $q->p($q->strong(Ts('%s returned no data, or LWP::UserAgent is not available.',
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use CGI qw/:standard/;
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use CGI qw/:standard/;
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use CGI qw/:standard/;
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
@@ -35,7 +32,7 @@ $Action{clearcache} = \&DoClearCache;
|
||||
|
||||
sub DoClearCache {
|
||||
print GetHeader('', QuoteHtml(T('Clearing Cache')), '');
|
||||
unlink(bsd_glob("$NotFoundHandlerDir/*"));
|
||||
Unlink(Glob("$NotFoundHandlerDir/*"));
|
||||
print $q->p(T('Done.'));
|
||||
PrintFooter();
|
||||
}
|
||||
@@ -45,7 +42,7 @@ sub DoClearCache {
|
||||
sub ReadLinkDb {
|
||||
return if $LinkDbInit;
|
||||
$LinkDbInit = 1;
|
||||
return if not -f $LinkFile;
|
||||
return if not IsFile($LinkFile);
|
||||
my $data = ReadFileOrDie($LinkFile);
|
||||
map { my ($id, @links) = split; $LinkDb{$id} = \@links } split(/\n/, $data);
|
||||
}
|
||||
@@ -101,13 +98,13 @@ sub NewNotFoundHandlerSave {
|
||||
my $id = $args[0];
|
||||
OldNotFoundHandlerSave(@args);
|
||||
RefreshLinkDb(); # for the open page
|
||||
if (not -d $NotFoundHandlerDir) {
|
||||
mkdir($NotFoundHandlerDir);
|
||||
if (not IsDir($NotFoundHandlerDir)) {
|
||||
CreateDir($NotFoundHandlerDir);
|
||||
} elsif ($Page{revision} == 1) {
|
||||
NotFoundHandlerCacheUpdate($id);
|
||||
} else {
|
||||
# unlink PageName, PageName.en, PageName.de, etc.
|
||||
unlink("$NotFoundHandlerDir/$id", bsd_glob("$NotFoundHandlerDir/$id.[a-z][a-z]"));
|
||||
Unlink("$NotFoundHandlerDir/$id", Glob("$NotFoundHandlerDir/$id.[a-z][a-z]"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +129,7 @@ sub NotFoundHandlerCacheUpdate {
|
||||
foreach my $source (keys %LinkDb) {
|
||||
warn "Examining $source\n";
|
||||
if (grep(/$target/, @{$LinkDb{$source}})) {
|
||||
unlink("$NotFoundHandlerDir/$source", bsd_glob("$NotFoundHandlerDir/$source.[a-z][a-z]"));
|
||||
Unlink("$NotFoundHandlerDir/$source", Glob("$NotFoundHandlerDir/$source.[a-z][a-z]"));
|
||||
warn "Unlinking $source\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This module adds an action and a link in the UserGotoBar to build
|
||||
# a Local Site Map starting from the current page. The map is a sort
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user