NAME
MKDoc::Auth::Plugin::Signup - Let users open new user accounts.
SUMMARY
This module lets users open new user accounts.
Rather than creating MKDoc::Auth::User objects, this module creates MKDoc::Auth::TempUser objects and sends an email containing a confirmation link.
MKDoc::Auth::TempUser objects live for a limited amount of time in a disk cache rather than in the database.
When a user visits the confirmation page, the MKDoc::Auth::TempUser is deleted and turned into a regular MKDoc::Auth::User object which lives in the database.
This process has a triple advantage:
- Account subscription is truly opt-in.
- User email address is guaranteed at the time of subscription.
- Your user table is not filled up with bogus user accounts.
INHERITS FROM
API
$self->location();
Returns the PATH_INFO which will trigger this plugin.
$self->uri_hint();
Helps deciding what the URI of this plugin should be.
By default, returns 'signup.html'.
Can be overriden by setting the MKD__AUTH_SIGNUP_URI_HINT environment variable or by subclassing.
$self->http_post();
When a form is submitted, it means that a user has filled in the subscription form and pressed OK.
This method processes the POST operation.
It attempts to create a new MKDoc::Auth::TempUser based on the information passed in the signup form.
$self->send_mail();
This method is used when a MKDoc::Auth::TempUser was successfully created.
It sends an email containing a confirmation link (see MKDoc::Auth::Plugin::Confirm) as well as the user details.
TEMPLATE METHODS
self/object
Returns the newly created MKDoc::Auth::TempUser object, if any. If self/object exists, then you can invoke MKDoc::Auth::TempUser methods.
<ul petal:condition="true: self/object">
<li>Login: <span petal:replace="self/object/login">fred</span></li>
<li>Full Name: <span petal:replace="self/object/full_name">Fred FlintStone</span></li>
<!--? etc. ?-->
</ul>
self/password
Returns the password which has been generated for the new user.
self/login
Returns the login which has been genereated for the new user.