Package =TWiki::UsersThis package provides services for the lookup and manipulation of login and wiki names of users, and their authentication. It is a Facade that presents a common interface to the User Mapping and Password modules. The rest of the core should only use the methods of this package, and should never call the mapping or password managers directly. TWiki uses the concept of a login name which is used to authenticate a user. A login name maps to a wiki name that is used to identify the user for display. Each login name is unique to a single user, though several login names may map to the same wiki name. Using this module (and the associated plug-in user mapper) TWiki supports the concept of groups. Groups are sets of login names that are treated equally for the purposes of access control. Group names do not have to be wiki names, though it is helpful for display if they are. Internally in the code TWiki uses something referred to as a _canonical user id_ or just user id. The user id is also used externally to uniquely identify the user when (for example) recording topic histories. The user id is usually just the login name, but it doesn't need to be. It just has to be a unique 7-bit alphanumeric and underscore string that can be mapped to/from login and wiki names by the user mapper. The canonical user id should never be seen by a user. On the other hand, core code should never use anything but a canonical user id to refer to a user. Terminology
On this page:
ClassMethod new ($session)Construct the user management object that is the facade to the BaseUserMapping and the user mapping chosen in the configuration.ObjectMethod finish ()Break circular references.ObjectMethod *loginTemplateName () -> templateFileallows UserMappings to come with customised login screens - that should preffereably only over-ride the UI functionObjectMethod *supportsRegistration () -> boolean#return 1 if the main UserMapper supports registration (ie can create new users)ObjectMethod initialiseUser ($login) -> $cUIDGiven a login (which must have been authenticated) determine the cUID that corresponds to that user. This method is used from TWiki.pm to map the $REMOTE_USER to a cUID.randomPassword()Static function that returns a random password. This function is not used in this module; it is provided as a service for other modules, such as custom mappers and registration modules.ObjectMethod addUser ($login,$wikiname,$password,$emails,$mcp) -> $cUID
StaticMethod mapLogin2cUID ($login) -> $cUIDThis function maps an arbitrary string into a valid cUID. The transformation is reversible, but the function is not idempotent (a cUID passed to this function will NOT be returned unchanged). The generated cUID will be unique for the given login name. This static function is designed to be called from custom user mappers that support 1:1 login-to-cUID mappings.ObjectMethod *getCanonicalUserID ($identifier) -> $cUIDWorks out the TWiki canonical user identifier for the user who either (1) logs in with the login name $identifier or (2) has the wikiname $identifier. The canonical user ID is an alphanumeric string that is unique to the login name, and can be mapped back to a login name and the corresponding wiki name using the methods of this class. Note that if the login name to wiki name mapping is not 1:1, this method will map a wikiname to one of the login names that corresponds to the wiki name, but there is no guarantee which one. Returns undef if the user does not exist.ObjectMethod *findUserByWikiName ($wn) -> \@users
ObjectMethod *findUserByEmail ($email) -> \@users
ObjectMethod 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.
The password manager and user mapping manager are both consulted for emails
for each user (where they are actually found is implementation defined).
Duplicates are removed from the list.
ObjectMethod setEmails ($cUID,@emails)Set the email address(es) for the given user. The password manager is tried first, and if it doesn't want to know the user mapping manager is tried.ObjectMethod *getMustChangePassword ($cUID) -> $flagReturns 1 if the $cUID must change the password, else 0. Returns undef if $cUID not found.ObjectMethod getUserData ($cUID) -> $dataRefReturn a reference to an array of hashes with user data, used to manage users. Each item is a hash with:
ObjectMethod setUserData ($cUID,$dataRef)Set the user data of a user. Same array of hashes as getUserData is assumed, although only{name} and {value} are used.
ObjectMethod isAdmin ($cUID,$topic,$web) -> $booleanTrue if the user is an admin
ObjectMethod isInList ($cUID,$list) -> $booleanReturn true if $cUID is in a list of user wikinames, logins and group ids. The list may contain the conventional web specifiers (which are ignored).ObjectMethod *getEffectiveUser ($cUID) -> $cUIDReturns the effective user when UserMasquerading is in action. Returns the argument as it is otherwise.ObjectMethod getRealUser ($cUID) -> $cUIDReturns the real user when UserMasquerading is in action. Returns the argument as it is otherwise.ObjectMethod getLoginName ($cUID) -> $loginGet the login name of a user. Returns undef if the user is not known.ObjectMethod getWikiName ($cUID) -> $wikiNameGet the wikiname to display for a canonical user identifier. Can return undef if the user is not in the mapping system (or the special case from initialiseUser)ObjectMethod webDotWikiName ($cUID) -> $webDotWikiReturn the fully qualified wikiname of the userObjectMethod userExists ($cUID) -> $booleanDetermine if the user already exists or not. A user exists if they are known to to the user mapper.ObjectMethod eachUser () -> TWiki::IteratorofcUIDsGet an iterator over the list of all the registered users not including groups. list of canonical_ids ??? Use it as follows:my $iterator = $umm->eachUser(); while ($iterator->hasNext()) { my $user = $iterator->next(); ... } ObjectMethod eachGroup () -> TWiki::ListIteratorofgroupnamesGet an iterator over the list of all the groups.ObjectMethod *eachGroupMember ($group) -> $iteratorReturn a iterator of user ids that are members of this group. Should only be called on groups. Note that groups may be defined recursively, so a group may contain other groups. This method should only return users i.e. all contained groups should be fully expanded.ObjectMethod isGroup ($name) -> booleanEstablish if a $name refers to a group or not. If $name is not a group name it will probably be a canonical user id, though that should not be assumed.ObjectMethod isInGroup ($cUID,$group,$topic,$web) -> $booleanTest if the user identified by $cUID is in the given group. That is determined in the context of $topic and $web, which matters in context dependent user masquerading a user mapping handler may do.ObjectMethod eachMembership ($cUID) -> $iteratorReturn an iterator over the groups that $cUID is a member of.ObjectMethod checkLogin ($login,$passwordU) -> $booleanFinds if the password is valid for the given user. This method is called using the login name rather than the $cUID so that it can be called with a user who can be authenticated, but may not be mappable to a cUID (yet). Returns 1 on success, undef on failure. TODO: add special check for BaseMapping admin user's login, and if its there (and we're in sudo_context?) use that..ObjectMethod setPassword ($cUID,$newPassU,$oldPassU,$mcp) -> $booleanIf 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. $mcp is the "must change password flag" that forces the user to change the password on next loginObjectMethod passwordError () -> $stringReturns 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 errorObjectMethod removeUser ($cUID) -> $booleanDelete the users entry. Removes the user from the password manager and user mapping manager. Does not remove their personal topics, which may still be linked.ObjectMethod _USERMANAGER ($twiki,$params)ObjectMethod *_userManagerQueryUsers ($params)ObjectMethod *_userManagerEditUser ($params)ObjectMethod *_renderUserDataField ($fieldRef)ObjectMethod canCreateWeb ($web) -> $boolean | ||||||||
Added: | ||||||||
> > | ObjectMethod canRenameWeb ($oldWeb,$newWeb) -> $boolean | |||||||
ObjectMethod getAffiliation ($cUID) -> $affiliation |
Package =TWiki::UsersThis package provides services for the lookup and manipulation of login and wiki names of users, and their authentication. It is a Facade that presents a common interface to the User Mapping and Password modules. The rest of the core should only use the methods of this package, and should never call the mapping or password managers directly. TWiki uses the concept of a login name which is used to authenticate a user. A login name maps to a wiki name that is used to identify the user for display. Each login name is unique to a single user, though several login names may map to the same wiki name. Using this module (and the associated plug-in user mapper) TWiki supports the concept of groups. Groups are sets of login names that are treated equally for the purposes of access control. Group names do not have to be wiki names, though it is helpful for display if they are. Internally in the code TWiki uses something referred to as a _canonical user id_ or just user id. The user id is also used externally to uniquely identify the user when (for example) recording topic histories. The user id is usually just the login name, but it doesn't need to be. It just has to be a unique 7-bit alphanumeric and underscore string that can be mapped to/from login and wiki names by the user mapper. The canonical user id should never be seen by a user. On the other hand, core code should never use anything but a canonical user id to refer to a user. Terminology
On this page:
ClassMethod new ($session)Construct the user management object that is the facade to the BaseUserMapping and the user mapping chosen in the configuration.ObjectMethod finish ()Break circular references.ObjectMethod *loginTemplateName () -> templateFileallows UserMappings to come with customised login screens - that should preffereably only over-ride the UI functionObjectMethod *supportsRegistration () -> boolean#return 1 if the main UserMapper supports registration (ie can create new users)ObjectMethod initialiseUser ($login) -> $cUIDGiven a login (which must have been authenticated) determine the cUID that corresponds to that user. This method is used from TWiki.pm to map the $REMOTE_USER to a cUID.randomPassword()Static function that returns a random password. This function is not used in this module; it is provided as a service for other modules, such as custom mappers and registration modules.ObjectMethod addUser ($login,$wikiname,$password,$emails,$mcp) -> $cUID
StaticMethod mapLogin2cUID ($login) -> $cUIDThis function maps an arbitrary string into a valid cUID. The transformation is reversible, but the function is not idempotent (a cUID passed to this function will NOT be returned unchanged). The generated cUID will be unique for the given login name. This static function is designed to be called from custom user mappers that support 1:1 login-to-cUID mappings.ObjectMethod *getCanonicalUserID ($identifier) -> $cUIDWorks out the TWiki canonical user identifier for the user who either (1) logs in with the login name $identifier or (2) has the wikiname $identifier. The canonical user ID is an alphanumeric string that is unique to the login name, and can be mapped back to a login name and the corresponding wiki name using the methods of this class. Note that if the login name to wiki name mapping is not 1:1, this method will map a wikiname to one of the login names that corresponds to the wiki name, but there is no guarantee which one. Returns undef if the user does not exist.ObjectMethod *findUserByWikiName ($wn) -> \@users
ObjectMethod *findUserByEmail ($email) -> \@users
ObjectMethod 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.
The password manager and user mapping manager are both consulted for emails
for each user (where they are actually found is implementation defined).
Duplicates are removed from the list.
ObjectMethod setEmails ($cUID,@emails)Set the email address(es) for the given user. The password manager is tried first, and if it doesn't want to know the user mapping manager is tried.ObjectMethod *getMustChangePassword ($cUID) -> $flagReturns 1 if the $cUID must change the password, else 0. Returns undef if $cUID not found.ObjectMethod getUserData ($cUID) -> $dataRefReturn a reference to an array of hashes with user data, used to manage users. Each item is a hash with:
ObjectMethod setUserData ($cUID,$dataRef)Set the user data of a user. Same array of hashes as getUserData is assumed, although only{name} and {value} are used.
| ||||||||
Changed: | ||||||||
< < | ObjectMethod isAdmin ($cUID) -> $boolean | |||||||
> > | ObjectMethod isAdmin ($cUID,$topic,$web) -> $boolean | |||||||
True if the user is an admin
ObjectMethod isInList ($cUID,$list) -> $booleanReturn true if $cUID is in a list of user wikinames, logins and group ids. The list may contain the conventional web specifiers (which are ignored). | ||||||||
Added: | ||||||||
> > | ObjectMethod *getEffectiveUser ($cUID) -> $cUIDReturns the effective user when UserMasquerading is in action. Returns the argument as it is otherwise.ObjectMethod getRealUser ($cUID) -> $cUIDReturns the real user when UserMasquerading is in action. Returns the argument as it is otherwise. | |||||||
ObjectMethod getLoginName ($cUID) -> $loginGet the login name of a user. Returns undef if the user is not known.ObjectMethod getWikiName ($cUID) -> $wikiNameGet the wikiname to display for a canonical user identifier. Can return undef if the user is not in the mapping system (or the special case from initialiseUser)ObjectMethod webDotWikiName ($cUID) -> $webDotWikiReturn the fully qualified wikiname of the userObjectMethod userExists ($cUID) -> $booleanDetermine if the user already exists or not. A user exists if they are known to to the user mapper.ObjectMethod eachUser () -> TWiki::IteratorofcUIDsGet an iterator over the list of all the registered users not including groups. list of canonical_ids ??? Use it as follows:my $iterator = $umm->eachUser(); while ($iterator->hasNext()) { my $user = $iterator->next(); ... } ObjectMethod eachGroup () -> TWiki::ListIteratorofgroupnamesGet an iterator over the list of all the groups.ObjectMethod *eachGroupMember ($group) -> $iteratorReturn a iterator of user ids that are members of this group. Should only be called on groups. Note that groups may be defined recursively, so a group may contain other groups. This method should only return users i.e. all contained groups should be fully expanded.ObjectMethod isGroup ($name) -> booleanEstablish if a $name refers to a group or not. If $name is not a group name it will probably be a canonical user id, though that should not be assumed. | ||||||||
Changed: | ||||||||
< < | ObjectMethod isInGroup ($cUID,$group) -> $boolean | |||||||
> > | ObjectMethod isInGroup ($cUID,$group,$topic,$web) -> $boolean | |||||||
Test if the user identified by $cUID is in the given group. | ||||||||
Added: | ||||||||
> > | That is determined in the context of $topic and $web, which matters in context dependent user masquerading a user mapping handler may do. | |||||||
ObjectMethod eachMembership ($cUID) -> $iteratorReturn an iterator over the groups that $cUID is a member of.ObjectMethod checkLogin ($login,$passwordU) -> $booleanFinds if the password is valid for the given user. This method is called using the login name rather than the $cUID so that it can be called with a user who can be authenticated, but may not be mappable to a cUID (yet). Returns 1 on success, undef on failure. TODO: add special check for BaseMapping admin user's login, and if its there (and we're in sudo_context?) use that..ObjectMethod setPassword ($cUID,$newPassU,$oldPassU,$mcp) -> $booleanIf 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. $mcp is the "must change password flag" that forces the user to change the password on next loginObjectMethod passwordError () -> $stringReturns 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 errorObjectMethod removeUser ($cUID) -> $booleanDelete the users entry. Removes the user from the password manager and user mapping manager. Does not remove their personal topics, which may still be linked.ObjectMethod _USERMANAGER ($twiki,$params)ObjectMethod *_userManagerQueryUsers ($params)ObjectMethod *_userManagerEditUser ($params)ObjectMethod *_renderUserDataField ($fieldRef) | ||||||||
Added: | ||||||||
> > |
ObjectMethod canCreateWeb ($web) -> $booleanObjectMethod getAffiliation ($cUID) -> $affiliation | |||||||
Package =TWiki::UsersThis package provides services for the lookup and manipulation of login and wiki names of users, and their authentication. It is a Facade that presents a common interface to the User Mapping and Password modules. The rest of the core should only use the methods of this package, and should never call the mapping or password managers directly. TWiki uses the concept of a login name which is used to authenticate a user. A login name maps to a wiki name that is used to identify the user for display. Each login name is unique to a single user, though several login names may map to the same wiki name. Using this module (and the associated plug-in user mapper) TWiki supports the concept of groups. Groups are sets of login names that are treated equally for the purposes of access control. Group names do not have to be wiki names, though it is helpful for display if they are. Internally in the code TWiki uses something referred to as a _canonical user id_ or just user id. The user id is also used externally to uniquely identify the user when (for example) recording topic histories. The user id is usually just the login name, but it doesn't need to be. It just has to be a unique 7-bit alphanumeric and underscore string that can be mapped to/from login and wiki names by the user mapper. The canonical user id should never be seen by a user. On the other hand, core code should never use anything but a canonical user id to refer to a user. Terminology
On this page:
ClassMethod new ($session)Construct the user management object that is the facade to the BaseUserMapping and the user mapping chosen in the configuration.ObjectMethod finish ()Break circular references.ObjectMethod *loginTemplateName () -> templateFileallows UserMappings to come with customised login screens - that should preffereably only over-ride the UI functionObjectMethod *supportsRegistration () -> boolean#return 1 if the main UserMapper supports registration (ie can create new users)ObjectMethod initialiseUser ($login) -> $cUIDGiven a login (which must have been authenticated) determine the cUID that corresponds to that user. This method is used from TWiki.pm to map the $REMOTE_USER to a cUID.randomPassword()Static function that returns a random password. This function is not used in this module; it is provided as a service for other modules, such as custom mappers and registration modules. | ||||||||
Changed: | ||||||||
< < | ObjectMethod addUser ($login,$wikiname,$password,$emails) -> $cUID | |||||||
> > | ObjectMethod addUser ($login,$wikiname,$password,$emails,$mcp) -> $cUID | |||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
Add a new TWiki user identity, returning the canonical user id for the new
user. Used ONLY for user registration.
The user is added to the password system (if there is one, and if it accepts
changes). If the user already exists in the password system, then the password
is checked and an exception thrown if it doesn't match. If there is no
existing user, and no password is given, a random password is generated.
$login can be undef; $wikiname must always have a value.
The return value is the canonical user id that is used
by TWiki to identify the user.
StaticMethod mapLogin2cUID ($login) -> $cUIDThis function maps an arbitrary string into a valid cUID. The transformation is reversible, but the function is not idempotent (a cUID passed to this function will NOT be returned unchanged). The generated cUID will be unique for the given login name. This static function is designed to be called from custom user mappers that support 1:1 login-to-cUID mappings.ObjectMethod *getCanonicalUserID ($identifier) -> $cUIDWorks out the TWiki canonical user identifier for the user who either (1) logs in with the login name $identifier or (2) has the wikiname $identifier. The canonical user ID is an alphanumeric string that is unique to the login name, and can be mapped back to a login name and the corresponding wiki name using the methods of this class. Note that if the login name to wiki name mapping is not 1:1, this method will map a wikiname to one of the login names that corresponds to the wiki name, but there is no guarantee which one. Returns undef if the user does not exist.ObjectMethod *findUserByWikiName ($wn) -> \@users
ObjectMethod *findUserByEmail ($email) -> \@users
ObjectMethod 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.
The password manager and user mapping manager are both consulted for emails
for each user (where they are actually found is implementation defined).
Duplicates are removed from the list.
ObjectMethod setEmails ($cUID,@emails)Set the email address(es) for the given user. The password manager is tried first, and if it doesn't want to know the user mapping manager is tried. | ||||||||
Added: | ||||||||
> > | ObjectMethod *getMustChangePassword ($cUID) -> $flagReturns 1 if the $cUID must change the password, else 0. Returns undef if $cUID not found.ObjectMethod getUserData ($cUID) -> $dataRefReturn a reference to an array of hashes with user data, used to manage users. Each item is a hash with:
ObjectMethod setUserData ($cUID,$dataRef)Set the user data of a user. Same array of hashes as getUserData is assumed, although only{name} and {value} are used.
| |||||||
ObjectMethod isAdmin ($cUID) -> $booleanTrue if the user is an admin
ObjectMethod isInList ($cUID,$list) -> $booleanReturn true if $cUID is in a list of user wikinames, logins and group ids. The list may contain the conventional web specifiers (which are ignored).ObjectMethod getLoginName ($cUID) -> $loginGet the login name of a user. Returns undef if the user is not known.ObjectMethod getWikiName ($cUID) -> $wikiNameGet the wikiname to display for a canonical user identifier. Can return undef if the user is not in the mapping system (or the special case from initialiseUser)ObjectMethod webDotWikiName ($cUID) -> $webDotWikiReturn the fully qualified wikiname of the userObjectMethod userExists ($cUID) -> $booleanDetermine if the user already exists or not. A user exists if they are known to to the user mapper.ObjectMethod eachUser () -> TWiki::IteratorofcUIDsGet an iterator over the list of all the registered users not including groups. list of canonical_ids ??? Use it as follows:my $iterator = $umm->eachUser(); while ($iterator->hasNext()) { my $user = $iterator->next(); ... } ObjectMethod eachGroup () -> TWiki::ListIteratorofgroupnamesGet an iterator over the list of all the groups.ObjectMethod *eachGroupMember ($group) -> $iteratorReturn a iterator of user ids that are members of this group. Should only be called on groups. Note that groups may be defined recursively, so a group may contain other groups. This method should only return users i.e. all contained groups should be fully expanded.ObjectMethod isGroup ($name) -> booleanEstablish if a $name refers to a group or not. If $name is not a group name it will probably be a canonical user id, though that should not be assumed.ObjectMethod isInGroup ($cUID,$group) -> $booleanTest if the user identified by $cUID is in the given group.ObjectMethod eachMembership ($cUID) -> $iteratorReturn an iterator over the groups that $cUID is a member of.ObjectMethod checkLogin ($login,$passwordU) -> $booleanFinds if the password is valid for the given user. This method is called using the login name rather than the $cUID so that it can be called with a user who can be authenticated, but may not be mappable to a cUID (yet). Returns 1 on success, undef on failure. TODO: add special check for BaseMapping admin user's login, and if its there (and we're in sudo_context?) use that.. | ||||||||
Changed: | ||||||||
< < | ObjectMethod setPassword ($cUID,$newPassU,$oldPassU) -> $boolean | |||||||
> > | ObjectMethod setPassword ($cUID,$newPassU,$oldPassU,$mcp) -> $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. | ||||||||
Added: | ||||||||
> > | $mcp is the "must change password flag" that forces the user to change the password on next login | |||||||
Added: | ||||||||
> > | ||||||||
ObjectMethod passwordError () -> $stringReturns 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 errorObjectMethod removeUser ($cUID) -> $booleanDelete the users entry. Removes the user from the password manager and user mapping manager. Does not remove their personal topics, which may still be linked. | ||||||||
Added: | ||||||||
> > |
ObjectMethod _USERMANAGER ($twiki,$params)ObjectMethod *_userManagerQueryUsers ($params)ObjectMethod *_userManagerEditUser ($params)ObjectMethod *_renderUserDataField ($fieldRef) | |||||||
Package =TWiki::UsersThis package provides services for the lookup and manipulation of login and wiki names of users, and their authentication. It is a Facade that presents a common interface to the User Mapping and Password modules. The rest of the core should only use the methods of this package, and should never call the mapping or password managers directly. TWiki uses the concept of a login name which is used to authenticate a user. A login name maps to a wiki name that is used to identify the user for display. Each login name is unique to a single user, though several login names may map to the same wiki name. Using this module (and the associated plug-in user mapper) TWiki supports the concept of groups. Groups are sets of login names that are treated equally for the purposes of access control. Group names do not have to be wiki names, though it is helpful for display if they are. Internally in the code TWiki uses something referred to as a _canonical user id_ or just user id. The user id is also used externally to uniquely identify the user when (for example) recording topic histories. The user id is usually just the login name, but it doesn't need to be. It just has to be a unique 7-bit alphanumeric and underscore string that can be mapped to/from login and wiki names by the user mapper. The canonical user id should never be seen by a user. On the other hand, core code should never use anything but a canonical user id to refer to a user. Terminology
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
On this page:
ClassMethod new ($session)Construct the user management object that is the facade to the BaseUserMapping and the user mapping chosen in the configuration.ObjectMethod finish ()Break circular references.ObjectMethod *loginTemplateName () -> templateFileallows UserMappings to come with customised login screens - that should preffereably only over-ride the UI functionObjectMethod *supportsRegistration () -> boolean#return 1 if the main UserMapper supports registration (ie can create new users) | ||||||||
Changed: | ||||||||
< < | ObjectMethod initialiseUser ($login) -> cUID | |||||||
> > | ObjectMethod initialiseUser ($login) -> $cUID | |||||||
Added: | ||||||||
> > | Given a login (which must have been authenticated) determine the cUID that corresponds to that user. This method is used from TWiki.pm to map the $REMOTE_USER to a cUID. | |||||||
Deleted: | ||||||||
< < | ||||||||
randomPassword() | ||||||||
Changed: | ||||||||
< < | Static function that returns a random password | |||||||
> > | Static function that returns a random password. This function is not used | |||||||
Added: | ||||||||
> > | in this module; it is provided as a service for other modules, such as custom mappers and registration modules. | |||||||
ObjectMethod addUser ($login,$wikiname,$password,$emails) -> $cUID | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Added: | ||||||||
> > | the login name. | |||||||
| ||||||||
Changed: | ||||||||
< < | StaticMethod forceCUID ($cUID) -> $cUID | |||||||
> > | StaticMethod mapLogin2cUID ($login) -> $cUID | |||||||
Changed: | ||||||||
< < | This function ensures that any cUID's are able to be used for rcs, and other internals not capable of coping with user identifications that contain more than 7 bit ascii. | |||||||
> > | This function maps an arbitrary string into a valid cUID. The transformation is reversible, but the function is not idempotent (a cUID passed to this | |||||||
Added: | ||||||||
> > | function will NOT be returned unchanged). The generated cUID will be unique for the given login name. | |||||||
Changed: | ||||||||
< < | repeated calls must result in the same result (sorry, can't spell the word for it)so the '_' must not be re-encoded | |||||||
> > | This static function is designed to be called from custom user mappers that | |||||||
Added: | ||||||||
> > | support 1:1 login-to-cUID mappings. | |||||||
Deleted: | ||||||||
< < | Please, call this function in any custom Usermapper to simplifyyour mapping code. | |||||||
Added: | ||||||||
> > | ObjectMethod *getCanonicalUserID ($identifier) -> $cUID | |||||||
Changed: | ||||||||
< < | ObjectMethod *getCanonicalUserID ($login) -> $user | |||||||
> > | Works out the TWiki canonical user identifier for the user who either | |||||||
Added: | ||||||||
> > | (1) logs in with the login name $identifier or (2) has the wikiname $identifier. | |||||||
Changed: | ||||||||
< < | Works out the unique TWiki identifier for the user who logs in with the | |||||||
> > | The canonical user ID is an alphanumeric string that is unique | |||||||
Deleted: | ||||||||
< < | given login. The canonical user ID is an alphanumeric string that is unique | |||||||
to the login name, and can be mapped back to a login name and the corresponding wiki name using the methods of this class. | ||||||||
Changed: | ||||||||
< < | returns undef if the user does not exist. | |||||||
> > | Note that if the login name to wiki name mapping is not 1:1, this | |||||||
Added: | ||||||||
> > | method will map a wikiname to one of the login names that corresponds to the wiki name, but there is no guarantee which one. | |||||||
Added: | ||||||||
> > | Returns undef if the user does not exist. | |||||||
Added: | ||||||||
> > | ||||||||
ObjectMethod *findUserByWikiName ($wn) -> \@users
ObjectMethod *findUserByEmail ($email) -> \@users
| ||||||||
Changed: | ||||||||
< < | ObjectMethod getEmails ($user) -> @emailAddress | |||||||
> > | ObjectMethod getEmails ($name) -> @emailAddress | |||||||
Changed: | ||||||||
< < | If this is a user, return their email addresses. If it is a group, | |||||||
> > | If $name is a cUID, return their email addresses. If it is a group, | |||||||
return the addresses of everyone in the group. The password manager and user mapping manager are both consulted for emails for each user (where they are actually found is implementation defined). Duplicates are removed from the list. | ||||||||
Changed: | ||||||||
< < | ObjectMethod setEmails ($user,@emails) | |||||||
> > | ObjectMethod setEmails ($cUID,@emails) | |||||||
Set the email address(es) for the given user.
The password manager is tried first, and if it doesn't want to know the
user mapping manager is tried.
ObjectMethod isAdmin ($cUID) -> $booleanTrue if the user is an admin
| ||||||||
Changed: | ||||||||
< < | ObjectMethod isInList ($user,$list) -> $boolean | |||||||
> > | ObjectMethod isInList ($cUID,$list) -> $boolean | |||||||
Changed: | ||||||||
< < | Return true if $user is in a list of user wikinames and group ids. | |||||||
> > | Return true if $cUID is in a list of user wikinames, logins and group ids. | |||||||
Changed: | ||||||||
< < | $list is a comma-separated wikiname and group list. The list may contain the | |||||||
> > | The list may contain the conventional web specifiers (which are ignored). | |||||||
Deleted: | ||||||||
< < | conventional web specifiers (which are ignored). | |||||||
Changed: | ||||||||
< < | ObjectMethod getLoginName ($cUID) -> $string | |||||||
> > | ObjectMethod getLoginName ($cUID) -> $login | |||||||
Changed: | ||||||||
< < | Get the login name of a user. | |||||||
> > | Get the login name of a user. Returns undef if the user is not known. | |||||||
ObjectMethod getWikiName ($cUID) -> $wikiName | ||||||||
Added: | ||||||||
> > | ||||||||
Get the wikiname to display for a canonical user identifier. | ||||||||
Changed: | ||||||||
< < | can return undef if the user is not in the mapping system | |||||||
> > | Can return undef if the user is not in the mapping system | |||||||
(or the special case from initialiseUser) | ||||||||
Changed: | ||||||||
< < | ObjectMethod webDotWikiName ($user) -> $webDotWiki | |||||||
> > | ObjectMethod webDotWikiName ($cUID) -> $webDotWiki | |||||||
Return the fully qualified wikiname of the user
ObjectMethod userExists ($cUID) -> $booleanDetermine if the user already exists or not. A user exists if they are known to to the user mapper. | ||||||||
Changed: | ||||||||
< < | ObjectMethod eachUser () -> $iterator | |||||||
> > | ObjectMethod eachUser () -> TWiki::IteratorofcUIDs | |||||||
Get an iterator over the list of all the registered users not including
groups.
list of canonical_ids ???
Use it as follows:
my $iterator = $umm->eachUser(); while ($iterator->hasNext()) { my $user = $iterator->next(); ... } | ||||||||
Changed: | ||||||||
< < | ObjectMethod eachGroup () -> $iterator | |||||||
> > | ObjectMethod eachGroup () -> TWiki::ListIteratorofgroupnames | |||||||
Get an iterator over the list of all the groups.
ObjectMethod *eachGroupMember ($group) -> $iteratorReturn a iterator of user ids that are members of this group. Should only be called on groups. Note that groups may be defined recursively, so a group may contain other groups. This method should only return users i.e. all contained groups should be fully expanded. | ||||||||
Changed: | ||||||||
< < | ObjectMethod isGroup ($user) -> boolean | |||||||
> > | ObjectMethod isGroup ($name) -> boolean | |||||||
Changed: | ||||||||
< < | Establish if a user refers to a group or not. | |||||||
> > | Establish if a $name refers to a group or not. If $name is not | |||||||
Added: | ||||||||
> > | a group name it will probably be a canonical user id, though that should not be assumed. | |||||||
Deleted: | ||||||||
< < | The default implementation is to check if the wikiname of the user ends with 'Group'. Subclasses may override this behaviour to provide alternative interpretations. The $TWiki::cfg{SuperAdminGroup} is recognized as a group no matter what it's name is. | |||||||
Deleted: | ||||||||
< < | QUESTION: is the $user parameter here a string, or a canonical_id?? | |||||||
Added: | ||||||||
> > | ObjectMethod isInGroup ($cUID,$group) -> $boolean | |||||||
Added: | ||||||||
> > | Test if the user identified by $cUID is in the given group. | |||||||
Deleted: | ||||||||
< < | ObjectMethod isInGroup ($user,$group) -> $boolean | |||||||
Deleted: | ||||||||
< < | Test if user is in the given group. | |||||||
Deleted: | ||||||||
< < | ||||||||
ObjectMethod eachMembership ($cUID) -> $iteratorReturn an iterator over the groups that $cUID is a member of. | ||||||||
Changed: | ||||||||
< < | ObjectMethod checkPassword ($userName,$passwordU) -> $boolean | |||||||
> > | ObjectMethod checkLogin ($login,$passwordU) -> $boolean | |||||||
Changed: | ||||||||
< < | Finds if the password is valid for the given user. | |||||||
> > | Finds if the password is valid for the given user. This method is | |||||||
Added: | ||||||||
> > | called using the login name rather than the $cUID so that it can be called with a user who can be authenticated, but may not be mappable to a cUID (yet). | |||||||
Returns 1 on success, undef on failure. | ||||||||
Changed: | ||||||||
< < | TODO: add special check for BaseMapping admin user's login, and if its there (and we're in sudo_context?) use that.. | |||||||
> > | TODO: add special check for BaseMapping admin user's login, and if | |||||||
Added: | ||||||||
> > | its there (and we're in sudo_context?) use that.. | |||||||
Changed: | ||||||||
< < | ObjectMethod setPassword ($user,$newPassU,$oldPassU) -> $boolean | |||||||
> > | ObjectMethod 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.
ObjectMethod passwordError () -> $string | ||||||||
Changed: | ||||||||
< < | returns a string indicating the error that happened in the password handlers | |||||||
> > | 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 | ||||||||
Changed: | ||||||||
< < | ObjectMethod removeUser ($user) -> $boolean | |||||||
> > | ObjectMethod removeUser ($cUID) -> $boolean | |||||||
Delete the users entry. Removes the user from the password manager and user mapping manager. Does not remove their personal topics, which may still be linked. | ||||||||
Deleted: | ||||||||
< < |
ObjectMethod *ASSERT_IS_CANONICAL_USER_ID ($user_id) -> $booleanused for debugging to ensure we are actually passing a canonical_id These ASSERTS have been disabled, as they have been made dangerous and misleading due to the legacy cUID codeObjectMethod *ASSERT_IS_USER_LOGIN_ID ($user_login) -> $booleanused for debugging to ensure we are actually passing a user login These ASSERTS have been disabled, as they have been made dangerous and misleading due to the legacy cUID codeObjectMethod *ASSERT_IS_USER_DISPLAY_NAME ($user_display) -> $booleanused for debugging to ensure we are actually passing a user display_name (commonly a WikiWord Name) These ASSERTS have been disabled, as they have been made dangerous and misleading due to the legacy cUID code | |||||||
Package =TWiki::Users | ||||||||
Added: | ||||||||
> > | This package provides services for the lookup and manipulation of login and wiki names of users, and their authentication. | |||||||
Changed: | ||||||||
< < | Singleton object that handles mapping of users to wikinames and vice versa, and user authentication checking. | |||||||
> > | It is a Facade that presents a common interface to the User Mapping and Password modules. The rest of the core should only use the methods | |||||||
Added: | ||||||||
> > | of this package, and should never call the mapping or password managers directly. | |||||||
Added: | ||||||||
> > | TWiki uses the concept of a login name which is used to authenticate a user. A login name maps to a wiki name that is used to identify the user for display. Each login name is unique to a single user, though several login names may map to the same wiki name. | |||||||
Added: | ||||||||
> > | Using this module (and the associated plug-in user mapper) TWiki supports
the concept of groups. Groups are sets of login names that are treated
equally for the purposes of access control. Group names do not have to be
wiki names, though it is helpful for display if they are.
Internally in the code TWiki uses something referred to as a _canonical user
id_ or just user id. The user id is also used externally to uniquely identify
the user when (for example) recording topic histories. The user id is usually
just the login name, but it doesn't need to be. It just has to be a unique
7-bit alphanumeric and underscore string that can be mapped to/from login
and wiki names by the user mapper.
The canonical user id should never be seen by a user. On the other hand,
core code should never use anything but a canonical user id to refer
to a user.
Terminology
| |||||||
On this page:
| ||||||||
Changed: | ||||||||
< < | ClassMethod new ($session,$impl) | |||||||
> > | ClassMethod new ($session) | |||||||
Added: | ||||||||
> > | Construct the user management object that is the facade to the BaseUserMapping and the user mapping chosen in the configuration. | |||||||
Deleted: | ||||||||
< < | Construct the user management object | |||||||
Added: | ||||||||
> > | ObjectMethod finish ()Break circular references. | |||||||
Deleted: | ||||||||
< < | ObjectMethod *finish | |||||||
Deleted: | ||||||||
< < | Complete processing after the client's HTTP request has been responded
to.
| |||||||
Added: | ||||||||
> > | ObjectMethod *loginTemplateName () -> templateFile | |||||||
Added: | ||||||||
> > | allows UserMappings to come with customised login screens - that should preffereably only over-ride the UI function | |||||||
Deleted: | ||||||||
< < | ObjectMethod findUser ($name[,$wikiname][,$nocreate]) -> $userObject | |||||||
Deleted: | ||||||||
< < |
| |||||||
Changed: | ||||||||
< < | Find the user object corresponding to $name , which may be either a | |||||||
> > | ObjectMethod *supportsRegistration () -> boolean | |||||||
Deleted: | ||||||||
< < | login name or a wiki name. If $name is found (either in the list
of login names or the list of wiki names) the corresponding
user object is returned. In this case $wikiname is ignored. | |||||||
Changed: | ||||||||
< < | If they are not found, and $nocreate is true, then return undef. | |||||||
> > | #return 1 if the main UserMapper supports registration (ie can create new users) | |||||||
Deleted: | ||||||||
< < | If $nocreate is false, then a user object is returned even if
the user is not known. | |||||||
Deleted: | ||||||||
< < | If $nocreate is false, and no $wikiname is given, then the
$name is used for both login name and wiki name. | |||||||
Changed: | ||||||||
< < | If nocreate is off, then a default user will be created with their wikiname | |||||||
> > | ObjectMethod initialiseUser ($login) -> cUID | |||||||
Deleted: | ||||||||
< < | set the same as their login name. This user/wiki name pair can be overridden by a later createUser call when the correct wikiname is known, if necessary. | |||||||
Added: | ||||||||
> > |
randomPassword()Static function that returns a random passwordObjectMethod addUser ($login,$wikiname,$password,$emails) -> $cUID
StaticMethod forceCUID ($cUID) -> $cUIDThis function ensures that any cUID's are able to be used for rcs, and other internals not capable of coping with user identifications that contain more than 7 bit ascii. repeated calls must result in the same result (sorry, can't spell the word for it)so the '_' must not be re-encoded Please, call this function in any custom Usermapper to simplifyyour mapping code.ObjectMethod *getCanonicalUserID ($login) -> $userWorks out the unique TWiki identifier for the user who logs in with the given login. The canonical user ID is an alphanumeric string that is unique to the login name, and can be mapped back to a login name and the corresponding wiki name using the methods of this class. returns undef if the user does not exist.ObjectMethod *findUserByWikiName ($wn) -> \@users
| |||||||
ObjectMethod *findUserByEmail ($email) -> \@users
| ||||||||
Changed: | ||||||||
< < | Return a list of user objects for the users that have this email registered with the password manager. | |||||||
> > | Return a list of canonical user names for the users that have this email registered with the user mapping managers. | |||||||
Changed: | ||||||||
< < | ObjectMethod createUser ($login,$wikiname) -> $userobject | |||||||
> > | ObjectMethod getEmails ($user) -> @emailAddress | |||||||
Changed: | ||||||||
< < | Create a user, and insert them in the maps (overwriting any current entry). Use this instead of findUser when you want to be sure you are not going to | |||||||
> > | If this is a user, return their email addresses. If it is a group, return the addresses of everyone in the group. | |||||||
Deleted: | ||||||||
< < | pick up any default user created by findUser. All parameters are required. | |||||||
Added: | ||||||||
> > | The password manager and user mapping manager are both consulted for emails for each user (where they are actually found is implementation defined). | |||||||
Added: | ||||||||
> > | Duplicates are removed from the list. | |||||||
Deleted: | ||||||||
< < | ObjectMethod *addUserToMapping ($user) -> $topicName | |||||||
Changed: | ||||||||
< < | Add a user to the persistant mapping that maps from usernames to wikinames and vice-versa. | |||||||
> > |
ObjectMethod setEmails ($user,@emails) | |||||||
Added: | ||||||||
> > |
Set the email address(es) for the given user.
The password manager is tried first, and if it doesn't want to know the
user mapping manager is tried.
ObjectMethod isAdmin ($cUID) -> $booleanTrue if the user is an admin
ObjectMethod isInList ($user,$list) -> $booleanReturn true if $user is in a list of user wikinames and group ids. $list is a comma-separated wikiname and group list. The list may contain the conventional web specifiers (which are ignored).ObjectMethod getLoginName ($cUID) -> $stringGet the login name of a user.ObjectMethod getWikiName ($cUID) -> $wikiNameGet the wikiname to display for a canonical user identifier. can return undef if the user is not in the mapping system (or the special case from initialiseUser)ObjectMethod webDotWikiName ($user) -> $webDotWikiReturn the fully qualified wikiname of the userObjectMethod userExists ($cUID) -> $booleanDetermine if the user already exists or not. A user exists if they are known to to the user mapper.ObjectMethod eachUser () -> $iteratorGet an iterator over the list of all the registered users not including groups. list of canonical_ids ??? Use it as follows:my $iterator = $umm->eachUser(); while ($iterator->hasNext()) { my $user = $iterator->next(); ... } ObjectMethod eachGroup () -> $iteratorGet an iterator over the list of all the groups.ObjectMethod *eachGroupMember ($group) -> $iteratorReturn a iterator of user ids that are members of this group. Should only be called on groups. Note that groups may be defined recursively, so a group may contain other groups. This method should only return users i.e. all contained groups should be fully expanded.ObjectMethod isGroup ($user) -> booleanEstablish if a user refers to a group or not. The default implementation is to check if the wikiname of the user ends with 'Group'. Subclasses may override this behaviour to provide alternative interpretations. The $TWiki::cfg{SuperAdminGroup} is recognized as a group no matter what it's name is. QUESTION: is the $user parameter here a string, or a canonical_id??ObjectMethod isInGroup ($user,$group) -> $booleanTest if user is in the given group.ObjectMethod eachMembership ($cUID) -> $iteratorReturn an iterator over the groups that $cUID is a member of.ObjectMethod checkPassword ($userName,$passwordU) -> $booleanFinds if the password is valid for the given user. Returns 1 on success, undef on failure. TODO: add special check for BaseMapping admin user's login, and if its there (and we're in sudo_context?) use that..ObjectMethod setPassword ($user,$newPassU,$oldPassU) -> $booleanIf 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.ObjectMethod passwordError () -> $stringreturns 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 errorObjectMethod removeUser ($user) -> $booleanDelete the users entry. Removes the user from the password manager and user mapping manager. Does not remove their personal topics, which may still be linked.ObjectMethod *ASSERT_IS_CANONICAL_USER_ID ($user_id) -> $booleanused for debugging to ensure we are actually passing a canonical_id These ASSERTS have been disabled, as they have been made dangerous and misleading due to the legacy cUID codeObjectMethod *ASSERT_IS_USER_LOGIN_ID ($user_login) -> $booleanused for debugging to ensure we are actually passing a user login These ASSERTS have been disabled, as they have been made dangerous and misleading due to the legacy cUID codeObjectMethod *ASSERT_IS_USER_DISPLAY_NAME ($user_display) -> $booleanused for debugging to ensure we are actually passing a user display_name (commonly a WikiWord Name) These ASSERTS have been disabled, as they have been made dangerous and misleading due to the legacy cUID code | |||||||
Package =TWiki::Users | ||||||||
Added: | ||||||||
> > | ||||||||
Singleton object that handles mapping of users to wikinames and
vice versa, and user authentication checking.
On this page:
ClassMethod new ($session,$impl) | ||||||||
Added: | ||||||||
> > | ||||||||
Construct the user management object
ObjectMethod *finish | ||||||||
Added: | ||||||||
> > | ||||||||
Complete processing after the client's HTTP request has been responded
to.
ObjectMethod findUser ($name[,$wikiname][,$nocreate]) -> $userObject
$name , which may be either a
login name or a wiki name. If $name is found (either in the list
of login names or the list of wiki names) the corresponding
user object is returned. In this case $wikiname is ignored.
If they are not found, and $nocreate is true, then return undef.
If $nocreate is false, then a user object is returned even if
the user is not known.
If $nocreate is false, and no $wikiname is given, then the
$name is used for both login name and wiki name.
If nocreate is off, then a default user will be created with their wikiname
set the same as their login name. This user/wiki name pair can be overridden
by a later createUser call when the correct wikiname is known, if necessary.
| ||||||||
Added: | ||||||||
> > | ObjectMethod *findUserByEmail ($email) -> \@users
| |||||||
ObjectMethod createUser ($login,$wikiname) -> $userobject | ||||||||
Added: | ||||||||
> > | ||||||||
Create a user, and insert them in the maps (overwriting any current entry).
Use this instead of findUser when you want to be sure you are not going to
pick up any default user created by findUser. All parameters are required.
ObjectMethod *addUserToMapping ($user) -> $topicNameAdd a user to the persistant mapping that maps from usernames to wikinames and vice-versa. | ||||||||
Deleted: | ||||||||
< < |
ObjectMethod *initializeRemoteUser ($remoteUser) -> $loginNameReturn value: $remoteUser Acts as a filter for $remoteUser. If set, $remoteUser is filtered for insecure characters and untainted. If not user is passed, the remote user defaults to $cfg{DefaultUserLogin} (usually 'guest'). If we got here via an authentication status failure, then the remote user is set to blank, effectively signalling an illegal access. If no remote user name was passed in, the user defaults to $cfg{DefaultUserLogin}. | |||||||
Package =TWiki::UsersSingleton object that handles mapping of users to wikinames and vice versa, and user authentication checking.On this page:
ClassMethod new ($session,$impl)Construct the user management object | ||||||||
Added: | ||||||||
> > | ObjectMethod *finishComplete processing after the client's HTTP request has been responded to.
| |||||||
ObjectMethod findUser ($name[,$wikiname][,$nocreate]) -> $userObject
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Find the user object corresponding to $name , which may be either a | ||||||||
Changed: | ||||||||
< < | login name or a wiki name. The name is looked up in the | |||||||
> > | login name or a wiki name. If $name is found (either in the list | |||||||
Deleted: | ||||||||
< < | TWikiUsers topic. If $name is found (either in the list | |||||||
of login names or the list of wiki names) the corresponding
user object is returned. In this case $wikiname is ignored.
If they are not found, and $nocreate is true, then return undef.
If $nocreate is false, then a user object is returned even if | ||||||||
Changed: | ||||||||
< < | the user is not listed in TWikiUsers. | |||||||
> > | the user is not known. | |||||||
If $nocreate is false, and no $wikiname is given, then the
$name is used for both login name and wiki name.
If nocreate is off, then a default user will be created with their wikiname
set the same as their login name. This user/wiki name pair can be overridden
by a later createUser call when the correct wikiname is known, if necessary.
ObjectMethod createUser ($login,$wikiname) -> $userobjectCreate a user, and insert them in the maps (overwriting any current entry). Use this instead of findUser when you want to be sure you are not going to pick up any default user created by findUser. All parameters are required. | ||||||||
Changed: | ||||||||
< < | ObjectMethod *addUserToTWikiUsersTopic ($user) -> $topicName | |||||||
> > | ObjectMethod *addUserToMapping ($user) -> $topicName | |||||||
Changed: | ||||||||
< < | Add a user to the TWikiUsers topic. This is a topic that maps from usernames to wikinames. It is maintained by | |||||||
> > | Add a user to the persistant mapping that maps from usernames to wikinames and vice-versa. | |||||||
Deleted: | ||||||||
< < | Register.pm, or manually outside TWiki. | |||||||
ObjectMethod *initializeRemoteUser ($remoteUser) -> $loginNameReturn value: $remoteUser Acts as a filter for $remoteUser. If set, $remoteUser is filtered for insecure characters and untainted. If not user is passed, the remote user defaults to $cfg{DefaultUserLogin} (usually 'guest'). If we got here via an authentication status failure, then the remote user is set to blank, effectively signalling an illegal access. If no remote user name was passed in, the user defaults to $cfg{DefaultUserLogin}. |
Package =TWiki::UsersSingleton object that handles mapping of users to wikinames and vice versa, and user authentication checking.On this page:
ClassMethod new ($session,$impl)Construct the user management objectObjectMethod findUser ($name[,$wikiname][,$nocreate]) -> $userObject
$name , which may be either a
login name or a wiki name. The name is looked up in the
TWikiUsers topic. If $name is found (either in the list
of login names or the list of wiki names) the corresponding
user object is returned. In this case $wikiname is ignored.
If they are not found, and $nocreate is true, then return undef.
If $nocreate is false, then a user object is returned even if
the user is not listed in TWikiUsers.
If $nocreate is false, and no $wikiname is given, then the
$name is used for both login name and wiki name.
If nocreate is off, then a default user will be created with their wikiname
set the same as their login name. This user/wiki name pair can be overridden
by a later createUser call when the correct wikiname is known, if necessary.
ObjectMethod createUser ($login,$wikiname) -> $userobjectCreate a user, and insert them in the maps (overwriting any current entry). Use this instead of findUser when you want to be sure you are not going to pick up any default user created by findUser. All parameters are required.ObjectMethod *addUserToTWikiUsersTopic ($user) -> $topicNameAdd a user to the TWikiUsers topic. This is a topic that maps from usernames to wikinames. It is maintained by Register.pm, or manually outside TWiki.ObjectMethod *initializeRemoteUser ($remoteUser) -> $loginNameReturn value: $remoteUser Acts as a filter for $remoteUser. If set, $remoteUser is filtered for insecure characters and untainted. If not user is passed, the remote user defaults to $cfg{DefaultUserLogin} (usually 'guest'). If we got here via an authentication status failure, then the remote user is set to blank, effectively signalling an illegal access. If no remote user name was passed in, the user defaults to $cfg{DefaultUserLogin}. |