buildrelease
[openafs-wiki.git] / TWiki / TWikiUsersPasswordDotPm.mdwn
index 148ea1a..f8fb09e 100644 (file)
@@ -8,15 +8,20 @@ The methods of this class should be overridded by subclasses that want to implem
   <ul>
     <li><a href="#Package =TWiki::Users::Password="> Package TWiki::Users::Password</a><ul>
         <li><a href="#ClassMethod <strong>new</strong> ($session) ->"> ClassMethod new <tt>($session) -&gt; $object</tt></a></li>
-        <li><a href="#ObjectMethod *finish*"> ObjectMethod finish <tt></tt></a></li>
+        <li><a href="#ObjectMethod <strong>finish</strong> ()"> ObjectMethod finish <tt>()</tt></a></li>
+        <li><a href="#ObjectMethod <strong>readOnly</strong> () -> bo"> ObjectMethod readOnly <tt>() -&gt; boolean</tt></a></li>
         <li><a href="#ObjectMethod <strong>fetchPass</strong> ($login"> ObjectMethod fetchPass <tt>($login) -&gt; $passwordE</tt></a></li>
-        <li><a href="#ObjectMethod <strong>checkPassword</strong> ($u"> ObjectMethod checkPassword <tt>($user,$passwordU) -&gt; $boolean</tt></a></li>
-        <li><a href="#ObjectMethod <strong>deleteUser</strong> ($user"> ObjectMethod deleteUser <tt>($user) -&gt; $boolean</tt></a></li>
-        <li><a href="#ObjectMethod <strong>passwd</strong> ($user,$ne"> ObjectMethod passwd <tt>($user,$newPassU,$oldPassU) -&gt; $boolean</tt></a></li>
-        <li><a href="#encrypt( $user, $passwordU, $fre"> encrypt( $user, $passwordU, $fresh ) -&gt; $passwordE</a></li>
+        <li><a href="#ObjectMethod <strong>checkPassword</strong> ($l"> ObjectMethod checkPassword <tt>($login,$passwordU) -&gt; $boolean</tt></a></li>
+        <li><a href="#ObjectMethod <strong>removeUser</strong> ($logi"> ObjectMethod removeUser <tt>($login) -&gt; $boolean</tt></a></li>
+        <li><a href="#ObjectMethod <strong>setPassword</strong> ($log"> ObjectMethod setPassword <tt>($login,$newPassU,$oldPassU) -&gt; $boolean</tt></a></li>
+        <li><a href="#encrypt( $login, $passwordU, $fr"> encrypt( $login, $passwordU, $fresh ) -&gt; $passwordE</a></li>
         <li><a href="#ObjectMethod <strong>error</strong> () -> $stri"> ObjectMethod error <tt>() -&gt; $string</tt></a></li>
-        <li><a href="#ObjectMethod <strong>getEmails</strong> ($user)"> ObjectMethod getEmails <tt>($user) -&gt; @emails</tt></a></li>
-        <li><a href="#ObjectMethod <strong>setEmails</strong> ($user,"> ObjectMethod setEmails <tt>($user,@emails)</tt></a></li>
+        <li><a href="#ObjectMethod *is_ManagingEmails*"> ObjectMethod isManagingEmails <tt>() -&gt; $boolean</tt></a></li>
+        <li><a href="#ObjectMethod <strong>getEmails</strong> ($login"> ObjectMethod getEmails <tt>($login) -&gt; @emails</tt></a></li>
+        <li><a href="#ObjectMethod <strong>setEmails</strong> ($login"> ObjectMethod setEmails <tt>($login,@emails) -&gt; $boolean</tt></a></li>
+        <li><a href="#ObjectMethod *find_LoginByEmail*"> ObjectMethod findLoginByEmail <tt>($email) -&gt; \@users</tt></a></li>
+        <li><a href="#ObjectMethod <strong>can_FetchUsers</strong> ()"> ObjectMethod canFetchUsers <tt>() -&gt; boolean</tt></a></li>
+        <li><a href="#ObjectMethod <strong>fetchUsers</strong> () ->"> ObjectMethod fetchUsers <tt>() -&gt; newTWiki::ListIterator(\@users)</tt></a></li>
       </ul>
     </li>
   </ul>
@@ -26,11 +31,13 @@ The methods of this class should be overridded by subclasses that want to implem
 
 Constructs a new password handler of this type, referring to $session for any required TWiki services.
 
-## <a name="ObjectMethod &lt;strong&gt;finish*"></a><a name="ObjectMethod *finish&lt;/strong&gt; "></a> [[ObjectMethod]] **finish** ``
+## <a name="ObjectMethod &lt;strong&gt;finish&lt;/strong&gt; ()"></a> [[ObjectMethod]] **finish** `()`
 
-Complete processing after the client's HTTP request has been responded to.
+Break circular references.
 
