|
Cookbook /
RequireAuthorSummary: Require author names when saving pages
Version:
Prerequisites: pmwiki-2.1.0
Status: Documentation
Maintainer:
Categories: Administration, Security
Discussion: Comments and Questions
Questions answered by this recipe
AnswerAdd the line to your local customization file. If no Author name is provided when an edit form is submitted, this will cause the edit form to be redisplayed with a message that "An author name is required". The text of the message can be changed via the $AuthorRequiredFmt variable. Automatically Setting the Author NameFor sites with authenticated users (e.g., via AuthUser), PmWiki will fill in the Author field with the login name. However, authors will still have the ability to set a different Author name in the edit form. It's possible to force the author name to match the login name, such that anything an author places in the Author field of the edit form is ignored. (The Author field can be removed from the edit form by editing the Site.EditForm page.) For sites using PmWiki's authuser.php script, use the following: # Force author name to match login name
include_once("scripts/authuser.php");
if (@Note: setting "$Author = For sites using HTTP authentication: # Enforce author tracking based on HTTP authentication
if (@$_SERVER['REMOTE_USER']) $Author = $_SERVER['REMOTE_USER'];
Or, the more severe: ## Enforce Author tracking based on the HTTP-Auth
## authenticated user. Exit if no user is authenticated.
if (@$_SERVER['REMOTE_USER']) {
$Author=$_SERVER['REMOTE_USER'];
} else { exit('Security Violation'); }
NotesAuthenticated Name Versus Author NameIt's helpful to recognize that the Author name and the authenticated user name are separate in PmWiki. From an email message by Pm:
See Also
Contributors |