Blame
Date:
Tue Jan 3 05:00:22 2023 UTC
Message:
Daily backup
01
2021-12-17
jrmu
<?php if (!defined('PmWiki')) exit();
02
2021-12-17
jrmu
/* Copyright 2004-2017 Patrick R. Michaud (pmichaud@pobox.com)
03
2021-12-17
jrmu
This file is part of PmWiki; you can redistribute it and/or modify
04
2021-12-17
jrmu
it under the terms of the GNU General Public License as published
05
2021-12-17
jrmu
by the Free Software Foundation; either version 2 of the License, or
06
2021-12-17
jrmu
(at your option) any later version. See pmwiki.php for full details.
07
2021-12-17
jrmu
08
2021-12-17
jrmu
This script handles author tracking.
09
2021-12-17
jrmu
10
2021-12-17
jrmu
Script maintained by Petko YOTOV www.pmwiki.org/petko
11
2021-12-17
jrmu
*/
12
2021-12-17
jrmu
13
2021-12-17
jrmu
SDV($AuthorNameChars, "- '\\w\\x80-\\xff");
14
2021-12-17
jrmu
SDV($AuthorCookie, $CookiePrefix.'author');
15
2021-12-17
jrmu
SDV($AuthorCookieExpires,$Now+60*60*24*30);
16
2021-12-17
jrmu
SDV($AuthorCookieDir,'/');
17
2021-12-17
jrmu
SDV($AuthorGroup,'Profiles');
18
2021-12-17
jrmu
SDV($AuthorRequiredFmt,
19
2021-12-17
jrmu
"<h3 class='wikimessage'>$[An author name is required.]</h3>");
20
2021-12-17
jrmu
Markup('[[~','<links','/\\[\\[~(.*?)\\]\\]/',"[[$AuthorGroup/$1]]");
21
2021-12-17
jrmu
22
2021-12-17
jrmu
$LogoutCookies[] = $AuthorCookie;
23
2021-12-17
jrmu
24
2021-12-17
jrmu
if (!isset($Author)) {
25
2021-12-17
jrmu
if (isset($_POST['author'])) {
26
2021-12-17
jrmu
$x = stripmagic($_POST['author']);
27
2021-12-17
jrmu
pmsetcookie($AuthorCookie, $x, $AuthorCookieExpires, $AuthorCookieDir);
28
2021-12-17
jrmu
} elseif (@$_COOKIE[$AuthorCookie]) {
29
2021-12-17
jrmu
$x = stripmagic(@$_COOKIE[$AuthorCookie]);
30
2021-12-17
jrmu
} else $x = @$AuthId;
31
2021-12-17
jrmu
$Author = PHSC(preg_replace("/[^$AuthorNameChars]/", '', $x),
32
2021-12-17
jrmu
ENT_COMPAT);
33
2021-12-17
jrmu
}
34
2021-12-17
jrmu
if (!isset($AuthorPage)) $AuthorPage =
35
2021-12-17
jrmu
FmtPageName('$AuthorGroup/$Name', MakePageName("$AuthorGroup.$AuthorGroup", $Author));
36
2021-12-17
jrmu
SDV($AuthorLink,($Author) ? "[[~$Author]]" : '?');
37
2021-12-17
jrmu
38
2021-12-17
jrmu
if (IsEnabled($EnableAuthorSignature,1)) {
39
2021-12-17
jrmu
SDVA($ROSPatterns, array(
40
2021-12-17
jrmu
'/(?<!~)~~~~(?!~)/' => "[[~$Author]] $CurrentTime",
41
2021-12-17
jrmu
'/(?<!~)~~~(?!~)/' => "[[~$Author]]",
42
2021-12-17
jrmu
));
43
2021-12-17
jrmu
}
44
2021-12-17
jrmu
if (IsEnabled($EnablePostAuthorRequired,0))
45
2021-12-17
jrmu
array_unshift($EditFunctions,'RequireAuthor');
46
2021-12-17
jrmu
47
2021-12-17
jrmu
## RequireAuthor forces an author to enter a name before posting.
48
2021-12-17
jrmu
function RequireAuthor($pagename, &$page, &$new) {
49
2021-12-17
jrmu
global $Author, $MessagesFmt, $AuthorRequiredFmt, $EnablePost;
50
2021-12-17
jrmu
if (!$Author) {
51
2021-12-17
jrmu
$MessagesFmt[] = $AuthorRequiredFmt;
52
2021-12-17
jrmu
$EnablePost = 0;
53
2021-12-17
jrmu
}
54
2021-12-17
jrmu
}
IRCNow