Difference between revisions of "Functions:authorizeIsLoggedIn"

From Whirlwind eCommerce Wiki
Jump to: navigation, search
(New page: == Description == eV::authorizeIsLoggedIn($redirectOnFalse) checks if a user in currently logged in to the session. == Syntax == $bool = authorizeIsLoggedIn([$redirectOnFalse]); == Param...)
(No difference)

Revision as of 12:47, 25 February 2009

Description

eV::authorizeIsLoggedIn($redirectOnFalse) checks if a user in currently logged in to the session.

Syntax

$bool = authorizeIsLoggedIn([$redirectOnFalse]);

Paramaters

  • $redirectOnFalse STRING OPTIONAL
URL to forward visitor to, if log in check fails.

Return Values

Returns boolean TRUE/FALSE IF $redirectOnFalse is empty or not passed.

Examples

Example using redirect (forwarding)
// typically placed in the pre-process area of the template
// forward to home page with a message
// if anyone attempts to access a page using this template without being logged in
eV::authorizeIsLoggedIn('index.php?message=You must be logged in to view this page');
Example without using redirect
// just checking log in status in order to show different content
$isLoggedIn = eV::authorizeIsLoggedIn();
if($isLoggedIn){
// logged in
echo "You are logged in";
} else {
// not logged in
echo "YOu are not logged in";
};