Functions:authorizeIsLoggedOut

From Whirlwind eCommerce Wiki
Jump to: navigation, search

Description

eV::authorizeIsLoggedOut($redirectOnFalse) checks if a user is currently logged out.

Syntax

$bool = authorizeIsLoggedOut([$redirectOnFalse]);

Paramaters

  • $redirectOnFalse STRING OPTIONAL
URL to forward visitor to, if logged out check fails.

Return Values

Returns boolean TRUE/FALSE IF $redirectOnFalse is empty or not passed. TRUE if user is not logged into an account; FALSE if use is logged into an account.

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 while being logged in
eV::authorizeIsLoggedOut('index.php?message=You must be logged out to view this page');
Example without using redirect
// just checking log in status in order to show different content
$isLoggedOut = eV::authorizeIsLoggedOut();
if(!$isLoggedOut){
// logged in
echo "You are logged in";
} else {
// not logged in
echo "YOu are not logged in";
};