I remember seeing a post about this deep in a forum string somewhere a while back but I am trying to figure out how to secure an external page. Not a custom page but another page opened externally. How would I test for the user being logged in etc. can I just grab the session info and check against it being blank? I just want to make sure this external page is protected . Adding my code to a custom page is not an option. Any help is greatly appreciated.
User security for external page
-
- User
- Posts: 11660
Assume you are using v2017, then simply try this:
<?php
if (session_id() == "") session_start(); // Init session data
ob_start(); // Turn on output buffering
?>
<?php include_once "ewcfg13.php" ?>
<?php include_once "phpfn13.php" ?>
<?php
if (!IsLoggedIn()) {
echo "Access denied. Please <a href='login.php'>login</a>!<br>";
} else {
echo "<h1>Welcome to the external page ...</h1>";
// your external content goes here ...
}
?>
-
- User
- Posts: 2
I have implemented dynamic security and got a problem/error while on the web. It was smooth and good while on the localhost. I got this error message
"Unable to load user level from config file: /home/user/public_html/project1/{98cb30ac-40ea-4497-9528-652f9b6c4217}.xml
any ideas?
TQ
-
- User
- Posts: 58
I ended up doing this :
if (session_id() == "") session_start(); // Init session data
ob_start(); // Turn on output buffering
if(!$_SESSION["NewVDUSAcrm_status"] == "login")
{
echo "Access Denied - Please login to continue...";
}
else
{
}
The actual session variable seems to be <Project name>_status i could probably test for logging in as well as the original function does but this should work