NAME
MyPageKit::Common - Model class containing code common across site.
DESCRIPTION
This class contains methods that are common across the site, such as authentication and session key generation. This particular class is an example class that is used for the pagekit.org website. It is derived from Apache::PageKit::Model and a base class for the Model classes for the pagekit.org site. In general, the class hierarchy should look like:
+---------------------------------------+
| Apache::PageKit::Model |
| Model code that provides an interface |
| to PageKit and is common to all sites |
+---------------------------------------+
|
+---------------------------------------+
| MyPageKit::Common |
| Model code that is particular to the |
| site, but common across all pages |
+---------------------------------------+
/ | \
+----------------------------+ +----------------------------+
| MyPageKit::YourClass1 | | MyPageKit::YourClassN |
| Model code that is for a | ... | Model code that is for a |
| group of pages on the site | | group of pages on the site |
+----------------------------+ +----------------------------+
It is a good starting point for building your own base class for your Model classes.
METHODS
These are the methods that your should implement in your own MyPageKit::Common class:
- pkit_dbi_connect
-
Should return a DBI database handler object (
$dbh
). This object can be accessed from the rest of the Model by the method$model->dbh
. - pkit_session_setup
-
Should return a hash reference with three key/value pairs:
* session_store_class The object store class that should be used for L<Apache::PageKit::Session> session handling. * session_lock_class The lock manager class that should be used for L<Apache::PageKit::Session> session handling. * session_args Reference to an hash containing options for the C<session_lock_class> and C<session_store_class>.
- pkit_auth_credential
-
Should verify the user-supplied credentials and return a session key. The session key can be any string - often you'll use the user ID and a MD5 hash of a a secret key, user ID, password.
- pkit_auth_session_key
-
Should verify the session key (previously generated by
auth_credential
) and return the user ID. This user ID will be fed to$model->input_param('pkit_user')
. - pkit_common_code
-
Executes code that is common across your site.
AUTHOR
T.J. Mather (tjmather@anidea.com)
COPYRIGHT
Copyright (c) 2000, AnIdea, Corp. All rights Reserved. PageKit is a trademark of AnIdea Corp.
LICENSE
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 Ricoh Source Code Public License for more details.
You can redistribute this module and/or modify it only under the terms of the Ricoh Source Code Public License.
You should have received a copy of the Ricoh Source Code Public License along with this program; if not, obtain one at http://www.pagekit.org/license