if ($user_data['user_type'] == 'V') { $area = $area == 'A' ? 'V' : $area; } } $sess_data = array('auth' => fn_fill_auth($user_data, array(), true, $area), 'last_status' => empty($_SESSION['last_status']) ? '' : $_SESSION['last_status']); if (Registry::get('settings.General.store_mode') == 'Y') { $sess_data['store_access_key'] = Registry::get('settings.General.store_access_key'); } $areas = array('A' => 'admin', 'V' => 'vendor', 'C' => 'customer'); fn_init_user_session_data($sess_data, $_REQUEST['user_id'], true); $old_sess_id = Session::getId(); $redirect_url = !empty($_REQUEST['redirect_url']) ? $_REQUEST['redirect_url'] : ''; if ($area != 'C') { Session::setName($areas[$area]); $sess_id = Session::regenerateId(); Session::save($sess_id, $sess_data, $area); Session::setName(ACCOUNT_TYPE); Session::setId($old_sess_id, false); } else { // Save unique key for session $key = fn_crc32(microtime()) . fn_crc32(microtime() + 1); fn_set_storage_data('session_' . $key . '_data', serialize($sess_data)); if (fn_allowed_for('ULTIMATE')) { $company_id_in_url = fn_get_company_id_from_uri($redirect_url); if (Registry::get('runtime.company_id') || !empty($user_data['company_id']) || Registry::get('runtime.simple_ultimate') || !empty($company_id_in_url)) { // Redirect to the personal frontend $company_id = !empty($user_data['company_id']) ? $user_data['company_id'] : Registry::get('runtime.company_id'); if (!$company_id && Registry::get('runtime.simple_ultimate')) { $company_id = fn_get_default_company_id(); } elseif (!$company_id) { $company_id = $company_id_in_url;
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Development; use Tygh\Registry; use Tygh\Session; use Tygh\BlockManager\Location; use Tygh\BlockManager\Layout; if (!defined('BOOTSTRAP')) { die('Access denied'); } if (!empty($_REQUEST['skey'])) { $session_data = fn_get_storage_data('session_' . $_REQUEST['skey'] . '_data'); fn_set_storage_data('session_' . $_REQUEST['skey'] . '_data', ''); if (!empty($session_data)) { $_SESSION = unserialize($session_data); Session::save(Session::getId(), $_SESSION); fn_calculate_cart_content($_SESSION['cart'], $_SESSION['auth'], 'S', true, 'F', true); fn_save_cart_content($_SESSION['cart'], $_SESSION['auth']['user_id']); } return array(CONTROLLER_STATUS_REDIRECT, fn_query_remove(REAL_URL, 'skey')); } // UK Cookies Law if (Registry::get('settings.Security.uk_cookies_law') == 'Y') { if (!empty($_REQUEST['cookies_accepted']) && $_REQUEST['cookies_accepted'] == 'Y') { $_SESSION['cookies_accepted'] = true; } if (!defined('AJAX_REQUEST') && empty($_SESSION['cookies_accepted'])) { $url = fn_link_attach(Registry::get('config.current_url'), 'cookies_accepted=Y'); $text = __('uk_cookies_law', array('[url]' => $url)); fn_delete_notification('uk_cookies_law'); fn_set_notification('W', __('warning'), $text, 'K', 'uk_cookies_law');