<?php

if(!defined("PmWiki")) {
    exit();
}

$WikiTitle = "PmWiki";
$Skin = "t";

$EnableUpload = 1;

$DefaultName = "MainPage";

include_once("cookbook/titledictindex.php");
include_once("cookbook/codecogs.php");

include_once("scripts/xlpage-utf-8.php");

$AuthUser["root"] = '$1$3K/kG.yC$HSw2FoSsgEhU6YfJfF5c/.';

include_once("scripts/authuser.php");

$Author = $AuthId;

$DefaultPasswords["admin"] = "id:root";
$DefaultPasswords["edit"] = "id:root";
$DefaultPasswords["attr"] = "id:root";
$DefaultPasswords["upload"] = "id:root";

$FmtPV['$WikiTitle'] = '$GLOBALS["WikiTitle"]';

function AutoGroupPages($pagename, &$page, &$new) {
    global $IsPagePosted, $GroupPagesFmt;

    if(!$IsPagePosted) {
        return;
    }

    SDV($AutoGroupPagesFmt, array(
        '{$Group}.Index' => 'Template.Index'));

    foreach($AutoGroupPagesFmt as $n => $t) {
        $n = FmtPageName($n, $pagename);
        $t = FmtPageName($t, $pagename);

        if(!PageExists($n) && $n != $pagename) {
            WritePage($n, ReadPage($t));
        }
    }
}

$EditFunctions[] = 'AutoGroupPages';

?>