Adding a new config setting in the config class (user specific)

Hi,

how i can add a new config setting in the config class, and i want this config to be user specific so that every user has its own value on that setting

Thanks in advance

Parents Reply
  • Hi Dan,

    I think i solved this i was trying to save a synctoken for some users so i used the custom fields to achieve this

    but just for curiosity can we add let say a custom panel for each user in the user management and there we can add some specific settings?

    Thanks

Children
  • You can you UserPreference module to save some setting:

    global $current_user;
    $user_preferences = new UserPreference($current_user);
    $user_preferences->setPreference('preference_name','preference_value','some_preference_identifier'); //set some settings to SESSION
    $user_preferences->savePreferencesToDB(); //set some settings from SESSION to DB
    
    $preferences = $user_preferences->getPreference('preference_name','some_preference_identifier'); //get setting by name