Base 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.
Constructs a new password handler of this type, referring to $session for any required TWiki services.
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
Implements TWiki::Password
Returns encrypted password if succeeds. Returns 0 if login is invalid. Returns undef otherwise.
Finds if the password is valid for the given user.
Returns 1 on success, undef on failure.
Delete the users entry.
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.
If $mcp is true, the "must change password" flag is set
Otherwise returns 1 on success, undef on failure.
Will 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.
Return any error raised by the last method call, or undef if the last method call succeeded.
The default ('none') password manager does not manage emails.
isManagingEmails
-> true
.
isManagingEmails
-> true
.
isManagingEmails
-> true
.
Called by Users.pm.
Returns 1 if the $cUID must change the password, else 0. Returns undef if $cUID not found.
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.
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: '.
returns 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 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.