Tags:
create new tag
view all tags

Question

I've written a plugin that uses initializeUserHandler to change the loginName of a user according to various rules (e.g. handle cases where the REMOTE_USER variable is in a format that isn't an allowable TWiki login name, map the same person coming in from different authentication domains to the same user, etc). There are a few questions that came up when writing this plugin:

  1. Plugin options set on the plugin topic aren't initialized early enough to be used in initializeUserHandler. I wound up using functions (parseText and formatAsFlag) directly from the Prefs module. Is that the best way to do it? How likely will I be to get hurt later by this (having things change out from under me)?
  2. I wanted to find out if a given username is registered by checking to see if s/he has a WikiName. But, there is no easy way to do so from Func.pm (the provided userToWikiName function will just return $loginUser if it doesn't have a Wiki name). Is this the intended behavior? I wound up just checking for the existence of a key in the TWiki::userToWikiList hash.

Environment

TWiki version: TWikiBetaRelease2004x05x07
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Redhat 7.1
Web server: Apache
Perl version: 5.6.1
Client OS: Redhat 9
Web Browser: Firefox

-- TWikiGuest - 04 Jun 2004

Answer

Well, I suspect the answer to both of those questions is something on the order of, ''That's the way things are, and you take your chances.'' I'll post the plugin to the Plugins web at some not-too-distant future date, and mark this question as ''Answered'' w/in a few days.

-- TWikiGuest - 21 Jun 2004

Delayed reply:

  1. Although not recommended, you can use undocumented functions. Be prepared to fix your Plugin on a TWiki upgrade.
  2. There is no FuncDotPm to check if user is registered. A heuristic method is to call userToWikiName, then to check if the result is a WikiWord. This fails in case a login name is a WikiWord (unlikely in most environments)

-- PeterThoeny - 28 Jun 2004

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2004-06-28 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.