FWS::V2::Session - Framework Sites version 2 session related methods
Version 1.13091122
use FWS::V2; my $fws = FWS::V2->new(); $fws->saveFormValue( 'thisThing' );
FWS version 2 session methods are used to manipulate how a session is maintained, authenticated, and initiated.
Return a list of all the available form values passed.
# # get the array # my @formArray = $fws->formArray();
Get or set a form value. If the value was not set, it will always return an empty string, never undefined.
# # set the form value # $fws->formValue( 'myVar', 'This is what its set to' ); # # get the form value and pass it to the html rendering # $valueHash{html} .= $fws->formValue( 'myVar' );
Retrieve the GUID for the fws site. If it does not yet exist, make a new one.
print $fws->fwsGUID();
Gather the passed form values, and from it set the language formValue and the session formValue.
# # get the array # $fws->setFormValues();
Set the session for a FWS web based page rendering.
# # Set the session # $fws->setSession();
Determine the site friendly url and set it.
# # Set the site friendly URL # $fws->setSiteFriendly();
Get or set the current language. If no language is currently set, the first entry in language will be used. If languageArray has not be set, then 'EN' will be used. The language can be set by being passed as a form value with the name 'fws_lang'.
# # set the language # $fws->language( 'FR' ); # # get the language # $valueHash{html} .= 'The current language is: ' . $fws->language() . '<br />';
Set the languages the site will use. The first one in the list will be considered default. If languageArray is not set it will just contain 'EN'.
# # set the languages available # $fws->languageArray( 'EN', 'FR', 'SP' );
Process the web action for logins
# # Run login # $fws->processLogin();
Log out FWS admin user
# # Log out currently logged in admin user # $fws->adminLogOut();
Log out FWS site user
# # Log out currently logged in site user # $fws->userLogOut();
Crypt password passing the crypt mmethod you would like to use. Set $fws->{FWSCrypt} to set method. Current default is perl crypt.
Current Methods: crypt: Perl default crypt
Example: # # Log out currently logged in site user # my $cryptedPass = $fws->cryptPassword( 'thePasswordYourCrypting' );
Mark a formValue to remain persistant with the session. The return of this function will be the current saveWithSessionHash.
# # This should go in a 'init' element or located int he go.pl file # at any point it can be referenced via formValue # $fws->saveFormValue( 'myCity' );
Commit the current session to the sessions table. This is only needed if you need to cmmit the session before you perform a 302 redirect or if yuor immitating the pringPage() method with a custom one. Not the session does actually do anything if its values have not chagned from its innital load from the session table.
# # This should go in a 'init' element or located int he go.pl file # at any point it can be referenced via formValue # $fws->saveSession();
Set default values derived from the site settings for a site. This will also set the formValue 'p' to the homeGUID if no 'p' value is currently set.
# # currently rendered site # $fws->setSiteValues(); # # set site values for some other site # $fws->setSiteValues( 'othersite' );
Get or save a siteValue for the session.
# # save something # $fws->siteValue( 'something', 'this is something' ); # # get something # my $something = $fws->siteValue( 'something' );
Get an admin user value. This is used mostly for security flags and is only used to get values FWS has set.
# # is the admin user a developer? # my $isDeveloper = $fws->userValue( 'isDeveloper' );
Nate Lewis, <nlewis at gnetworks.com>
<nlewis at gnetworks.com>
Please report any bugs or feature requests to bug-fws-v2 at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=FWS-V2. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-fws-v2 at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc FWS::V2::Session
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=FWS-V2
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/FWS-V2
CPAN Ratings
http://cpanratings.perl.org/d/FWS-V2
Search CPAN
http://search.cpan.org/dist/FWS-V2/
Copyright 2013 Nate Lewis.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install FWS::V2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FWS::V2
CPAN shell
perl -MCPAN -e shell install FWS::V2
For more information on module installation, please visit the detailed CPAN module installation guide.