uses perms field from auth groupex
[wikifarm.git] / install / cookbook / autocreate.php
CommitLineData
b1b3c24c
DB
1<?php
2
3function AutoCreatePage($page, $text, $redirect = null) {
4 global $pagename, $WikiDir;
5 $pagename_ = str_replace('/','.',$pagename);
6 $group = substr($pagename_,0,strrpos($pagename_,'.'));
7
8 $page = str_replace('$Group', $group, $page);
9 if ($pagename_ == $page && !$WikiDir->exists($pagename_)) {
10 $WikiDir->write($pagename_, array('text' => $text));
11 if ($redirect != '') {
12 $redirect = $pagename_;
13 }
14 Redirect($pagename_);
15 }
16}
17
18?>