$faqsession->userTracking('new_session', 0); } else { if (!is_null($sid_cookie)) { $faqsession->checkSessionId($sid_cookie, $_SERVER['REMOTE_ADDR']); } else { $faqsession->checkSessionId($sid_get, $_SERVER['REMOTE_ADDR']); } } } // // Is user tracking activated? // $sids = ''; if ($faqconfig->get('main.enableUserTracking')) { if (isset($sid)) { PMF_Session::setCookie($sid); if (is_null($sid_cookie)) { $sids = sprintf('sid=%d&lang=%s&', $sid, $LANGCODE); } } elseif (is_null($sid_get) || is_null($sid_cookie)) { if (is_null($sid_cookie)) { if (!is_null($sid_get)) { $sids = sprintf('sid=%d&lang=%s&', $sid_get, $LANGCODE); } } } } else { if (!setcookie(PMF_GET_KEY_NAME_LANGUAGE, $LANGCODE, $_SERVER['REQUEST_TIME'] + PMF_LANGUAGE_EXPIRED_TIME)) { $sids = sprintf('lang=%s&', $LANGCODE); } }
/** * Deletes the CurrentUser from the session. The user * will be logged out. Return true on success, otherwise false. * * @param boolean $deleteCookie * * @return boolean */ public function deleteFromSession($deleteCookie = false) { // delete CSRF Token $this->deleteCsrfTokenFromSession(); // delete CurrentUser object from session $_SESSION[PMF_SESSION_CURRENT_USER] = null; unset($_SESSION[PMF_SESSION_CURRENT_USER]); // log CurrentUser out $this->_loggedIn = false; // delete session-ID $update = sprintf("\n UPDATE\n %sfaquser\n SET\n session_id = NULL\n %s\n WHERE\n user_id = %d", PMF_Db::getTablePrefix(), $deleteCookie ? ', remember_me = NULL' : '', $this->getUserId()); $res = $this->config->getDb()->query($update); if (!$res) { $this->errors[] = $this->config->getDb()->error(); return false; } if ($deleteCookie) { PMF_Session::setCookie(PMF_Session::PMF_COOKIE_NAME_REMEMBERME); } session_destroy(); return true; }
$sids = ''; if ($faqConfig->get('main.enableUserTracking')) { if (isset($sid)) { PMF_Session::setCookie(PMF_Session::PMF_COOKIE_NAME_SESSIONID, $sid); if (is_null($sidCookie)) { $sids = sprintf('sid=%d&lang=%s&', $sid, $LANGCODE); } } elseif (is_null($sidGet) || is_null($sidCookie)) { if (is_null($sidCookie)) { if (!is_null($sidGet)) { $sids = sprintf('sid=%d&lang=%s&', $sidGet, $LANGCODE); } } } } else { if (!PMF_Session::setCookie(PMF_Session::PMF_COOKIE_NAME_SESSIONID, $sid, $_SERVER['REQUEST_TIME'] + PMF_LANGUAGE_EXPIRED_TIME)) { $sids = sprintf('lang=%s&', $LANGCODE); } } // // Found a article language? // $lang = PMF_Filter::filterInput(INPUT_POST, 'artlang', FILTER_SANITIZE_STRING); if (is_null($lang) && !PMF_Language::isASupportedLanguage($lang)) { $lang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRING); if (is_null($lang) && !PMF_Language::isASupportedLanguage($lang)) { $lang = $LANGCODE; } } // // Create a new FAQ object