has built-in support for password-protecting various areas of the wiki site. Passwords can be applied to individual pages, to WikiGroups
, or to the entire wiki site. Note that the password protection mechanisms described here are only a small part of overall system (and wiki) security, see PmWiki
.Security for more discussion of this.
supports three levels of access to wiki pages:
read passwords allow viewing the contents of wiki pages
edit passwords control editing and modification of wiki pages
attr passwords control who is able to set passwords on pages (and potentially other future attributes)
Finally, there is an
access for the entire wiki site that allows an administrator to override the passwords set for any individual page or group. All passwords are stored in an encrypted format so that other users on the system cannot simply browse the contents of files to determine the passwords.
By default, PmWiki
is configured with empty
passwords for the whole site (allowing anyone to view or edit pages), the
password is locked for the Main and PmWiki
groups, and the
password is locked entirely. Global passwords for the wiki site are controlled by the $DefaultPasswords array in
. To set an admin password to "
" for a site, you can add the following line to
$DefaultPasswords['admin'] = crypt('mysecret');
Of course, anyone able to view
would be able to find out your secret password, so we'd like to encrypt it somehow. Add
to the end of any PmWiki
URL (or jump to ThisWiki?
:?action=crypt) and you'll be presented with a form to give you the encrypted form of the password. For example, when the crypt
action is given the password "
gives back the string like "
". This can then be put directly into
$DefaultPasswords['admin'] = '$1$hMMhCdfT$mZSCh.BJOidMRn4SOUUSi1';
Note that the encrypted password has to be enclosed in single-quotes. Here, the password is still "
", but somebody looking at
won't be able to see that just from looking at the encrypted form. Note that crypt
may give you different encryptions for the same password--this is normal (and makes it harder for someone else to determine the original password).
Similarly, you can set
to control default
passwords for the entire site. The default passwords are used only for pages and groups which do not have passwords set. Also, any of these values may be arrays of encrypted passwords.
, page passwords override group passwords, group passwords override the default passwords, and the admin password overrides all passwords. This gives a great deal of flexibility in controlling access to wiki pages in PmWiki
. At present there isn't any way to have a non-password protected page within a password-protected group, or a non-password protected group with a site-wide default password set.
To use PmWiki
itself to set passwords on individual wiki pages and WikiGroups
, see PmWiki
Page Revisions -
Page last modified on March 12, 2003, at 08:50 PM