Package TWiki::Users::BaseUserMapping

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.

The Base Mapper? provides support for a small number of predefined users. No registration - this is a read only usermapper. It uses the mapper prefix 'BaseUserMapping_'.

Users

Groups

Class Method new ($session)

Construct the Base User Mapping? object

Object Method finish ()

Break circular references.

Object Method loginTemplateName () -> templateFile

allows User Mappings? to come with customised login screens - that should preffereably only over-ride the UI function

Object Method handlesUser ($cUID,$login,$wikiname) -> $boolean

See baseclass for documentation.

In the Base User Mapping? case, we know all the details of the users we specialise in.

Object Method login2cUID ($login) -> $cUID

Convert a login name to the corresponding canonical user name. The canonical name can be any string of 7-bit alphanumeric and underscore characters, and must correspond 1:1 to the login name. (undef on failure)

Object Method getLoginName ($cUID) -> login

converts an internal cUID to that user's login (undef on failure)

Object Method getWikiName ($cUID) -> wikiname

Map a canonical user name to a wikiname

Object Method userExists ($user) -> $boolean

Determine if the user already exists or not.

Object Method eachUser () -> listIteratorofcUIDs

See baseclass for documentation.

Object Method eachGroupMember ($group) -> listIteratorofcUIDs

See baseclass for documentation.

The basemapper implementation assumes that there are no nested groups in the basemapper.

Object Method isGroup ($name) -> boolean

See baseclass for documentation.

Object Method eachGroup () -> List Iteratorofgroupnames?

See baseclass for documentation.

Object Method eachMembership ($cUID) -> List Iteratorofgroupsthisuserisin?

See baseclass for documentation.

Object Method isAdmin ($cUID) -> $boolean

True if the user is an admin

Object Method getEmails ($name) -> @emailAddress

If $name is a cUID, return their email addresses. If it is a group, return the addresses of everyone in the group.

Object Method findUserByWikiName ($wikiname) -> listofcUIDsassociatedwiththatwikiname

See baseclass for documentation.

Object Method checkPassword ($login,$passwordU) -> $boolean

Finds if the password is valid for the given user.

Returns 1 on success, undef on failure.

Object Method setPassword ($cUID,$newPassU,$oldPassU) -> $boolean

If the $oldPassU matches matches the user's password, then it will replace it with $newPassU.

If $oldPassU is not correct and not 1, will return 0.

If $oldPassU is 1, will force the change irrespective of the existing password, adding the user if necessary.

Otherwise returns 1 on success, undef on failure.

Object Method passwordError () -> $string

returns a string indicating the error that happened in the password handlers TODO: these delayed error's should be replaced with Exceptions.

returns undef if no error



Topic TWikiUsersBaseUserMappingDotPm . { Edit | Attach | Backlinks: Web All webs | Printable | History: r1 More }