Community Add-Ons
Login and Return to same page
for osCommerce Online Merchant v2.2
This allows User's to log in and return to the page they were asked to login for, not being sent back to index.php
Open application top paste at bottom before ?>
// if the customer is not logged on, set the page to return to upon login
if ( (basename($PHP_SELF) != FILENAME_LOGIN) && (basename($PHP_SELF) != FILENAME_LOGOFF) && (!strstr($PHP_SELF,'create')) && (!strstr($PHP_SELF,'popup')) {
$navigation->set_snapshot();
}
**************************************
Open Logout.php
Place anywhere
if (sizeof($navigation->snapshot) > 0) {
$origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
$navigation->clear_snapshot();
$link = $origin_href;
} else {
$link = tep_href_link(FILENAME_DEFAULT);
}
******************
Thats all
Legend:
Download
Report
Please read this post as this contribute is not a good solution
http://forums.oscommerce.com/topic/237743-login-redirect-to-index-instead-of-previous-page/page__st__20
Credits to the forum and posters
edit includes/application_top
// navigation history
if (tep_session_is_registered('navigation')) {
if (PHP_VERSION < 4) {
$broken_navigation = $navigation;
$navigation = new navigationHistory;
$navigation->unserialize($broken_navigation);
} elseif (!is_object($navigation)) {
$navigation = new navigationHistory;
}
} else {
tep_session_register('navigation');
$navigation = new navigationHistory;
}
$navigation->add_current_page();
Please read forum for full info
Attached file is nothing
