1 <?php // $Id: admin.php,v 1.5.2.4 2005-07-23 11:13:03 rurban 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.
11 // For heaven's sake pick a good password!
15 // Do not tolerate sloppy systems administration
16 if (empty($wikiadmin) || empty($adminpasswd)) {
17 echo gettext("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 $QUERY_STRING = $pagename;
36 } elseif (isset($zip)) {
37 include ('lib/ziplib.php');
38 include ('admin/zip.php');
40 } elseif (isset($dumpserial)) {
41 include ('admin/dumpserial.php');
42 } elseif (isset($loadserial)) {
43 include ('admin/loadserial.php');
44 } elseif (isset($remove)) {
45 if (get_magic_quotes_gpc())
46 $remove = stripslashes($remove);
47 if (function_exists('RemovePage')) {
48 $html .= sprintf(gettext ("You are about to remove '%s' permanently!"), htmlspecialchars($remove));
50 $url = rawurlencode($remove);
51 $html .= sprintf(gettext ("Click %shere%s to remove the page now."),
52 "<A HREF=\"$ScriptUrl?removeok=$url\">", "</A>");
54 $html .= gettext ("Otherwise press the \"Back\" button of your browser.");
56 $html = gettext ("Function not yet implemented.");
58 GeneratePage('MESSAGE', $html, gettext ("Remove page"), 0);
60 } elseif (isset($removeok)) {
61 if (get_magic_quotes_gpc())
62 $removeok = stripslashes($removeok);
63 RemovePage($dbi, $removeok);
64 $html = sprintf(gettext ("Removed page '%s' succesfully."),
65 htmlspecialchars($removeok));
66 GeneratePage('MESSAGE', $html, gettext ("Remove page"), 0);