Simplified Cookie-Based Frontend Hack
Posted: Sun 4. Jul 2004, 18:06
From what I understand the frontend aspect of phpwcms is due for future release...so posting a thread on another hack/strategy to implement it might be inapproprate at this stage. Nonetheless..I thought I would ask others in the community about advice on how to go about it, since prelims/strategies on a project are pending asap. The Kurty frontend hack that was discussed back in March still has some issues with it, it seems....so a somwhat simplified approach came to my mind. I just finished a hand-coded site that relies on standard php cookies, that exist on conditions of successful login. As long as the user is logged in the cookie is set, the redirect script (checking if cookie is not set) in the header on sensitive pages gets by-passed:
This works pretty reliably. With respect to the project at hand....got a client who wants a small-sized real estate website, with both public pages and private pages (private property listings) that incorporates some sort of forntend/login. So basically the login might be treated by setting a cookie.
I have developed a Flash menu system that would be able to determine the login cookie status and then conditionally spit out XML based on the acat_public conditonal. If logged in..the XML output would list both public and non-public pages. If not looged in (No cookie) then public only pages get listed in the menu. Have a pretty good idea on how to implement this.
The real question is about accessing non-public pages via 'non-menu' methods, ie bookmarks/manually typing in address (uses alaises) in the address. Still need a method to boot non-logged in users from viewing these pages.
So basically my question is where can I successfully the above mentioned cookie sniffer script within the standardized phpwcms implementation. As I understand it works on session cookies, whereas my simplified hack (future tense) might rely on standard cookies. Wanted to ask others their thoughts about how phpwcms might be modified to check for cookie status before running the standard script for page generation.
Thoughts/ideas/suggestions would be appreciated.
Cheers, jsw(john)
Code: Select all
<?php if (!isset($_COOKIE['logincookie'])) {
// Output header, send to login if no cookie exists
header ( "Location: back_to_login.php" );
exit;
}I have developed a Flash menu system that would be able to determine the login cookie status and then conditionally spit out XML based on the acat_public conditonal. If logged in..the XML output would list both public and non-public pages. If not looged in (No cookie) then public only pages get listed in the menu. Have a pretty good idea on how to implement this.
The real question is about accessing non-public pages via 'non-menu' methods, ie bookmarks/manually typing in address (uses alaises) in the address. Still need a method to boot non-logged in users from viewing these pages.
So basically my question is where can I successfully the above mentioned cookie sniffer script within the standardized phpwcms implementation. As I understand it works on session cookies, whereas my simplified hack (future tense) might rely on standard cookies. Wanted to ask others their thoughts about how phpwcms might be modified to check for cookie status before running the standard script for page generation.
Thoughts/ideas/suggestions would be appreciated.
Cheers, jsw(john)