[pmwiki-users] UA2 and self registration (was: UserAuth2 and PresenceAwareness)

ThomasP pmwikidev at sigproc.de
Wed May 30 00:35:16 CDT 2007


Hello,

On Tue, May 29, 2007 01:39, IchBin wrote:
> UserAuth2 and PresenceAwarenessLight work nicely. I am only using it to
> display the status of a visitor:
>
>   - The signed in user account name or otherwise the IP address of the
> visitor.
>   - What page they have loaded.
>   - The state of the page the user has loaded: browse or edit.
>
> I had already added a link for a signed in user to change their password.
>
> Ok, I figured I would try the full blown PresenceAwareness recipe but it
> does not work. All I get is a blank page when I bring up the website. I
> flip-flopped the order and put UserAuth2 before all of the
> PresenceAwareness includes but to no avail. I guess there is a lot of
> duplication between the two recipes and maybe banging heads.
>
> The only reason I wanted to use the PresenceAwareness recipes is because
> of the above reasons, for the PresenceAwarenessLight recipe items, plus
> the ability to register new users and the login form that is used on the
> authors website. I guess I can fool around with a login form to I can
> put in the left sidebar.
>
> Thomas, I was wonder if new user registration could be included in the
> UserAuth2 recipes or should the PresenceAwareness recipe work alone side
> your UserAuth2 recipe.

In principle I strive to make UserAuth2 as comprehensive "as necessary",
at least to the extent of the former UserAuth. New-user registration, or
better self-registration, is definitely one part of this.

On the other hand self-registration is a very specific functionality, and
besides it is easily packed as add-on to UA2. Therefore I would rather
keep this as "recipe in the recipe", and thus leave this to someone else.
(Also because it is useful to think about a bit what functionality is
required first; initial password, email confirmation etc.)

I'm currently not aware of the functionality of PresenceAwareness, but
indeed if it has a new-user registration, this would collide with UA2 (or
rather, it would not interact (different data structures)).

Thomas

----
Basic plan for self-registration (see also code from the former UserAuth):

Similar to userauth2-admintool.php one would have userauth2-selfreg.php
which contained the code for generating HTML forms and adding users.

It will surely be necessary to have a pmwiki action "newuser" or similar
which triggers the web form. Besides there should be a defined parent for
all self-registered users, and a template permission record. (Maybe just
have a designated SelfRegUserTemplate group of which all data is derived.)

Code for adding a user is then similar to code in userauth2-admintool.php
starting from line 327. Especially:

- allow only proper users to be added (no groups)
- check whether user already exists
- lock user
- generate new empty perm record with the specified parent (#)
- pre-populate record with template settings (#)
- similar with profiles
  (here question: generate random password and let user change it
   afterwards? email confirmation?)
- save all
- release lock

(#) together just
$newrecord = loadPermHolderRecord($UA2SelfRegTemplate);





More information about the pmwiki-users mailing list