1 <?php // $Id: admin.php,v 1.5 2000-11-13 10:59:27 ahollosi Exp $
3 function rcs_id($id) {} // otherwise this gets in the way
5 define('WIKI_ADMIN', true); // has to be before includes
7 include("lib/config.php");
8 include("lib/stdlib.php");
10 // set these to your preferences. For heaven's sake
11 // pick a good password!
15 // Do not tolerate sloppy systems administration
16 if (empty($wikiadmin) || empty($adminpasswd)) {
17 echo "Set the administrator account and password first.\n";
21 // from the manual, Chapter 16
22 if (($PHP_AUTH_USER != $wikiadmin ) ||
23 ($PHP_AUTH_PW != $adminpasswd)) {
24 Header("WWW-Authenticate: Basic realm=\"PhpWiki\"");
25 Header("HTTP/1.0 401 Unauthorized");
26 echo gettext ("You entered an invalid login or password.");
30 // All requests require the database
31 $dbi = OpenDataBase($WikiPageStore);
33 if (isset($lock) || isset($unlock)) {
34 include ('admin/lockpage.php');
35 } elseif (isset($zip)) {
36 include ('lib/ziplib.php');
37 include ('admin/zip.php');
39 } elseif (isset($dumpserial)) {
40 include ('admin/dumpserial.php');
41 } elseif (isset($loadserial)) {
42 include ('admin/loadserial.php');
43 } elseif (isset($remove)) {
44 if (get_magic_quotes_gpc())
45 $remove = stripslashes($remove);
46 if (function_exists('RemovePage')) {
47 $html .= sprintf(gettext ("You are about to remove '%s' permanently!"), htmlspecialchars($remove));
49 $url = rawurlencode($remove);
50 $html .= sprintf(gettext ("Click %shere%s to remove the page now."),
51 "<A HREF=\"$ScriptUrl?removeok=$url\">", "</A>");
53 $html .= gettext ("Otherwise press the \"Back\" button of your browser.");
55 $html = gettext ("Function not yet implemented.");
57 GeneratePage('MESSAGE', $html, gettext ("Remove page"), 0);
59 } elseif (isset($removeok)) {
60 if (get_magic_quotes_gpc())
61 $removeok = stripslashes($removeok);
62 RemovePage($dbi, $removeok);
63 $html = sprintf(gettext ("Removed page '%s' succesfully."),
64 htmlspecialchars($removeok));
65 GeneratePage('MESSAGE', $html, gettext ("Remove page"), 0);