Blame
Date:
Fri Dec 16 05:00:21 2022 UTC
Message:
Daily backup
01
2021-12-17
jrmu
<?php if (!defined('PmWiki')) exit();
02
2021-12-17
jrmu
/* Copyright 2002-2015 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 defines ?action=crypt, providing help for WikiAdministrators
09
2021-12-17
jrmu
to set up site-wide passwords in the installation.
10
2021-12-17
jrmu
11
2021-12-17
jrmu
Script maintained by Petko YOTOV www.pmwiki.org/petko
12
2021-12-17
jrmu
*/
13
2021-12-17
jrmu
14
2021-12-17
jrmu
SDV($HandleActions['crypt'],'HandleCrypt');
15
2021-12-17
jrmu
SDV($ActionTitleFmt['crypt'],'| $[Password encryption]');
16
2021-12-17
jrmu
17
2021-12-17
jrmu
function HandleCrypt($pagename, $auth='read') {
18
2021-12-17
jrmu
global $ScriptUrl,$HTMLStartFmt,$HTMLEndFmt;
19
2021-12-17
jrmu
PrintFmt($pagename,$HTMLStartFmt);
20
2021-12-17
jrmu
$passwd = stripmagic(@$_POST["passwd"]);
21
2021-12-17
jrmu
echo FmtPageName(
22
2021-12-17
jrmu
"<form action='{\$ScriptUrl}' method='POST'><p>
23
2021-12-17
jrmu
Enter password to encrypt:
24
2021-12-17
jrmu
<input type='text' name='passwd' value='"
25
2021-12-17
jrmu
. PHSC($passwd, ENT_QUOTES) ."' />
26
2021-12-17
jrmu
<input type='submit' />
27
2021-12-17
jrmu
<input type='hidden' name='n' value='{\$FullName}' />
28
2021-12-17
jrmu
<input type='hidden' name='action' value='crypt' /></p></form>",
29
2021-12-17
jrmu
$pagename);
30
2021-12-17
jrmu
if ($passwd) {
31
2021-12-17
jrmu
$crypt = pmcrypt($passwd);
32
2021-12-17
jrmu
echo "<p class='vspace'>Encrypted password = $crypt</p>";
33
2021-12-17
jrmu
echo "<p class='vspace'>To set a site-wide password, insert the line below
34
2021-12-17
jrmu
in your <i>config.php</i> file, <br />replacing <tt>'type'</tt> with
35
2021-12-17
jrmu
one of <tt>'admin'</tt>, <tt>'read'</tt>, <tt>'edit'</tt>,
36
2021-12-17
jrmu
or <tt>'attr'</tt>. <br />See <a
37
2021-12-17
jrmu
href='$ScriptUrl?n=PmWiki.PasswordsAdmin'>PasswordsAdmin</a> for more
38
2021-12-17
jrmu
details.</p>
39
2021-12-17
jrmu
<pre class='vspace'> \$DefaultPasswords['type']='$crypt';</pre>";
40
2021-12-17
jrmu
}
41
2021-12-17
jrmu
PrintFmt($pagename,$HTMLEndFmt);
42
2021-12-17
jrmu
}
43
2021-12-17
jrmu
IRCNow