Hi there,
Ok, first of all, there’s a Google Code site setup for managing the latest versions of WebLoginPE:
http://code.google.com/p/webloginpe/
Really should update the entry in the Extras section to point to that page. Time to add another thing to my to-do’s.
The latest version has support for a new "pending" option for the regType param. I’ll give you a quick rundown with a simple example of how it works:
For the first part, you’ll need to make some adjustments for the signup page. Here’s a basic snippet call for it:
[!WebLoginPE? &type=`register` ®Type=`pending` ®isterTpl=`registerForm` ¬ifyTpl=`notifyMessage` ®SuccessId=`2` ®SuccessPause=`0` ¬ify=`[email protected]`!]
The type is set to ’register’ with the regType set to ’pending’. That part is pretty straightforward. The main difference between the pending regType and activate regType is that no email is sent to the user yet and the user is created in a ’pending’ state.
You’ll also need to create a new webuser group called ’Pending Users’. If you don’t like the name you can specify what group or groups with the pendingGroups. This can be a comma delimited set of group names if more than one webuser group is required.
You can use the same registerTpl form in the documentation for the registration form.
The notifyTpl param allows you to set the message that is sent whenever a user registers with the notify param set to the email addresses to send the message to. If you look at the snippet code, you’ll notice there’s also an optional notifySubject param for setting the subject of the notification email.
With that set, you should be able to fill in the form and, upon submit, a new webuser will be created and set to the appropriate webuser group and an email should be sent out with a notification of a new user.
The last bit will require you to create a page that allows administrators to approve pending users. It’s probably a good idea to make sure that this page is secured for only certain webusers. Here’s the basic call:
[!WebLoginPE? &type=`manager` &activateId=`2` &groupsField=`usergroup` &usersList=`The following accounts require approval:default:default:username:ASC:webgroup(Pending Users)`!]
The type is set to manager which, just like in the documentation, defaults to allowing you to view and edit all the users. However, in this case, we’re gonna do a few other things.
First, we’re gonna set the usersList field so that only users that have the webgroup set to ’Pending Users’ are shown. The usersList param works pretty much the way the documentation says.
Second, we’ll set the ID of the page we’re using to allow users to activate their account. This is necessary because, unlike the ’activate’ regType, the user hasn’t received an activation email yet. This param is what tells the script what page to send in the activation email that is created when you approve a user.
Lastly, you’ll need to tell the script what field to use for the groupsField param. Basically, you’ll need to set your own manageProfileTpl chunk and add a dropdown, set of radio buttons, or checkboxes that allow you to choose what usergroup (or usergroups) to add the user to. Works pretty much like any other custom field in WebLoginPE.
You’ll also need to make one modification to the default manageProfileTpl form. Switch out the default submit button with this one:
<button type="submit" id="wlpeApproveUserButton" name="service" value="approveuser">Submit</button>
This will tell the script to use the ’approveuser’ function instead of the ’saveuser’ function. Basically, it’ll save the user but will send the user a notification telling them how to activate their account.
And, that’s about it. Might have left out a detail or two but that’s the basics nonetheless.
Jeff