Difference: TWikiUsersDotPm (1 vs. 7)

Revision 72013-10-14 - TWikiContributor

Line: 208 to 208
 
Changed:
<
<

ObjectMethod isAdmin ($cUID) -> $boolean

>
>

ObjectMethod isAdmin ($cUID,$topic,$web) -> $boolean

  True if the user is an admin
  • is $TWiki::cfg{SuperAdminGroup}
Line: 224 to 224
 
Added:
>
>

ObjectMethod getEffectiveUser ($cUID) -> $cUID

Returns the effective user when UserMasquerading is in action. Returns the argument as it is otherwise.

ObjectMethod getRealUser ($cUID) -> $cUID

Returns the real user when UserMasquerading is in action. Returns the argument as it is otherwise.

 

ObjectMethod getLoginName ($cUID) -> $login

Get the login name of a user. Returns undef if the user is not known.

Line: 295 to 309
 
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.
 
Line: 371 to 388
 

ObjectMethod _renderUserDataField ($fieldRef)

Added:
>
>

ObjectMethod canCreateWeb ($web) -> $boolean

ObjectMethod getAffiliation ($cUID) -> $affiliation

Revision 62011-08-21 - TWikiContributor

Line: 88 to 88
 custom mappers and registration modules.
Changed:
<
<

ObjectMethod addUser ($login,$wikiname,$password,$emails) -> $cUID

>
>

ObjectMethod addUser ($login,$wikiname,$password,$emails,$mcp) -> $cUID

 
  • $login - user login name. If undef, $wikiname will be used as the login name.
  • $wikiname - user wikiname. If undef, the user mapper will be asked to provide it.
  • $password - password. If undef, a password will be generated.
Added:
>
>
  • $mcp - must change password flag.
  Add a new TWiki user identity, returning the canonical user id for the new user. Used ONLY for user registration.
Line: 177 to 178
 
Added:
>
>

ObjectMethod getMustChangePassword ($cUID) -> $flag

Returns 1 if the $cUID must change the password, else 0. Returns undef if $cUID not found.

ObjectMethod getUserData ($cUID) -> $dataRef

Return a reference to an array of hashes with user data, used to manage users. Each item is a hash with:

  • {name} - name of field, such as "email"
  • {title} - title of field, such as "E-mail"
  • {value} - value of field, such as "jimmy@example.com"
  • {type} - type of field: text, password, checkbox, label
  • {size} - size of field, such as 40
  • {note} - comment note, if any

User management forms can be build dynamically from this data structure. Each password manager may return a different set of fields.

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) -> $boolean

True if the user is an admin

Line: 291 to 322
 
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.
Line: 303 to 334
  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
 

ObjectMethod passwordError () -> $string

Line: 321 to 355
 topics, which may still be linked.
Added:
>
>

ObjectMethod _USERMANAGER ($twiki,$params)

ObjectMethod _userManagerQueryUsers ($params)

ObjectMethod _userManagerEditUser ($params)

ObjectMethod _renderUserDataField ($fieldRef)

Revision 52008-08-03 - TWikiContributor

Line: 44 to 44
  login name may have many emails.

NOTE:

Changed:
<
<
  • wherever the code references $user, its a canonical_id
>
>
  • wherever the code references $cUID, its a canonical_id
 
  • wherever the code references $group, its a group_name
Added:
>
>
  • $name may be a group or a cUID
 

On this page:
Line: 73 to 74
 
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.
 

randomPassword()

Changed:
<
<
Static function that returns a random password
>
>
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) -> $cUID

Changed:
<
<
  • $login - user login name. If undef, $wikiname will be used as the login name.
>
>
  • $login - user login name. If undef, $wikiname will be used as the login name.
 
  • $wikiname - user wikiname. If undef, the user mapper will be asked to provide it.
  • $password - password. If undef, a password will be generated.
