|
NAMETemplate::Plugin::GantryAuthCookie - decrypter for AuthCookie pluginSYNOPSISIn a Template Toolkit:[% USE decrypter = GantryAuthCookie( { cookie = cookies.cookie_name, conf_instance = 'gantry_conf_instance', conf_file = '/etc/strange.gantry.conf', } ) %] [% user_name = decrypter.user_name %] conf_file is optional and defaults to /etc/gantry.conf Alternatively, you could omit conf_instance and conf and directly supply the auth_secret key: [% USE decrypter = GantryAuthCookie( { cookie = cookies.cookie_name, auth_secret = env.auth_secret } ) %] In httpd.conf (or something it includes): PerlModule Apache::Template PerlSetEnv auth_secret '$ecr3t' TT2Params cookies env <Files *.something> SetHandler perl-script PerlHandler Apache::Template </Files> DESCRIPTIONYou don't need this module if your page is generated by a Gantry controller. In that case, you can use Gantry::Plugins::AuthCookie and call its validate_user function directly. Use this when you need to display user information on a page which is generated by Apache::Template.This module is a Template Toolkit plugin for decrypting Gantry::Plugins::AuthCookie cookies. In the USE statement in your template, pass at least the contents of the cookie and either the name of your Gantry::Conf instance or your auth_secret. If your master Gantry::Conf file is not /etc/gantry.conf, it as well. You must define auth_secret in Gantry::Conf, or pass it directly. If you pass it directly, you probably want to use PerlSetEnv to keep it out of the template. That's what I did in the SYNOPSIS above. METHODS
SEE ALSOGantry::Plutings::AuthCookie, Gantry::ConfAUTHORPhil Crow <philcrow2000@yahoo.com>COPYRIGHT and LICENSECopyright (c) 2006, Phil CrowThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
Visit the GSP FreeBSD Man Page Interface. |