2 # this is the configuration for the ewiki page and database tools
3 # (which may need to be distinct from your main ewiki config)
7 #-- injects password into fragments/funcs/auth.php
14 #-- tools/ are run standalone?
15 if (!function_exists("ewiki_database")) {
18 #-- enable readonly:test play account?
19 $test = ($_SERVER["SERVER_NAME"] == "erfurtwiki.sourceforge.net")
20 || ($_SERVER["REMOTE_ADDR"] == "127.0.0.1") && (!strpos($_SERVER["SERVER_NAME"], "."));
21 if ($test && !$_REQUEST["test"]) {
22 $passwords["readonly"] = "test";
26 #-- simplest authentication:
27 require("../fragments/funcs/auth.php");
29 if ($_a_user == "readonly") {
30 define("EWIKI_DB_LOCK", 1); // disable write-access
34 #-- normalize cwd (stupid approach)
35 if (!file_exists($LIB="ewiki.php")) {
37 define("EWIKI_SCRIPT", "../?");
38 define("EWIKI_SCRIPT_BINARY", "../?binary=");
42 #-- open db connection, load 'lib'
43 include("./config.php");
47 include("plugins/lib/fix.php");
48 include("plugins/lib/upgrade.php");
53 #-- we now seem to run from inside ewiki (via the StaticPages plugin e.g.)
56 #-- this terminates ewiki from within the spages plugin
57 if (!EWIKI_PROTECTED_MODE || !ewiki_auth($id, $data, $action, 0, 2) || ($ewiki_ring>0) || !isset($ewiki_ring)) {
58 die("Only the administrator can use this function.");
61 #-- some tools/ must be excluded nevertheless (because they override security-related settings, like t_control.php does)
62 define("CONCURRENT_INCLUDE", 1); // just don't ask for an explaination ;)