[pmwiki-users] rename (Nicolas Poulain)

John Rankin john.rankin at affinity.co.nz
Tue Sep 25 17:43:37 CDT 2007


On Wednesday, 26 September 2007 5:00 AM, pmwiki-users-request at pmichaud.com wrote:
<snip>
>   2. Rename (Nicolas Poulain)
><snip>
>
>Hi all,
>
>When a user is facing the ?action=rename form, he can see the whole list 
>of existing groups, even the groups he's not allowed to view (and so to 
>move the page in).
>
>I'd like the form to show only the groups the user has the permission to 
>view. Where has the rename.php script to be modified ?
>I guess it is in the lines following but i'm not able to do it
>:
>
>SDV($PageRenameFmt,
>     "<h1 class='wikiaction'>$[Rename] <a 
>href='\$PageUrl'>\$FullName</a></h1>
>     <form action='\$PageUrl' method='post'>
>     <input type='hidden' name='n' value='\$FullName' />
>     <input type='hidden' name='action' value='postrename' />
>     \$RenameGroup
>     <input type='text' name='renametext' value='\$Name' size='25' /><br/>
>     $[Add:] <input type='radio' name='addgroup' value='' 
>checked='checked' /><em>$[nothing]</em>
>     <input type='radio' name='addgroup' value='\$Group' /><em>\$Group</em>
>     <input type='radio' name='addgroup' value='new' /><em>$[new 
>group]</em> $[to any Unqualified Links]
>     <input type='submit' value='$[Rename]' /></form>
>     <p class='vspace'></p><p>$[Unqualified Links]:</p>
>     \$UnqualifiedLinks");
>
>Thank you for any help.
>-- 
>Nicolas Poulain
>http://exomatik.net
>

I don't have the answer, but here is what the code does.
It is a while since I looked at it...

It uses the standard pmwiki function ListPages to gather a
list of all pages, from which it builds and formats a pick
list of groups. So how does one determine whether the user 
is authorised to view/edit a particular group? If someone
can answer that question, the rest is fairly easy -- we
add "if renameauthrised($group) ... else ..." to omit
the names of unauthorised groups from the pick list.
-- 
JR
--
John Rankin

       \_      
        \)   
         \,\__/7
         /    /
        (   c'
         \  / 
     /,  /_/  
    |  & *   Wellington
    )  /    
   /  /,    
  /  (    
 |   /      
 \__/       
   V        






More information about the pmwiki-users mailing list