<<

NAME

pf::email_activation - module to view, query and manage email activations

DESCRIPTION

pf::email_activation contains the functions necessary to manage all aspects of email activation: creation, deletion, activation, etc. It also includes utility methods generate activation codes and validate them.

DEVELOPER NOTES

Notice that this module doesn't export all its subs like our other modules do. This is an attempt to shift our paradigm towards calling with package names and avoid the double naming.

For ex: pf::email_activation::view() instead of pf::email_activation::email_activation_view()

Remove this note when it will be no longer relevant. ;)

CONSTANTS

database
Status-related
Expiration time (in seconds)
Hashing formats related
Email activation types

SUBROUTINES

TODO: This list is incomplete

view - view a an email activation record, returns an hashref
find_code - view an email activation record by activation code without hash-format. Returns an hashref
find_unverified_code - find an unused email activation record by doing a LIKE in the code, returns an hashref
view_by_code - view an email activation record by exact activation code (including hash format). Returns an hashref
add - add an email activation record to the database
_delete - delete an email activation record
modify_status - update the status of a given email activation record
invalidate_code - invalidate all unverified activation codes for a given mac and email
create - create a new activation code

Returns the activation code

_generate_activation_code - generate proper activation code. Created to encapsulate flexible hash types.
_unpack_activation_code - grab the hash-format and the activation hash out of the activation code

Returns a list of: hash version, hash

send_email - Send an email with the activation code
set_status_verified

Change the status of a given email activation code to VERIFIED which means it can't be used anymore.

AUTHOR

Inverse inc. <info@inverse.ca>

COPYRIGHT

Copyright (C) 2005-2013 Inverse inc.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

<<