The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Apache::iNcom::Request - Manages the Apache::iNcom request's informations.

SYNOPSIS

    my $user = $Request->user

    etc.

DESCRIPTION

This module is responsible for managing the environment in which the Apache::iNcom page will execute. It setups all the objects that will be accessible to the pages through globals and also provides the page with a bunch of utility functions. It also provides a bunch of methods for managing the information associated with the request.

INITIALIZATION

An object is automatically initialized on each request by the Apache::iNcom framework. It is accessible through the $Request global variable in Apache::iNcom pages.

logged_in

Returns true if the request is associated with a UserDB's user.

user

Returns the UserDB's user associated with the current request.

current

Returns the name of the current page relative to INCOM_PREFIX.

previous

Returns the name of the previous page fetched by the user.

browser

Returns the user agent string sent by the user's browser.

remote_host

Returns the hostname of the user. This can be an IP address is hostname resolution is turn off.

remote_ip

Returns the ip address of the user.

login ( $username, $password )

Invokes the login methods of the UserDB and if the login succeeded, the user will be associated with the current Session, and its informations will be available on each subsequent requests until the user logout.

logout

Removes the association between the user and the request.

APACHE::INCOM PAGE GLOBALS

Here is a list of the global variables that are defined in the page when it is executing.

$Request

An Apache::iNcom::Request object which can used to query information about the current request.

$DB

A DBIx::SearchProfiles object initialized with as requested by the Apache::iNcom configuration.

$Cart

An Apache::iNcom::CartManager object initialized with the configured pricing profile.

$Order

An Apache::iNcom::OrderManager object initialized with the configured order profiles.

%Session

A hash which associated with the current client. Values in that hash will persist across request until the user close its browser or INCOM_SESSION_EXPIRES time has elapsed.

%UserSession

A hash which associated with the user currently logged. Values in that hash will persist across request as long as the client is logged in and will be cleared once the user logs out.

$UserDB

A DBIx::UserDB object which should be used for user management.

$Validator

An HTML::Validator object initialized with the configured input profiles.

$Localizer

An Apache::iNcom::Localizer object initialized with the user requested language.

$Locale

A Locale::Maketext object initialized with the proper locale. The Locale::Maketext subclass used is specified in the INCOM_LOCALE configuration directives.

APACHE::INCOM PAGE FUNCTIONS

Here is list of the helper functions that are defined in the context of the executing page and that can be used.

Localize ( ... )

This acts as a wrapper around $Locale->maketext. It should be used to format messages in a localized format for the user.

Currency ( ... )

This acts as a wrapper around $Locale->currency. It should be used to format amount of money for display.

Include ( $file_or_param_ref )

This is a function which is like HTML::Embperl::Execute in that it includes another page in the current one. The difference is that this included page will be executed in the name space of the current so that all global variables remains accessible. Also, this functions checks for the presence of a localized version of the file and checks in the INCOM_TEMPLATE_PATH if the path is not absolute.

TextInclude ( file )

This is a function is like Include except that it is not interpreted for embedded perl.

QueryArgs ( [ $fdat ], [ $odat ], [ $idat ] )

This function is similar to the [$ hidden $] directive in HTML::Embperl but instead of generating hidden input fields, it returns the form data as a query string.

$fdat

The form data to output. Defaults to the %fdat hash.

$odat

Override data. Fields present in that hash will override the one in %fdat.

$idat

Ignored data. Fields present in that hash will be ignored and not output in the resulting query string.

    Usage example :

    <a href="search.html?[- QueryArgs() -]">Next</a>

AUTHOR

Copyright (c) 1999 Francis J. Lacoste and iNsu Innovations Inc. All rights reserved.

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.

SEE ALSO

Apache::iNcom(3) Apache::iNcom::OrderManager(3) Apache::iNcom::CartManager(3) DBIx::SearchProfiles(3) DBIx::UserDB(3) Locale::Maketext(3) HTML::Embperl