[Pmwiki-users] PmWiki as CMS for a normal non-wiki website?
Rene Pijlman
rene
Sat Aug 14 08:03:17 CDT 2004
Rene Pijlman:
>1. The admin assigns usernames/password to designated editors.
>The editors need to know the URL and need to login. They see the
>usual wiki with full editing capabilities.
>
>2. Anonymous visitors see a regular website with a custom skin,
>no wiki functions, no edit etc. Preferably, anonymous visitors
>do not see links to non-existent pages (so no edit link that
>challenges them to create the page).
I think I've figured it out. This seems to work fine.
In local/config.php:
$DefaultPasswords['edit'] = 'your-encrypted-password-here';
$authenticated_editor = $_SERVER['PHP_AUTH_PW'] != '' &&
@crypt($_SERVER['PHP_AUTH_PW'],$DefaultPasswords['edit']) ==
$DefaultPasswords['edit'];
if ($authenticated_editor)
{
# Editor: use the fully functional pmwiki skin.
$PageTemplateFmt = 'pub/skins/pmwiki/pmwiki.tmpl';
# Mark links to non-existent pages.
$WikiPageCreateFmt =
"<a class='createlink'
href='\$PageUrl?action=edit'>« \$LinkText »</a>";
}
else
{
# Anonymous user: use the dressed down public skin.
$PageTemplateFmt = 'pub/skins/myskin/myskin.tmpl';
# Don't show links to non-existent pages.
$WikiPageCreateFmt = "\$LinkText";
# Enable the file cache.
include_once("local/cache.php");
$EnableCache = 1;
}
This only works for the simple case of one system-wide default
password for editors. It doesn't take into account per-group and
per-page passwords, and passwords for other levels (read,
admin).
--
Regards / Groeten, http://www.leren.nl
Ren? Pijlman http://www.applinet.nl
More information about the pmwiki-users
mailing list