|
Cookbook /
StoredAuthNameSummary: How to set a stored author name to an authenticated user
Version: 0.3 - 16 January 2006
Prerequisites:
Status:
Maintainer:
Categories: Security
QuestionHow can I set automatically a stored author name to an authenticated user? AnswerFor sites with authenticated users with Cookbook:AuthUser, this script allow you to use author name ($Author) stored in the Site.AuthUser page and to automatically set the author name in the author field in case it's blank. It does the same job as you can see at Cookbook:RequireAuthor in automatically setting an author name and, optionally, enforcing author tracking but with stored information. Installation instruction
include_once('cookbook/storedauthname.php');
UsageTo set an author name: Edit your userid::authorname Where userid is If no author name is found, the author name is set to the user id. To enforce author tracking for authenticated users, you can set the variable $ForceAuthorTracking in your local/config.php just before the include_once function, like this: $ForceAuthorTracking=1; # 1 to enable, 0 (default) to disable
include_once('cookbook/storedauthname.php');
NotesTipsMaybe this recipe can help to manage author tracking in a more convenient way by grouping several ideas found in the cookbook:
VersionsThis recipe works with PmWiki >= 2.1.beta20.
But for previous version you can change The variable
Releases
Note June 14, 2006: I've used this cookbook in different production environments for several months without any problems. It should be considered stable. CommentsUsing pmwiki-2.1.11 (with the default template) and this recipe I found that I had to place the include for authuser before the include for storedauthname. If storedauthname was placed first users would have to login in twice. After first login attempt the user would be shown the login page again. After I figured that out it appears to be working nicely. Dale Ray (http://www.corantodemo.net/wiki/(approve links)) July 28, 2006 See AlsoContributors |