[pmwiki-users] Block Link Creation from Group

Hans design5 at softflow.co.uk
Tue Feb 27 13:48:00 CST 2007


Tuesday, February 27, 2007, 7:36:35 PM, Patrick wrote:

> Sure, just change the CreateDisallowed function to redirect 
> to an error page instead of blocking the post.

Ahh, yes. So to wrap this up for Sivakatirswami:

array_unshift($EditFunctions, 'CreateDisallowed');

function CreateDisallowed($pagename, $page, $new) {
   global $EnableCreatePages, $EnablePost, $MessagesFmt;
   if (IsEnabled($EnableCreatePages, 1)) return;
   if (PageExists($pagename)) return;
   Redirect('Main.PageCreationError'); #or some other page,
# or use next two code lines instead the Redirect
#   $EnablePost = 0;
#   $MessagesFmt[] = 'Creation of new page blocked';
  }
  
if (preg_match('/^TODO/', $pagename))
   $EnableCreatePages = 0; 


Hans




More information about the pmwiki-users mailing list