Apache2-PageKit
view release on metacpan or search on metacpan
docsrc/reference.xml view on Meta::CPAN
Error page when page cannot be found. Defaults to <literal><link linkend="config.global.default_page">default_page</link></literal>.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.page_session">
<term>page_session</term>
<listitem>
<para>
Sets the default for all non static pages.
If set to <emphasis>yes</emphasis>, every non static page gets a unique session.
Defaults to <emphasis>no</emphasis>. This value is overridden with
<literal><link linkend="config.page.page_session">page_session</link></literal>.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.page_session_class">
<term>page_session_class</term>
<listitem>
<para>
Name for the Module, that is used to create the page_session objects.
Defaults to <emphasis>Apache::SessionX</emphasis>.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.post_max">
<term>post_max</term>
<listitem>
<para>
Maximum size of file uploads, in bytes. Defaults to 100,000,000 (100 MB).
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.upload_tmp_dir">
<term>upload_tmp_dir</term>
<listitem>
<para>
Temporary directory for file uploads. Defaults to whatever libapreq finds usefull.
This options is only usefull if you use libapreq >= 1.0. The temporary directory
usually needs to reside on the same filesystem as the location supplied to the
upload object's <programlisting>link</programlisting> method. See the Apache::Request
documentation for further information.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.protect_static">
<term>protect_static</term>
<listitem>
<para>
If set to <emphasis>yes</emphasis> static files can also be protected with the
require_login attribute in the SECTION or PAGE tags.
Set this option to <emphasis>no</emphasis> to be compatible to PageKit < 1.09.
Defaults to <emphasis>yes</emphasis>.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.recent_login_timeout">
<term>recent_login_timeout</term>
<listitem>
<para>
Seconds that user's session has to be inactive before a user is asked
to verify a password on pages with the <literal><link linkend="config.page.require_login">require_login</link></literal> attribute
set to <emphasis>recent</emphasis>. Defaults to 3600 (1 hour).
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.relaxed_parser">
<term>relaxed_parser</term>
<listitem>
<para>
If set to yes, this option allows template tags to be placed inside
HTML comments. It also permits spaces and newlines within the tag itself.
This option may be useful to HTML authors who would like to validate their
templates' HTML syntax prior to processing, or who use DTD-aware editing
tools.
Defaults to <emphasis>no</emphasis>.
<informalexample>
<programlisting>
relaxed_parser = "yes"
# these tags are all allowed if relaxed_parser is enabled:
<MODEL_VAR NAME="x">
< MODEL_VAR NAME = 'x' >
< MODEL_LOOP NAME = x >
< PKIT_COMPONENT NAME = x />
<!-- MODEL_VAR NAME="x" -->
<!-- CONTENT_VAR NAME = "x" /-->
</programlisting>
</informalexample>
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.request_param_in_tmpl">
<term>request_param_in_tmpl</term>
<listitem>
<para>
If set to yes, then <literal><link linkend="model.var"><MODEL_VAR></link></literal> tags in template automatically get filled in
with corresponding request parameters across all pages. Can be overriden
by the corresponding <link linkend="config.page.request_param_in_tmpl">page attribute</link>. Defaults to <emphasis>no</emphasis>.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.request_class">
<term>request_class</term>
<listitem>
<para>
Name for the Module, that is used to create the request class objects.
Defaults to <emphasis>Apache::Request::PageKit</emphasis>. Which is a
subclass of Apache::Request. A own subclass is usefull, if you like to
change the data container for your requstparameter or modify them on
init() or new().
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.session_class">
<term>session_class</term>
<listitem>
<para>
Name for the Module, that is used to create the session objects.
docsrc/reference.xml view on Meta::CPAN
<term>template_class</term>
<listitem>
<para>
Name for the Module, that is used to create the template objects.
Defaults to <emphasis>HTML::Template</emphasis>.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.uri_prefix">
<term>uri_prefix</term>
<listitem>
<para>
Prefix of URI that should be trimmed before dispatching to the Model code.
</para>
<para>
See also <link linkend="model.api.pkit_fixup_uri">pkit_fixup_uri</link>
in the Model API.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.use_locale">
<term>use_locale</term>
<listitem>
<para>
If set to <emphasis>yes</emphasis> pkit translates the original message to the language
of the client if possible. If <link linkend="config.server.reload">reload</link>
is set to <emphasis>yes</emphasis>, the translationtables are reloaded on every usage else only on first usage.
</para>
<para>
Defaults to <emphasis>no</emphasis>.
See also <link linkend="model.api.pkit_gettext">pkit_gettext</link> and
<link linkend="model.api.pkit_gettext_message">pkit_gettext_message</link>
in the Model API.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.use_recent_login_timeout">
<term>use_recent_login_timeout</term>
<listitem>
<para>
If set to <emphasis>no</emphasis>, PageKit does not note, when a user requested a page.
As a result, <link linkend="config.page.require_login">require_login</link> can not
check recent anymore. But you get a speedup for Sites, that do not use this future.
</para>
<para>
Defaults to <emphasis>yes</emphasis>.
See also <link linkend="config.global.recent_login_timeout">recent_login_timeout</link>.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.global.verify_page">
<term>verify_page</term>
<listitem>
<para>
Verify password form. Defaults to <literal><link linkend="config.global.login_page">login_page</link></literal>.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2>
<title>Section Attributes</title>
<para>
These options are global across each server and all Views. They are in the
<SECTIONS> tag of <filename>Config/Config.xml</filename>.
</para>
<para>
All Page attributes are valid. <SECTION> Tags with the longest matching part of the id attribute
provide the defaults for pages without the attribute in question.
<PAGE> attributes written in the <PAGE> tag have the highest priority. If nothing is found the
<SECTION> Tags are scanned for a default. The closest match wins and the search is over.
See the line with /xyz in the example bellow, if we request /xyz/abc, the search ends at
the line with id='/xyz' and the page does not require a login!
</para>
<informalexample>
<programlisting>
<SECTIONS>
<SECTION id='/' require_login='yes'/>
<SECTION id='/xyz' request_param_in_tmpl='yes'/>
<SECTION id='/free' require_login='no'/>
</SECTIONS>
</programlisting>
</informalexample>
<variablelist>
<varlistentry id="config.section.id">
<term>id</term>
<listitem>
<para>
This is part of the uri path to the page where the defaults take place. '/' Means the whole site.
This attribute is needed in every <SECTION> tag.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2>
<title>Server Attributes</title>
<para>
These options are global over all pages, but are local to each server configuration
(e.g. production, staging, development). They are located in the <SERVERS> tag of
<filename>Config/Config.xml</filename>.
</para>
<variablelist>
<varlistentry id="config.server.can_edit">
<term>can_edit</term>
<listitem>
<para>
If set to <emphasis>yes</emphasis>, enables <link linkend="features.editing">on-line editing tools</link>.
docsrc/reference.xml view on Meta::CPAN
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Method must return a hash reference using <ulink url="http://kobesearch.cpan.org/search?dist=Apache-SessionX">Apache::SessionX</ulink> session
setup arguments. This hash reference should contain the following key/value pairs:
</para>
<variablelist>
<varlistentry>
<term>session_store_class</term>
<listitem>
The object store class that should be used for
Apache::SessionX session handling.
</listitem>
</varlistentry>
<varlistentry>
<term>session_lock_class</term>
<listitem>
The lock manager class that should be used for
Apache::PageKit::Session session handling.
</listitem>
</varlistentry>
<varlistentry>
<term>session_args</term>
<listitem>
Reference to an hash containing options for the
<literal>session_lock_class</literal> and <literal>session_store_class</literal>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
</refentry>
<refentry id="model.api.pkit_auth_credential">
<refnamediv>
<refname>pkit_auth_credential</refname>
<refpurpose>
Verifies login credentials and returns session key
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
sub pkit_auth_credential {
my ($model) = @_;
# in this example, login and passwd are the names of the credential fields
my $login = $model->input('login');
my $passwd = $model->input('passwd');
# create a session key
# your code here.........
return $ses_key;
}
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Verifies the user-supplied credentials and return a session key. The
session key is a string that is stored on the user's computer using cookies.
Often you'll use the user ID and a MD5 hash of a a secret key, user ID, password.
</para>
<para>
Note that the string returned should not contain any commas, spaces, or semi-colons.
</para>
</refsect1>
</refentry>
<refentry id="model.api.pkit_auth_session_key">
<refnamediv>
<refname>pkit_auth_session_key</refname>
<refpurpose>Verifies a session key and returns the user ID and session ID
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
sub pkit_auth_session_key {
my ($model, $ses_key) = @_;
# check whether $ses_key is valid, if so return user id in $user_id
# your code here.........
return $ok ? ($user_id, $session_id) : undef;
}
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Verifies the session key (previously generated by <link linkend="model.api.pkit_auth_credential">auth_credential</link>)
and returns the user ID, and session ID.
</para>
<para>
The returned user ID will be fed to <literal>$r->connection->user</literal>.
</para>
<para>
The returned session ID will used to retreive the session from the database.
</para>
</refsect1>
</refentry>
<refentry id="model.api.pkit_common_code">
<refnamediv>
<refname>pkit_common_code</refname>
<refpurpose>
Code common across site.
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
sub pkit_common_code {
my $model = shift;
# code that should be executed for every page on your site here...
}
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Code that gets called before the page and component code for every page on
the site.
</para>
( run in 0.801 second using v1.01-cache-2.11-cpan-39bf76dae61 )