home | products | customer | support | forums | contact
Sign in | Join |
in
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-22-2010 6:45

    Setting language in Principal.GetLoginInterface for a validated user

    Hi,

    We've written our own user provider which implements the IFeedbackServerPrincipal interface. When we've validated the user we return null in the GetLoginInterface method. This works, but we also want to set the user language. This doesn't seem to work with calling HttpContext.Current.Session["FS_SessionLanguage"] = "nl-NL"; when returning null.

    Can we solve this problem and how should we do this?

       Greetings, Mathieu

  • 06-22-2010 8:31 In reply to

    • Tom
    • Top 10 Contributor
    • Joined on 05-19-2007
    • Switzerland
    • Data Illusion

    Re: Setting language in Principal.GetLoginInterface for a validated user

    Hi,

    the security context is setup after FS has initalized its multi-language context as such the only way you might be able to setup dynamically the language (provided you have setup the multilanguage to get its value from a session variable) would be through the oninit event of the page hosting the surveybox control

  • 06-22-2010 9:12 In reply to

    Re: Setting language in Principal.GetLoginInterface for a validated user

    Hi,

    Thank you for your feedback. Is there any other workaround you can think of to set the language? We really want to set the language for our users depending of their preference. Perhaps we can set the default system language or something like that?

    What do you mean by setting up the multilanguage to get its value from a session variable? Isn't setting the FS_SessionLanguage variable enough?

     Greetings, Mathieu

  • 06-22-2010 13:49 In reply to

    • Tom
    • Top 10 Contributor
    • Joined on 05-19-2007
    • Switzerland
    • Data Illusion

    Re: Setting language in Principal.GetLoginInterface for a validated user

    Hi,

    unfortunately outside the oninit even on the page that you can try or by having a user interface where you set the language on the onclick event of a button I dont see any other work around since the multi language are set before the security addin checks.

    I meant that when you activate the multi language feature you have to set the mutli language mode to get from session variable and enter the name of the session variable from which you want to take the language code. 

  • 06-23-2010 1:59 In reply to

    • Tom
    • Top 10 Contributor
    • Joined on 05-19-2007
    • Switzerland
    • Data Illusion

    Re: Setting language in Principal.GetLoginInterface for a validated user

    Hi,

    I just realised that you wanted to use a user provider and not a security addin. If you want to use a user provider you have to set up the current culture of thread in the CreatePrincipal method eg:

    Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(yourculture);
    Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(yourculture);

    HttpContext.Current.Items.Add("FS_SessionLanguage",yourculture);
    HttpContext.Current.Items.Add("FS_LanguagDirection",yourculturedirectionLTRorRTL);
     

Page 1 of 1 (5 items)
(c) 2008 Data Illusion. All Rights Reserved.