[pmwiki-users] Skin

Henrik Bechmann henrik.bechmann at sympatico.ca
Mon Aug 28 22:42:52 CDT 2006


Here's my solution. I use the IMS cache, (a wiki farm rather than a 
simple install which may not be relevant to you), and the default 
passwording system:

In farmconfig.php code (take out the include_once('local/config.php'); 
if you use config.php):

$EnableIMSCaching=1;
...
include_once('local/config.php');
$pagename = ResolvePageName($pagename);
$isEditAuthorized = CondAuth($pagename, 'edit'); #detects current rights 
mode
...
include_once('../../common/wiki/scripts/author.php');
$LogoutCookies = array_diff($LogoutCookies, array($AuthorCookie)); 
#preserves author name between sessions
...
if (!$isEditAuthorized) { #conditionally sets menu layout
$PageCustodianFmt = '
<ul class="narrow compact">
<li><a href="$PageUrl?action=login">Login</a></li>
</ul>';
} else {
$PageCustodianFmt = '
<ul class="narrow compact">
<li><a href="$PageUrl">View page</a></li>
<li><a href="$PageUrl?action=edit">Edit Page</a></li>
<li><a href="$PageUrl?action=diff">Page History</a></li>
<li><a href="$PageUrl-Sidebar?action=edit">Edit Page Sidebar</a></li>
<li><a href="$ScriptUrl/$Group/Sidebar?action=edit">Edit Group 
Sidebar</a></li>
<li><a 
href="$ScriptUrl/$DefaultGroup/DepartmentSidebar?action=edit">Edit 
Department Sidebar</a></li>
<li><a href="$ScriptUrl/$DefaultGroup.SectionList?action=edit">Edit 
Folders Menu</a></li>
<li><a href="$ScriptUrl/$Group/ArticleList?action=edit">Edit Documents 
Menu</a></li>
<li><a href="$ScriptUrl/LibraryOfStories.FrontPage">Library Of 
Stories</a></li>
<li><a target="_blank" href="/gallery/index.php">Photo Gallery</a></li>
<li><a target="_blank" 
href="/common/wiki/pmwiki.php?n=DufferinParkWiki.FrontPage">Custodian 
Help</a></li>
<li><a href="$PageUrl?action=logout">Logout</a></li>
</ul>';
}

Then I place the $PageCustodianFmt variable in the appropriate place in 
the page template, which is substituted with the appropriate code block 
from above.

Adjust the author menu to your liking, substituting the menu actions 
that you want.

This may give you some ideas.

Best,

- Henrik

pmwiki at 911networks.com wrote:
> Hi,
>
> I need to start a new wiki. There 2 types of users:
> * Internal users which are allowed to do editing, and create new
> pages
> * External users [Internet] that are only allowed to read some
> of the groups
>
> What skin do you suggest that will support the (:noaction:)
> conditionally? Or is there a better way to control access?
>
>   

-- 

Henrik Bechmann
www.osscommons.ca
www.bechmannsoftware.com
Webmaster, www.dufferinpark.ca





More information about the pmwiki-users mailing list