<<

NAME

pf::web - module to generate the different web pages.

DESCRIPTION

pf::web contains the functions necessary to generate different web pages: based on pre-defined templates: login, registration, release, error, status.

It is possible to customize the behavior of this module by redefining its subs in pf::web::custom. See pf::web::custom for details.

CONFIGURATION AND ENVIRONMENT

Read the following template files: release.html, login.html, enabler.html, error.html, status.html, register.html.

SUBROUTINES

Warning: The list of subroutine is incomplete

i18n_format

Pass message id through gettext then sprintf it.

Meant to be called from the TT templates.

render_template

Cuts in the session cookies and template rendering boiler plate.

stash_template_vars

Sub meant to be overridden in pf::web::custom to inject new variables for consumption by the Templates.

For example, to add a helpdesk phone number variable:

  return { 'helpdesk_phone' => '514-555-1337' };

Afterwards it is available globally, in every template.

generate_aup_standalone_page

Called when someone clicked on /aup which is the pop-up URL for mobile phones.

generate_status_page

Called when someone accesses /status

generate_oauth2_page

Handle the redirect to the proper OAuth2 Provider

generate_oauth2_result

Handle the redirect to the proper OAuth2 Provider

generate_violation_page
web_node_register

This sub is meant to be redefined by pf::web::custom to fit your specific needs. See pf::web::custom for examples.

web_node_record_user_agent

Records User-Agent for the provided node and triggers violations.

validate_form
    return (0, 0) for first attempt
    return (1) for valid form
    return (0, "Error string" ) on form validation problems
web_user_authenticate
    return (1, message string, source id string) for successfull authentication
    return (0, message string, undef) otherwise
generate_pending_page

Shows a page to user saying registration is pending.

end_portal_session

Call after you made your changes to the user / node. This takes care of handling violations, bouncing back to http for portal network access detection or handling mobile provisionning.

This was done in several different locations making maintenance more difficult than it should. It was regrouped here.

generate_generic_page

Present a generic page. Template and arguments provided to template passed as arguments

AUTHOR

Inverse inc. <info@inverse.ca>

Minor parts of this file may have been contributed. See CREDITS.

COPYRIGHT

Copyright (C) 2005-2015 Inverse inc.

Copyright (C) 2005 Kevin Amorin

Copyright (C) 2005 David LaPorte

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.

<<