Difference: TWikiUsersDotPm (4 vs. 5)

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

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