Line: 105 to 111
 
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 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 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 (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 given login. The canonical user ID is an alphanumeric string that is unique
>
>
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 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.

 
Line: 143 to 157
 
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

Line: 155 to 169
 
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
Line: 171 to 185
 
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 conventional web specifiers (which are ignored).
>
>
The list may contain the 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.
 
Line: 187 to 200
 

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
Line: 207 to 221
 
Changed:
<
<

ObjectMethod eachUser () -> $iterator

>
>

ObjectMethod eachUser () -> TWiki::IteratorofcUIDs

  Get an iterator over the list of all the registered users not including groups.
Line: 225 to 239
 
Changed:
<
<

ObjectMethod eachGroup () -> $iterator

>
>

ObjectMethod eachGroup () -> TWiki::ListIteratorofgroupnames

  Get an iterator over the list of all the groups.
Line: 242 to 256
 
Changed:
<
<

ObjectMethod isGroup ($user) -> boolean

Establish 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.

>
>

ObjectMethod isGroup ($name) -> boolean

 
Changed:
<
<
QUESTION: is the $user parameter here a string, or a canonical_id??
>
>
Establish 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 ($user,$group) -> $boolean

>
>

ObjectMethod isInGroup ($cUID,$group) -> $boolean

 
Changed:
<
<
Test if user is in the given group.
>
>
Test if the user identified by $cUID is in the given group.
 
Line: 268 to 277
 
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 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 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.
Line: 294 to 307
 

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) -> $boolean

used 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 code

ObjectMethod ASSERT_IS_USER_LOGIN_ID ($user_login) -> $boolean

used 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 code

ObjectMethod ASSERT_IS_USER_DISPLAY_NAME ($user_display) -> $boolean

used 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

Revision 42008-01-22 - TWikiContributor

Line: 1 to 1
 

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 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

  • A login name is the name used to log in to TWiki. Each login name is assumed to be unique to a human. The Password module is responsible for authenticating and manipulating login names.
  • A canonical user id is an internal TWiki representation of a user. Each canonical user id maps 1:1 to a login name.
  • A wikiname is how a user is displayed. Many user ids may map to a single wikiname. The user mapping module is responsible for mapping the user id to a wikiname.
  • A group id represents a group of users and other groups. The user mapping module is responsible for mapping from a group id to a list of canonical user ids for the users in that group.
  • An email is an email address asscoiated with a login name. A single login name may have many emails.

NOTE:

  • wherever the code references $user, its a canonical_id
  • wherever the code references $group, its a group_name
 

On this page:
Changed:
<
<

ClassMethod new ($session,$impl)

>
>

ClassMethod new ($session)

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.
  1. breaking circular references to allow garbage collection in persistent environments
 
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:
<
<
  • $name - login name or wiki name
  • $wikiname - optional, wikiname for created user
  • $nocreate - optional, disable creation of user object for user not found
 
Changed:
<
<
Find the user object corresponding to $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.
>
>

ObjectMethod supportsRegistration () -> boolean

 
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 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 initialiseUser ($login) -> cUID

randomPassword()

Static function that returns a random password

ObjectMethod addUser ($login,$wikiname,$password,$emails) -> $cUID

  • $login - user login name. If undef, $wikiname will be used as the login name.
  • $wikiname - user wikiname. If undef, the user mapper will be asked to provide it.
  • $password - password. If undef, a password will be generated.

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 forceCUID ($cUID) -> $cUID

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.

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) -> $user

Works 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

  • $wn - wikiname to look up
Return a list of canonical user names for the users that have this wikiname. Since a single wikiname might be used by multiple login ids, we need a list.

If $wn is the name of a group, the group will not be expanded.

 

ObjectMethod findUserByEmail ($email) -> \@users

  • $email - email address to look up
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.

ObjectMethod getEmails ($user) -> @emailAddress

If this is a user, 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 ($user,@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) -> $boolean

True if the user is an admin

  • is $TWiki::cfg{SuperAdminGroup}
  • is a member of the $TWiki::cfg{SuperAdminGroup}

