Skip to content

PloneGov-IT/collective.pfg.userjoin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easily subscribe new user to you Plone site by using a custom PloneFormGen join form

The scope of this add-on is to collect join request to your site without enabling the "Enable self-registration" option in the security control panel.

Every join request is stored in a new PloneFormGen adapter called "User Join Adapter", then site administrator or other power users can "confirm" the request (and create a new site's member) or discard it.

First of all create you Form Folder with all the fields you want to use. Not every field you use must be used as user data, for example you can required fields that will be used by other adapters.

Fields you must include are the ones that ask for the new userid and (probably) the email. The password field is not required (and will not be used) because the adapter will rely onto the Plone native password reset feature.

Form filling example

Please note that a captcha protection is probably something you don't want to miss. See the PloneFormGen documentation for more.

Now create the adapter.

Adapter edit form

You must properly configure the "Userid form field", where you must select the form field where you plan to ask form username.

The same must be done for "Email form field" and (optionally) "Fullname form field".

Please remember to enable the adapter in the PloneFormGen edit form.

Your user configuration fieldset can be different from the Plone default, for example you can have a complex configuration that ask for additional informations like phone number, SSN, ...

You can handle this by also filling the "Map additional user's data" field. For every user properties on the right you can select which form field (on the left) must be used to populate that user info when the user will be finally created.

You can configure the adapter to automatically add users to one or more groups when the join request will be confirmed.

By navigate to the adapter a list of join requests is provided.

Show join requests

The table will recap all form fields that you included in the adapter configuration, showing values provided at the form submission. Please note that every form field provided is stored (you can preview all of the data by clicking on the userid link).

Then you can confirm join requests, that means you will create one or more new members, or discard them deleting the data.

As said above, this product will not handle passwords so after a request is confirmed the default site reset password feature is triggered: the user will receive the standard password reset email.

This product will not send any email so you probably like to use the standard PloneFormGen mailer adapter if you need to warn power user to evaluate new submissions. To help in this a @@join-detail view is provided.

Show/Confirm a single join request

The adapter will add two new request informations you can use in the mailer (adapter execution orders matters):

pfguserjoin_obj
Adapter object
pfguserjoin_newid
Record id of the request

For example you can edit the "Mail-Body Template" as follow:

<html xmlns="http://www.w3.org/1999/xhtml">

  <head><title></title></head>

  <body>
    <p tal:content="here/getBody_pre | nothing" />
    <dl>
        <tal:block repeat="field options/wrappedFields | nothing">
            <dt tal:content="field/fgField/widget/label" />
            <dd tal:content="structure python:field.htmlValue(request)" />
        </tal:block>
    </dl>
    <p tal:content="here/getBody_post | nothing" />
    <pre tal:content="here/getBody_footer | nothing" />
    <p>Go to the
        <a tal:attributes="href string:${request/pfguserjoin_obj/absolute_url}/@@join-detail?id:int=${request/pfguserjoin_newid}">
            subscription confirmation page
        </a>
    </p>
  </body>
</html>

By default this add-on will limit dangerous features to Managers and Site administrators. Please note that a badly configured adapter can open your site to security issues.

collective.pfg.userjoin: Edit Awkward Fields
This permission is the one that controls who can edit problematic adapter fields (user configuration, groups, ...)
collective.pfg.userjoin: Manage Join Attempts
This permission is the one that controls who can confirm join requests or discard them
collective.pfg.userjoin: View Sentive Data
By playing with this permission you can limit people able to see submitted data.

Developed with the support of S. Anna Hospital, Ferrara; S. Anna Hospital supports the PloneGov initiative.

This product was developed by RedTurtle Technology team.

RedTurtle Technology Site

About

A PloneFormGen adapter for subscribe users to the site

Resources

Stars

Watchers

Forks

Packages

No packages published