[pmwiki-users] Block Link Creation from Group
Hans
design5 at softflow.co.uk
Tue Feb 27 12:03:15 CST 2007
Tuesday, February 27, 2007, 5:18:57 PM, Patrick wrote:
> An easy way is to create
> an $EditFunction that disallows creating new pages:
> ......
I tested this by putting into config.php:
$EditFunctions[] = 'CreateDisallowed';
function CreateDisallowed($pagename, $page, $new) {
global $EnableCreatePages, $EnablePost, $MessagesFmt;
if (IsEnabled($EnableCreatePages, 1)) return;
if (PageExists($pagename)) return;
$EnablePost = 0;
$MessagesFmt[] = 'Creation of new page blocked';
}
if (preg_match('/^Test/', $pagename))
$EnableCreatePages = 0;
The result was that trying to create new page in a group
beginning with "Test" opened the edit form with the message displayed:
"Creation of new page blocked".
But I could enter content and save the page normally, so the creation
was not blocked.
Would the new edit function need to be inserted at a special place in
the $EditFunctions array?
Hans
More information about the pmwiki-users
mailing list