Package =TWiki::UserMapping

This is a virtual base class (a.k.a an interface) for all user mappers. It is not useable as a mapping in TWiki - use the BaseUserMapping for default behaviour.

User mapping is the process by which TWiki maps from a username (a login name) to a display name and back. It is also where groups are maintained.

See TWiki::Users::BaseUserMapping and TWiki::Users::TWikiUserMapping for the default implementations of this interface.

If you want to write a user mapper, you will need to implement the methods described in this class.

User mappings work by mapping both login names and display names to a canonical user id. This user id is composed from a prefix that defines the mapper in use (something like 'BaseUserMapping_' or 'LdapUserMapping_') and a unique user id that the mapper uses to identify the user.

The null prefix is reserver for the TWikiUserMapping for compatibility with old TWiki releases.

Note: in all the following documentation, $cUID refers to a canonical user id.

PROTECTED ClassMethod new ($session, $mapping_id)

Construct a user mapping object, using the given mapping id.

ObjectMethod finish ()

Break circular references.

ObjectMethod *loginTemplateName () -> $templateFile

Allows UserMappings to come with customised login screens - that should preferably only over-ride the UI function

Default is "login"

ObjectMethod *supportsRegistration () -> $boolean

Return true if the UserMapper supports registration (ie can create new users)

Default is false

ObjectMethod handlesUser ($cUID,$login,$wikiname) -> $boolean

Called by the TWiki::Users object to determine which loaded mapping to use for a given user (must be fast).

The user can be identified by any of $cUID, $login or $wikiname. Any of these parameters may be undef, and they should be tested in order; cUID first, then login, then wikiname.

ObjectMethod login2cUID ($login,$dontcheck) -> cUID