Guest Posted May 26, 2004 Posted May 26, 2004 i would like to put some of the pages to be only viewable by registered customers/members only any way yo do this with osc?
gazzzzzza Posted May 26, 2004 Posted May 26, 2004 yes if you mean users registered to the forum, then put the code below near the top of every page you want blocking (must be after "incude application_top" i believe as this loads the function- i think app_top is included in the header though so no real need to worry about this i dont think) - it will redirect them to the register/login page if (tep_session_is_registered('customer_id')) { tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } always here to offer some useless advice....
Guest Posted May 26, 2004 Posted May 26, 2004 not working! well i do not have a forum, but some images we would only like to show to those who have registered in osc
gazzzzzza Posted May 27, 2004 Posted May 27, 2004 lol sorry thats what i meant i typed forum instead of osc!! DOH see the above for your solution then :D always here to offer some useless advice....
Guest Posted May 27, 2004 Posted May 27, 2004 did it on the top of the page. not working. guest can still see the page
gazzzzzza Posted May 28, 2004 Posted May 28, 2004 on mine i have an include at the top of every page i want them to have to be logged in to visit the included file contains this code: ---START CODE require('includes/application_top.php'); if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } ----END CODE it seems to work on mine :huh: they are redirected to login on almost all pages if they have not logged in... (note: if you do a similar thing then remember to remove the 'include application top.php from the page that you add this include to else it will error) always here to offer some useless advice....
DrX Posted May 28, 2004 Posted May 28, 2004 ---START CODE require('includes/application_top.php'); if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } ----END CODE or use tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'NONSSL')); if you are not able to use SSL
Recommended Posts
Archived
This topic is now archived and is closed to further replies.