  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: application_top.php 1400 2007-03-07 00:05:32Z hpdl $ |
| |
| 3 | + | $Id: application_top.php 1440 2007-03-08 21:39:47Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
94 | 94 | | $osC_Session = new osC_Session_Admin('osCAdminID'); |
| |
95 | 95 | | $osC_Session->start(); |
| |
96 | 96 | | |
  |
97 | | - | if (!isset($_SESSION['admin'])) { |
| |
98 | | - | if (!empty($_GET)) { |
| |
| 97 | + | if ( !isset($_SESSION['admin']) ) { |
| |
| 98 | + | $redirect = false; |
| |
| 99 | + | |
| |
| 100 | + | if ( empty($_GET) ) { |
| |
| 101 | + | $redirect = true; |
| |
| 102 | + | } else { |
|
99 | 103 | | $first_array = array_slice($_GET, 0, 1); |
| |
100 | 104 | | $_module = osc_sanitize_string(basename(key($first_array))); |
| |
101 | 105 | | |
  |
102 | | - | if ($_module != 'login') { |
| |
103 | | - | osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, 'login')); |
| |
| 106 | + | if ( $_module != 'login' ) { |
| |
| 107 | + | if ( !isset($_SESSION['redirect_origin']) ) { |
| |
| 108 | + | $_SESSION['redirect_origin'] = array('module' => $module, |
| |
| 109 | + | 'get' => $_GET); |
| |
| 110 | + | } |
| |
| 111 | + | |
| |
| 112 | + | $redirect = true; |
|
104 | 113 | | } |
  |
105 | | - | } else { |
| |
| 114 | + | } |
| |
| 115 | + | |
| |
| 116 | + | if ( $redirect === true ) { |
|
106 | 117 | | osc_redirect_admin(osc_href_link_admin(FILENAME_DEFAULT, 'login')); |
| |
107 | 118 | | } |
  |
| 119 | + | |
| |
| 120 | + | unset($redirect); |
  |
108 | 121 | | } |
| |
109 | 122 | | |
| |
110 | 123 | | require('includes/classes/directory_listing.php'); |