PVPh(V1k(Vz(V@k(Vm/y(Vz(V0y(V|(Vz(V|(VU~(Vz(VPL )؂z`}x2k}xe}xhis->db->getQuery(true) ->delete($this->db->quoteName('#__session')) ->where($this->db->quoteName('time') . ' < :time') ->bind(':time', $time, ParameterType::INTEGER); $this->db->setQuery($query); try { $this->db->execute(); } catch (ExecutionFailureException) { // Since garbage collection does not result in a fatal error when run in the session API, we don't allow it here either. } } /** * Check if the session record exists * * @param string $sessionId The session ID to check * * @return integer Status value for record presence * * @since 4.0.0 */ private function checkSessionRecordExists(string $sessionId): int { $query = $this->db->getQuery(true) ->select($this->db->quoteName('session_id')) ->from($this->db->quoteName('#__session')) ->where($this->db->quoteName('session_id') . ' = :session_id') ->bind(':session_id', $sessionId) ->setLimit(1); $this->db->setQuery($query); try { $exists = $this->db->loadResult(); } catch (ExecutionFailureException) { return self::$sessionRecordUnknown; } if ($exists) { return self::$sessionRecordExists; } return self::$sessionRecordDoesNotExist; } /** * Create the session record * * @param SessionInterface $session The session to create the metadata record for. * @param User $user The user to associate with the record. * * @return void * * @since 4.0.0 */ private function createSessionRecord(SessionInterface $session, User $user) { $query = $this->db->getQuery(true); $time = $session->isNew() ? time() : $session->get('session.timer.start'); $columns = [ $this->db->quoteName('session_id'), $this->db->quoteName('guest'), $this->db->quoteName('time'), $this->db->quoteName('userid'), $this->db->quoteName('username'), ]; // Add query placeholders $values = [ ':session_id', ':guest', ':time', ':user_id', ':username', ]; // Bind query values $sessionId = $session->getId(); $userIsGuest = $user->guest; $userId = $user->id; $username = $user->username ?? ''; $query->bind(':session_id', $sessionId) ->bind(':guest', $userIsGuest, ParameterType::INTEGER) ->bind(':time', $time) ->bind(':user_id', $userId, ParameterType::INTEGER) ->bind(':username', $username); if ($this->app instanceof CMSApplication && !$this->app->get('shared_session', false)) { $clientId = $this->app->getClientId(); $columns[] = $this->db->quoteName('client_id'); $values[] = ':client_id'; $query->bind(':client_id', $clientId, ParameterType::INTEGER); } $query->insert($this->db->quoteName('#__session')) ->columns($columns) ->values(implode(', ', $values)); $this->db->setQuery($query); try { $this->db->execute(); } catch (ExecutionFailureException) { // This failure isn't critical, we can go on without the metadata } } /** * Update the session record * * @param SessionInterface $session The session to update the metadata record for. * @param User $user The user to associate with the record. * * @return void * * @since 4.0.0 */ private function updateSessionRecord(SessionInterface $session, User $user) { $query = $this->db->getQuery(true); $time = time(); $setValues = [ $this->db->quoteName('guest') . ' = :guest', $this->db->quoteName('time') . ' = :time', $this->db->quoteName('userid') . ' = :user_id', $this->db->quoteName('username') . ' = :username', ]; // Bind query values $sessionId = $session->getId(); $userIsGuest = $user->guest; $userId = $user->id; $username = $user->username ?? ''; $query->bind(':session_id', $sessionId) ->bind(':guest', $userIsGuest, ParameterType::INTEGER) ->bind(':time', $time) ->bind(':user_id', $userId, ParameterType::INTEGER) ->bind(':username', $username); if ($this->app instanceof CMSApplication && !$this->app->get('shared_session', false)) { $clientId = $this->app->getClientId(); $setValues[] = $this->db->quoteName('client_id') . ' = :client_id'; $query->bind(':client_id', $clientId, ParameterType::INTEGER); } $query->update($this->db->quoteName('#__session')) ->set($setValues) ->where($this->db->quoteName('session_id') . ' = :session_id'); $this->db->setQuery($query); try { $this->db->execute(); } catch (ExecutionFailureException) { // This failure isn't critical, we can go on without the metadata } } } 500 Internal Server Error
Failed to load 'rt_koleti' template: Please install Gantry 5 Framework!