Package =TWiki::Users::PasswordBase class of all password handlers. Default behaviour is no passwords, so anyone can be anyone they like. The methods of this class should be overridded by subclasses that want to implement other password handling methods.On this page:
ClassMethod new ($session) -> $objectConstructs a new password handler of this type, referring to $session for any required TWiki services.ObjectMethod finish ()Break circular references.ObjectMethod readOnly () -> booleanreturns true if the password database is not currently modifyable also needs to call $this->{session}->enter_context('passwords_modifyable'); if you want to be able to use the existing TWikiUserMappingContrib ChangePassword topicsObjectMethod fetchPass ($login) -> $passwordEImplements TWiki::Password Returns encrypted password if succeeds. Returns 0 if login is invalid. Returns undef otherwise.ObjectMethod checkPassword ($login,$passwordU) -> $booleanFinds if the password is valid for the given user. Returns 1 on success, undef on failure.ObjectMethod removeUser ($login) -> $booleanDelete the users entry. | ||||||||
Changed: | ||||||||
< < | ObjectMethod setPassword ($login,$newPassU,$oldPassU) -> $boolean | |||||||
> > | ObjectMethod setPassword ($login,$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. | ||||||||
Added: | ||||||||
> > | If $mcp is true, the "must change password" flag is set | |||||||
Otherwise returns 1 on success, undef on failure.
encrypt( $login, $passwordU, $fresh ) -> $passwordEWill return an encrypted password. Repeated calls to encrypt with the same login/passU will return the same passE. However if the passU is changed, and subsequently changed back to the old login/passU pair, then the old passE is no longer valid. If $fresh is true, then a new password not based on any pre-existing salt will be used. Set this if you are generating a completely new password.ObjectMethod error () -> $stringReturn any error raised by the last method call, or undef if the last method call succeeded.ObjectMethod *isManagingEmails () -> $booleanDetermines if this manager can store and retrieve emails. The password manager is used in preference to the user mapping manager for storing emails, on the basis that emails need to be secure, and the password database is the most secure place. If a password manager does not manage emails, then TWiki will fall back to using the user mapping manager (which by default will store emails in user topics) The default ('none') password manager does not manage emails. ObjectMethod getEmails ($login) -> @emails
Fetch the email address(es) for the given login. Default
behaviour is to return an empty list. Called by Users.pm.
Only used if isManagingEmails -> true .
ObjectMethod setEmails ($login,@emails) -> $booleanSet the email address(es) for the given login name. Returns true if the emails were set successfully. Default behaviour is a nop, which will result in the user mapping manager taking over. Called by Users.pm. Only used ifisManagingEmails -> true .
ObjectMethod *findUserByEmail ($email) -> \@usersReturns an array of login names that relate to a email address. Defaut behaviour is a nop, which will result in the user mapping manager being asked for its opinion. If subclass implementations return a value for this, then the user mapping manager will not be asked. Only used ifisManagingEmails -> true .
Called by Users.pm. | ||||||||
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.
Sub classes should return an empty string if save action is OK, or an
error string starting with 'Error: '. | |||||||
ObjectMethod canFetchUsers () -> booleanreturns true if the fetchUsers method is implemented and can return an iterator of users. returns undef / nothing in this case, as we are unable to generate a list of usersObjectMethod fetchUsers () -> newTWiki::ListIterator(\@users)returns a TWikiIterator of loginnames from the password source. If AllowLoginNames is false this is used to remove the need for a TWikiUsers topic. |
Package =TWiki::Users::PasswordBase class of all password handlers. Default behaviour is no passwords, so anyone can be anyone they like. The methods of this class should be overridded by subclasses that want to implement other password handling methods.On this page:
ClassMethod new ($session) -> $objectConstructs a new password handler of this type, referring to $session for any required TWiki services.ObjectMethod finish ()Break circular references.ObjectMethod readOnly () -> booleanreturns true if the password database is not currently modifyable also needs to call $this->{session}->enter_context('passwords_modifyable'); if you want to be able to use the existing TWikiUserMappingContrib ChangePassword topicsObjectMethod fetchPass ($login) -> $passwordEImplements TWiki::Password Returns encrypted password if succeeds. Returns 0 if login is invalid. Returns undef otherwise.ObjectMethod checkPassword ($login,$passwordU) -> $booleanFinds if the password is valid for the given user. Returns 1 on success, undef on failure.ObjectMethod removeUser ($login) -> $booleanDelete the users entry.ObjectMethod setPassword ($login,$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.encrypt( $login, $passwordU, $fresh ) -> $passwordEWill return an encrypted password. Repeated calls to encrypt with the same login/passU will return the same passE. However if the passU is changed, and subsequently changed back to the old login/passU pair, then the old passE is no longer valid. If $fresh is true, then a new password not based on any pre-existing salt will be used. Set this if you are generating a completely new password.ObjectMethod error () -> $stringReturn any error raised by the last method call, or undef if the last method call succeeded.ObjectMethod *isManagingEmails () -> $booleanDetermines if this manager can store and retrieve emails. The password manager is used in preference to the user mapping manager for storing emails, on the basis that emails need to be secure, and the password database is the most secure place. If a password manager does not manage emails, then TWiki will fall back to using the user mapping manager (which by default will store emails in user topics) The default ('none') password manager does not manage emails. ObjectMethod getEmails ($login) -> @emails
Fetch the email address(es) for the given login. Default
behaviour is to return an empty list. Called by Users.pm.
Only used if isManagingEmails -> true .
ObjectMethod setEmails ($login,@emails) -> $booleanSet the email address(es) for the given login name. Returns true if the emails were set successfully. Default behaviour is a nop, which will result in the user mapping manager taking over. Called by Users.pm. Only used ifisManagingEmails -> true .
| ||||||||
Changed: | ||||||||
< < | ObjectMethod *findLoginByEmail ($email) -> \@users | |||||||
> > | ObjectMethod *findUserByEmail ($email) -> \@users | |||||||
Returns an array of login names that relate to a email address.
Defaut behaviour is a nop, which will result in the user mapping manager
being asked for its opinion. If subclass implementations return a value for
this, then the user mapping manager will not be asked.
Only used if isManagingEmails -> true .
Called by Users.pm.
ObjectMethod canFetchUsers () -> booleanreturns true if the fetchUsers method is implemented and can return an iterator of users. returns undef / nothing in this case, as we are unable to generate a list of usersObjectMethod fetchUsers () -> newTWiki::ListIterator(\@users)returns a TWikiIterator of loginnames from the password source. If AllowLoginNames is false this is used to remove the need for a TWikiUsers topic. |
Package =TWiki::Users::PasswordBase class of all password handlers. Default behaviour is no passwords, so anyone can be anyone they like. The methods of this class should be overridded by subclasses that want to implement other password handling methods.On this page:
ClassMethod new ($session) -> $objectConstructs a new password handler of this type, referring to $session for any required TWiki services. | ||||||||
Changed: | ||||||||
< < | ObjectMethod *finish | |||||||
> > | ObjectMethod finish () | |||||||
Added: | ||||||||
> > | Break circular references. | |||||||
Deleted: | ||||||||
< < | Complete processing after the client's HTTP request has been responded
to.
| |||||||
Added: | ||||||||
> > | ObjectMethod readOnly () -> boolean | |||||||
Added: | ||||||||
> > | returns true if the password database is not currently modifyable also needs to call $this->{session}->enter_context('passwords_modifyable'); if you want to be able to use the existing TWikiUserMappingContrib ChangePassword topics | |||||||
ObjectMethod fetchPass ($login) -> $passwordEImplements TWiki::Password | ||||||||
Changed: | ||||||||
< < | Returns encrypted password if succeeds. Returns 0 if login is invalid. | |||||||
> > | Returns encrypted password if succeeds. | |||||||
Added: | ||||||||
> > | Returns 0 if login is invalid. | |||||||
Returns undef otherwise. | ||||||||
Changed: | ||||||||
< < | ObjectMethod checkPassword ($user,$passwordU) -> $boolean | |||||||
> > | ObjectMethod checkPassword ($login,$passwordU) -> $boolean | |||||||
Changed: | ||||||||
< < | Finds if the password is valid for the given login. | |||||||
> > | Finds if the password is valid for the given user. | |||||||
Returns 1 on success, undef on failure. | ||||||||
Changed: | ||||||||
< < | ObjectMethod deleteUser ($user) -> $boolean | |||||||
> > | ObjectMethod removeUser ($login) -> $boolean | |||||||
Changed: | ||||||||
< < | Delete users entry. | |||||||
> > | Delete the users entry. | |||||||
Deleted: | ||||||||
< < | Returns 1 on success, undef on failure. | |||||||
Added: | ||||||||
> > | ObjectMethod setPassword ($login,$newPassU,$oldPassU) -> $boolean | |||||||
Changed: | ||||||||
< < | ObjectMethod passwd ($user,$newPassU,$oldPassU) -> $boolean | |||||||
> > | If the $oldPassU matches matches the user's password, then it will | |||||||
Deleted: | ||||||||
< < | If the $oldPassU is undef, it will try to add the user, failing if they are already there. If the $oldPassU matches matches the login'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. | ||||||||
Changed: | ||||||||
< < | encrypt( $user, $passwordU, $fresh ) -> $passwordE | |||||||
> > | encrypt( $login, $passwordU, $fresh ) -> $passwordE | |||||||
Will return an encrypted password. Repeated calls | ||||||||
Changed: | ||||||||
< < | to encrypt with the same user/passU will return the same passE. | |||||||
> > | to encrypt with the same login/passU will return the same passE. | |||||||
However if the passU is changed, and subsequently changed back | ||||||||
Changed: | ||||||||
< < | to the old user/passU pair, then the old passE is no longer valid. | |||||||
> > | to the old login/passU pair, then the old passE is no longer valid. | |||||||
If $fresh is true, then a new password not based on any pre-existing
salt will be used. Set this if you are generating a completely
new password.
ObjectMethod error () -> $stringReturn any error raised by the last method call, or undef if the last method call succeeded. | ||||||||
Changed: | ||||||||
< < | ObjectMethod getEmails ($user) -> @emails | |||||||
> > | ObjectMethod *isManagingEmails () -> $boolean | |||||||
Added: | ||||||||
> > | Determines if this manager can store and retrieve emails. The password manager is used in preference to the user mapping manager for storing emails, on the basis that emails need to be secure, and the password database is the most secure place. If a password manager does not manage emails, then TWiki will fall back to using the user mapping manager (which by default will store emails in user topics) | |||||||
Changed: | ||||||||
< < | Fetch the email address(es) for the given username. Default behaviour | |||||||
> > | The default ('none') password manager does not manage emails. | |||||||
Deleted: | ||||||||
< < | is to look up the users' personal topic. | |||||||
Changed: | ||||||||
< < | ObjectMethod setEmails ($user,@emails) | |||||||
> > | ObjectMethod getEmails ($login) -> @emails | |||||||
Added: | ||||||||
> > | Fetch the email address(es) for the given login. Default
behaviour is to return an empty list. Called by Users.pm.
Only used if isManagingEmails -> true . | |||||||
Changed: | ||||||||
< < | Set the email address(es) for the given username in the user topic. | |||||||
> > | ||||||||
Added: | ||||||||
> > |
ObjectMethod setEmails ($login,@emails) -> $booleanSet the email address(es) for the given login name. Returns true if the emails were set successfully. Default behaviour is a nop, which will result in the user mapping manager taking over. Called by Users.pm. Only used ifisManagingEmails -> true .
ObjectMethod *findLoginByEmail ($email) -> \@usersReturns an array of login names that relate to a email address. Defaut behaviour is a nop, which will result in the user mapping manager being asked for its opinion. If subclass implementations return a value for this, then the user mapping manager will not be asked. Only used ifisManagingEmails -> true .
Called by Users.pm.
ObjectMethod canFetchUsers () -> booleanreturns true if the fetchUsers method is implemented and can return an iterator of users. returns undef / nothing in this case, as we are unable to generate a list of usersObjectMethod fetchUsers () -> newTWiki::ListIterator(\@users)returns a TWikiIterator of loginnames from the password source. If AllowLoginNames is false this is used to remove the need for a TWikiUsers topic. | |||||||
Package =TWiki::Users::PasswordBase class of all password handlers. Default behaviour is no passwords, so anyone can be anyone they like. The methods of this class should be overridded by subclasses that want to implement other password handling methods.On this page:
ClassMethod new ($session) -> $objectConstructs a new password handler of this type, referring to $session for any required TWiki services.ObjectMethod *finish | ||||||||
Added: | ||||||||
> > | ||||||||
Complete processing after the client's HTTP request has been responded
to.
ObjectMethod fetchPass ($login) -> $passwordE | ||||||||
Added: | ||||||||
> > | ||||||||
Implements TWiki::Password
Returns encrypted password if succeeds. Returns 0 if login is invalid.
Returns undef otherwise.
ObjectMethod checkPassword ($user,$passwordU) -> $booleanFinds if the password is valid for the given login. Returns 1 on success, undef on failure.ObjectMethod deleteUser ($user) -> $booleanDelete users entry. Returns 1 on success, undef on failure.ObjectMethod passwd ($user,$newPassU,$oldPassU) -> $booleanIf the $oldPassU is undef, it will try to add the user, failing if they are already there. If the $oldPassU matches matches the login'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.encrypt( $user, $passwordU, $fresh ) -> $passwordEWill return an encrypted password. Repeated calls to encrypt with the same user/passU will return the same passE. However if the passU is changed, and subsequently changed back to the old user/passU pair, then the old passE is no longer valid. If $fresh is true, then a new password not based on any pre-existing salt will be used. Set this if you are generating a completely new password.ObjectMethod error () -> $stringReturn any error raised by the last method call, or undef if the last method call succeeded. ObjectMethod getEmails ($user) -> @emails
Fetch the email address(es) for the given username. Default behaviour
is to look up the users' personal topic.
ObjectMethod setEmails ($user,@emails)Set the email address(es) for the given username in the user topic. |
Package =TWiki::Users::PasswordBase class of all password handlers. Default behaviour is no passwords, so anyone can be anyone they like. The methods of this class should be overridded by subclasses that want to implement other password handling methods.On this page:
ClassMethod new ($session) -> $objectConstructs a new password handler of this type, referring to $session for any required TWiki services. | ||||||||
Added: | ||||||||
> > | ObjectMethod *finishComplete processing after the client's HTTP request has been responded to.
| |||||||
ObjectMethod fetchPass ($login) -> $passwordEImplements TWiki::Password Returns encrypted password if succeeds. Returns 0 if login is invalid. Returns undef otherwise.ObjectMethod checkPassword ($user,$passwordU) -> $booleanFinds if the password is valid for the given login. Returns 1 on success, undef on failure.ObjectMethod deleteUser ($user) -> $booleanDelete users entry. Returns 1 on success, undef on failure.ObjectMethod passwd ($user,$newPassU,$oldPassU) -> $booleanIf the $oldPassU is undef, it will try to add the user, failing if they are already there. If the $oldPassU matches matches the login'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.encrypt( $user, $passwordU, $fresh ) -> $passwordEWill return an encrypted password. Repeated calls to encrypt with the same user/passU will return the same passE. However if the passU is changed, and subsequently changed back to the old user/passU pair, then the old passE is no longer valid. If $fresh is true, then a new password not based on any pre-existing salt will be used. Set this if you are generating a completely new password.ObjectMethod error () -> $stringReturn any error raised by the last method call, or undef if the last method call succeeded. ObjectMethod getEmails ($user) -> @emails
Fetch the email address(es) for the given username. Default behaviour
is to look up the users' personal topic.
ObjectMethod setEmails ($user,@emails)Set the email address(es) for the given username in the user topic. |
Package =TWiki::Users::PasswordBase class of all password handlers. Default behaviour is no passwords, so anyone can be anyone they like. The methods of this class should be overridded by subclasses that want to implement other password handling methods.On this page:
ClassMethod new ($session) -> $objectConstructs a new password handler of this type, referring to $session for any required TWiki services.ObjectMethod fetchPass ($login) -> $passwordEImplements TWiki::Password Returns encrypted password if succeeds. Returns 0 if login is invalid. Returns undef otherwise.ObjectMethod checkPassword ($user,$passwordU) -> $booleanFinds if the password is valid for the given login. Returns 1 on success, undef on failure.ObjectMethod deleteUser ($user) -> $booleanDelete users entry. Returns 1 on success, undef on failure.ObjectMethod passwd ($user,$newPassU,$oldPassU) -> $booleanIf the $oldPassU is undef, it will try to add the user, failing if they are already there. If the $oldPassU matches matches the login'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.encrypt( $user, $passwordU, $fresh ) -> $passwordEWill return an encrypted password. Repeated calls to encrypt with the same user/passU will return the same passE. However if the passU is changed, and subsequently changed back to the old user/passU pair, then the old passE is no longer valid. If $fresh is true, then a new password not based on any pre-existing salt will be used. Set this if you are generating a completely new password.ObjectMethod error () -> $stringReturn any error raised by the last method call, or undef if the last method call succeeded. ObjectMethod getEmails ($user) -> @emails
Fetch the email address(es) for the given username. Default behaviour
is to look up the users' personal topic.
ObjectMethod setEmails ($user,@emails)Set the email address(es) for the given username in the user topic. |