Example #1
0
<?php

// PEAR includes
require_once 'HTML/Template/IT.php';
// non-PEAR includes
require 'Wiki.php';
ob_start();
$node = preg_replace(':^/:', '', $_SERVER['PATH_INFO']);
$mode = $_REQUEST['mode'];
$template_dir = dirname(dirname(__FILE__)) . '/templates';
if ($mode == 'submit') {
    if (Wiki::storeNode($_REQUEST['node'], $_REQUEST['contents'])) {
        header("Location: {$_SERVER['SCRIPT_NAME']}/{$_REQUEST['node']}");
    } else {
        header("Location: {$_SERVER['SCRIPT_NAME']}");
    }
    exit;
}
if ($mode == 'logout') {
    $a->logout();
    $a->start();
}
if ($mode == 'delete') {
    Wiki::deleteNode($node);
    header("Location: {$_SERVER['SCRIPT_NAME']}");
    exit;
}
if ($mode == 'mail') {
    if (empty($_REQUEST['email'])) {
        include_once "HTML/QuickForm.php";
        include_once "HTML/Template/IT.php";