-1. breaking circular references to allow garbage collection in persistent environments
+## <a name="ObjectMethod &lt;strong&gt;readOnly&lt;/strong&gt; () - boo"></a> [[ObjectMethod]] **readOnly** `() -> boolean`
+
+returns true if the password database is not currently modifyable also needs to call $this-&gt;\{session\}-&gt;enter\_context('passwords\_modifyable'); if you want to be able to use the existing [[TWikiUserMappingContrib]] [[ChangePassword]] topics
 
 ## <a name="ObjectMethod &lt;strong&gt;fetchPass&lt;/strong&gt; ($login"></a> [[ObjectMethod]] **fetchPass** `($login) -> $passwordE`
 
@@ -38,23 +45,19 @@ Implements TWiki::Password
 
 Returns encrypted password if succeeds. Returns 0 if login is invalid. Returns undef otherwise.
 
-## <a name="ObjectMethod &lt;strong&gt;checkPassword&lt;/strong&gt; ($u"></a> [[ObjectMethod]] **checkPassword** `($user,$passwordU) -> $boolean`
+## <a name="ObjectMethod &lt;strong&gt;checkPassword&lt;/strong&gt; ($l"></a> [[ObjectMethod]] **checkPassword** `($login,$passwordU) -> $boolean`
 
-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.
 
-## <a name="ObjectMethod &lt;strong&gt;deleteUser&lt;/strong&gt; ($user"></a> [[ObjectMethod]] **deleteUser** `($user) -> $boolean`
-
-Delete users entry.
-
-Returns 1 on success, undef on failure.
+## <a name="ObjectMethod &lt;strong&gt;removeUser&lt;/strong&gt; ($logi"></a> [[ObjectMethod]] **removeUser** `($login) -> $boolean`
 
-## <a name="ObjectMethod &lt;strong&gt;passwd&lt;/strong&gt; ($user,$ne"></a> [[ObjectMethod]] **passwd** `($user,$newPassU,$oldPassU) -> $boolean`
+Delete the users entry.
 
-If the $oldPassU is undef, it will try to add the user, failing if they are already there.
+## <a name="ObjectMethod &lt;strong&gt;setPassword&lt;/strong&gt; ($log"></a> [[ObjectMethod]] **setPassword** `($login,$newPassU,$oldPassU) -> $boolean`
 
-If the $oldPassU matches matches the login's password, then it will replace it with $newPassU.
+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.
 
@@ -62,11 +65,11 @@ If $oldPassU is 1, will force the change irrespective of the existing password,
 
 Otherwise returns 1 on success, undef on failure.
 
-## <a name="encrypt( $user, $passwordU, $fre"></a> encrypt( $user, $passwordU, $fresh ) -&gt; $passwordE
+## <a name="encrypt( $login, $passwordU, $fr"></a> encrypt( $login, $passwordU, $fresh ) -&gt; $passwordE
 
-Will return an encrypted password. Repeated calls to encrypt with the same user/passU will return the same passE.
+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 user/passU pair, then the old passE is no longer valid.
+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.
 
@@ -74,10 +77,30 @@ If $fresh is true, then a new password not based on any pre-existing salt will b
 
 Return any error raised by the last method call, or undef if the last method call succeeded.
 
-## <a name="ObjectMethod &lt;strong&gt;getEmails&lt;/strong&gt; ($user)"></a> [[ObjectMethod]] **getEmails** `($user) -> @emails`
+## <a name="ObjectMethod &lt;strong&gt;is_ManagingEmails*"></a> [[ObjectMethod]] \*isManagingEmails `() -> $boolean`
+
+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)
+
+The default ('none') password manager does **not** manage emails.
+
+## <a name="ObjectMethod &lt;strong&gt;getEmails&lt;/strong&gt; ($login"></a> [[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` -&gt; `true`.
+
+## <a name="ObjectMethod &lt;strong&gt;setEmails&lt;/strong&gt; ($login"></a> [[ObjectMethod]] **setEmails** `($login,@emails) -> $boolean`
+
+Set 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 if `isManagingEmails` -&gt; `true`.
+
+## <a name="ObjectMethod &lt;strong&gt;find_LoginByEmail*"></a> [[ObjectMethod]] \*findLoginByEmail `($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` -&gt; `true`.
+
+Called by Users.pm.
+
+## <a name="ObjectMethod &lt;strong&gt;can_FetchUsers&lt;/strong&gt; ()"></a> [[ObjectMethod]] **canFetchUsers** `() -> boolean`
 
-Fetch the email address(es) for the given username. Default behaviour is to look up the users' personal topic.
+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
 
-## <a name="ObjectMethod &lt;strong&gt;setEmails&lt;/strong&gt; ($user,"></a> [[ObjectMethod]] **setEmails** `($user,@emails)`
+## <a name="ObjectMethod &lt;strong&gt;fetchUsers&lt;/strong&gt; () - n"></a> [[ObjectMethod]] **fetchUsers** `() -> newTWiki::ListIterator(\@users)`
 
-Set the email address(es) for the given username in the user topic.
+returns a [[TWikiIterator]] of loginnames from the password source. If [[AllowLoginNames]] is false this is used to remove the need for a [[TWikiUsers]] topic.