Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I found the solution...</p> <p>I kept the web.config setting :</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms loginUrl="~/LogOn" timeout="2880" /&gt; &lt;/authentication&gt; </code></pre> <p><a href="http://myprettycms.codeplex.com/SourceControl/changeset/view/19221#457307" rel="nofollow">Web.Config in codeplex</a></p> <p>In the RouteConfig.cs</p> <pre><code>routes.MapRoute( name: "LogOn", url: "LogOn/{action}", defaults: new { controller = "LogOn", action = "SelectLanguage" } ); </code></pre> <p>And in the languages routes loop in RouteConfig.cs</p> <pre><code>foreach (var l in Languages) { ... routes.MapRoute( name: "LogOn" + l.Name.ToUpper(), url: l.Description + "/logon/{action}", defaults: new { controller = "LogOn", action = "Index", language = l.Description } ); ... } </code></pre> <p><a href="http://myprettycms.codeplex.com/SourceControl/changeset/view/19221#457313" rel="nofollow">The routeconfig.cs in codeplex</a></p> <p>In the controller base</p> <pre><code>public string URLReferLanguage { get { string toReturn = ConfigurationManager.AppSettings["DefaultLanguage"]; string language = string.Empty; string[] tLanguages = ConfigurationManager.AppSettings["Languages"].Split(','); string urlReferrer = HttpContext.Request.UrlReferrer.AbsolutePath; if (urlReferrer != null) { if (urlReferrer.Length &gt; 5) { language = urlReferrer.Substring(1, 5).ToLower(); if (tLanguages.Contains(language)) { toReturn = language; } } } return toReturn; } } </code></pre> <p><a href="http://myprettycms.codeplex.com/SourceControl/changeset/view/19221#457022" rel="nofollow">_Controller_Base in codeplex</a></p> <p>In the LogOn Controller in Security Layer</p> <pre><code>public ActionResult SelectLanguage() { return Redirect(string.Format("/{0}{1}", base.URLReferLanguage, Request.Url.PathAndQuery)); } /// &lt;summary&gt; /// URL: /en-us/LogOn /// &lt;/summary&gt; /// &lt;returns&gt;&lt;/returns&gt; public ActionResult Index() { string eMethod = eMethodBase + ".Index[GET]"; using (DataRepositories _dataContext = new DataRepositories()) { base.InitView( Resources.View_LogOn_PageTitle, string.Empty, specificCssCollection, specificJSCollection, dynamicJSCollection, specificJqueryJSCollection, jsVariables, externalCSS, Meta, _dataContext, false, base.RequestLanguage, false ); } string returnUrl = Request.QueryString["ReturnUrl"]; if (!string.IsNullOrEmpty(returnUrl)) { ContentData.ReturnUrl = returnUrl; } return View(ContentData); } </code></pre> <p><a href="http://myprettycms.codeplex.com/SourceControl/changeset/view/19221#457242" rel="nofollow">The LogOn controller in codeplex</a></p> <p>So, when a user is redirected to LoginForm by standard role and membership (my Provider inherit standard one), controller analyse UrlRefer and add language to address and redirect to it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload