if (empty($auth['user_id'])) { return array(CONTROLLER_STATUS_REDIRECT, $index_script); } fn_add_breadcrumb(fn_get_lang_var('my_account')); $profile_id = 0; $user_data = fn_get_user_info($auth['user_id'], true, $profile_id); $view->assign('user_data', $user_data); $view->assign('view_mode', 'simple'); } elseif ($mode == 'change_login') { $auth = $_SESSION['auth']; if (!empty($auth['user_id'])) { // Log user logout fn_log_event('users', 'session', array('user_id' => $auth['user_id'], 'time' => TIME - $auth['this_login'], 'timeout' => false)); } unset($_SESSION['auth'], $_SESSION['cart']['user_data']); fn_delete_cookies(AREA_NAME . '_user_id', AREA_NAME . '_password'); return array(CONTROLLER_STATUS_OK, fn_url('checkout.checkout')); } function fn_auth_routines($request) { $status = true; $user_login = $_REQUEST['user_login']; $password = $_POST['password']; $field = Registry::get('settings.General.use_email_as_login') == 'Y' ? 'email' : 'user_login'; $user_data = db_get_row("SELECT * FROM ?:users WHERE {$field} = ?s", $user_login); if (!empty($user_data)) { $user_data['usergroups'] = fn_get_user_usergroups($user_data['user_id']); } fn_set_hook('auth_routines', $status, $user_data); if (!empty($user_data['user_type']) && $user_data['user_type'] != 'A' && AREA == 'A') { fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('error_area_access_denied'));
$suffix = 'update'; list($user_id, $profile_id) = $res; // Cleanup user info stored in cart if (!empty($_SESSION['cart']) && !empty($_SESSION['cart']['user_data']) && AREA != 'A') { unset($_SESSION['cart']['user_data']); } if (Registry::get('settings.General.user_multiple_profiles') == 'Y') { $suffix .= "?profile_id={$profile_id}"; } if (AREA == 'A') { $suffix .= "?user_id={$user_id}"; } // Delete anonymous authentication if (AREA != 'A') { if ($cu_id = fn_get_cookie('cu_id') && !empty($auth['user_id'])) { fn_delete_cookies('cu_id'); } } } else { $suffix = 'add'; } return array(CONTROLLER_STATUS_OK, "profiles." . $suffix); } // // Update user // if ($mode == 'update') { if (fn_is_restricted_admin($_REQUEST) == true) { return array(CONTROLLER_STATUS_DENIED); } $user_id = AREA == 'A' && !empty($_REQUEST['user_id']) ? $_REQUEST['user_id'] : $auth['user_id'];