ObjectMethod isInList ($user,$list) -> $boolean

Return 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) -> $string

Get the login name of a user.

ObjectMethod getWikiName ($cUID) -> $wikiName

Get 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) -> $webDotWiki

Return the fully qualified wikiname of the user

ObjectMethod userExists ($cUID) -> $boolean

Determine if the user already exists or not. A user exists if they are known to to the user mapper.

ObjectMethod eachUser () -> $iterator

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();
        ...
    }

ObjectMethod eachGroup () -> $iterator

Get an iterator over the list of all the groups.

ObjectMethod eachGroupMember ($group) -> $iterator

Return 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) -> boolean

Establish 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) -> $boolean

Test if user is in the given group.

ObjectMethod eachMembership ($cUID) -> $iterator

Return an iterator over the groups that $cUID is a member of.

ObjectMethod checkPassword ($userName,$passwordU) -> $boolean

Finds 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) -> $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

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

ObjectMethod removeUser ($user) -> $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.

ObjectMethod ASSERT_IS_CANONICAL_USER_ID ($user_id) -> $boolean

used 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 code

 
Added:
>
>

ObjectMethod ASSERT_IS_USER_LOGIN_ID ($user_login) -> $boolean

 
Added:
>
>
used for debugging to ensure we are actually passing a user login
 
Changed:
<
<

ObjectMethod createUser ($login,$wikiname) -> $userobject

>
>
These ASSERTS have been disabled, as they have been made dangerous and misleading due to the legacy cUID code
 
Deleted:
<
<
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.
 
Added:
>
>

ObjectMethod ASSERT_IS_USER_DISPLAY_NAME ($user_display) -> $boolean

 
Changed:
<
<

ObjectMethod addUserToMapping ($user) -> $topicName

>
>
used for debugging to ensure we are actually passing a user display_name (commonly a WikiWord Name)
 
Changed:
<
<
Add a user to the persistant mapping that maps from usernames to wikinames and vice-versa.
>
>
These ASSERTS have been disabled, as they have been made dangerous and misleading due to the legacy cUID code
 

Revision 32007-01-16 - TWikiContributor

Line: 43 to 46
 
Added:
>
>

ObjectMethod findUserByEmail ($email) -> \@users

  • $email - email address to look up
Return a list of user objects for the users that have this email registered with the password manager.

 

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.
Line: 56 to 67
 and vice-versa.
Deleted:
<
<

ObjectMethod initializeRemoteUser ($remoteUser) -> $loginName

Return 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}.

Revision 22006-06-25 - TWikiContributor

Line: 10 to 10
 
Added:
>
>

ObjectMethod finish

Complete processing after the client's HTTP request has been responded to.
  1. breaking circular references to allow garbage collection in persistent environments

 

ObjectMethod findUser ($name[,$wikiname][,$nocreate]) -> $userObject

  • $name - login name or wiki name
  • $wikiname - optional, wikiname for created user
Changed:
<
<
  • $nocreate - optional, disable creation of user object for user not found in TWikiUsers
>
>
  • $nocreate - optional, disable creation of user object for user not found
  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 TWikiUsers topic. If $name is found (either in the list
>
>
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

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.
Line: 43 to 50
 
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 Register.pm, or manually outside TWiki.
>
>
Add a user to the persistant mapping that maps from usernames to wikinames and vice-versa.
 

Revision 12006-02-01 - TWikiContributor

Line: 1 to 1
Added:
>
>

Package TWiki::Users

Singleton 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

ObjectMethod findUser ($name[,$wikiname][,$nocreate]) -> $userObject

  • $name - login name or wiki name
  • $wikiname - optional, wikiname for created user
  • $nocreate - optional, disable creation of user object for user not found in TWikiUsers

Find the user object corresponding to $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) -> $userobject

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 addUserToTWikiUsersTopic ($user) -> $topicName

Add 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) -> $loginName

Return 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}.

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding URCS? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.TWikiUsersDotPm.