Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There are 3 types of user setting storage in In-Portal:

PlaceDurationProsCons
user record in "Users" tableinfinity
  • editable from UI
  • limited number of settings
  • each new setting require new database column
records in "UserSessionData"session (1 hour usually)
  • self-expiring
  • no limit on setting count
 
records in "UserPersistentSessionData"infinity
  • no limit on setting count
  • support fallback to default user setting
 

The "UserPersistentSessionData" table could be used an extension for "Users" table for a particular user, where unlimited number of records could be added.

...

  1. add protected "\SessionStorage::$defaultPersistentVars" property of "array" type
  2. in the "\SessionStorage::LoadPersistentVars" method:
    1. get "DefaultSettingsUserId" system setting value with fallback to "USER_ROOT" constant value
    2. if default user isn't the same as current user, then store persistent settings of above retrieved user in the "\SessionStorage::$defaultPersistentVars" property
  3. in the "\SessionStorage::RecallPersistentVar" method, when handling "$default == ALLOW_DEFAULT_SETTINGS" logic branch:
    1. if "$var_name" key exists in "\SessionStorage::$defaultPersistentVars" array, then store it's value under current user using "\SessionStorage::StorePersistentVar" call
    2. otherwise set "false" into "$this->PersistentVars[$var_name]" and "return false"
  4. confirm, that these cases work & no more, than 2 SELECT happens from "UserPersistentSessionData" table:
    1. non-root user has a persistent setting
    2. non-root user doesn't have a persistent setting
    3. root user has a persistent setting
    4. root user doesn't have a persistent setting

Related Tasks

Jira Legacy
serverSystem Jira
serverId513b375f-8291-3313-9d9f-704c39b1f915
keyINP-1770