Hi Hilmar,
unfortunately not. Even the "ultimate list" does not mention any solution how to retrieve session information:
But why don't you use the info elements?
Regards, Wolfgang--
You received this message because you are subscribed to a topic in the Google Groups "RedDot CMS Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reddot-cms-users/3MgZA6YcOPA/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to reddot-cms-use...@googlegroups.com.
To post to this group, send email to reddot-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/reddot-cms-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Wolfgang, Hilmar,
The “ultimate list” page – which is getting somewhat out of date now – has those values in the “Session” object (at the very bottom of the tables near the bottom of the page).
You might have some luck with:
<%!! Context:CurrentUserId !!%>
If memory serves the SessionKey and LogonGuid are really just the UserId Guid in recent versions (>= v9)
As far as I can see there is very little that exposes the Session object, though many types use it.
A custom render tag to expose these values would be trivial.
HTH
Richard H.
From: reddot-c...@googlegroups.com [mailto:reddot-c...@googlegroups.com] On Behalf Of Wolfgang Roiter
Sent: Wednesday, 27 February 2013 7:06 PM
To: reddot-c...@googlegroups.com
Subject: Re: Getting login information in Custom Render Tag
Hi Hilmar,
unfortunately not. Even the "ultimate list" does not mention any solution how to retrieve session information:
But why don't you use the info elements?
Regards, Wolfgang
--
You received this message because you are subscribed to the Google Groups "RedDot CMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reddot-cms-use...@googlegroups.com.
Hi Jian,
Sorry – did not know that it was undocumented. In honesty I didn’t even look at the documentation, nor did I try it so it may not work. Equally the below may or may not work – you’d have to try it.
Regards the “custom render tag” – I wasn’t suggesting to use the custom render tag to execute RQL. A PageBuildContext object is passed into the “OnGetObject” method of a custom Loader as a parameter. That PageBuildContext has a property “Session” (which annoyingly and for no good reason is marked “internal” so…) you can’t use it… officially. You can use reflection to get it though. Another way, is to use the static Session.GetSystemSession( Guid projectId, string languageId, string dialogLanguageId ). You can get the ProjectId and language from the PageBuildContext I mentioned before, something like this:
Session s = Session.GetSystemSession( context.ProjectId, context.Language.Key, context.Language.Key );
The Session object then has (at least) all these properties:
public IList AnalyzeData { get; }
public string AspDirectory { get; }
public DateTime ChangeTime { get; }
public DataLoadState DataLoadState { get; set; }
public string DialogLanguageId { get; }
public bool ForAspx { get; set; }
public bool IgnoreLinkingSchedule { get; set; }
internal static IniReader IniReader { get; }
public bool IsAnalyzeSession { get; }
public bool IsImporter { get; set; }
public bool IsPublishSession { get; set; }
public bool IsSystemSession { get; }
public bool IsTranslationMode { get; set; }
public bool IsValid { get; }
public bool IsWebCompliance { get; set; }
public string LanguageKey { get; }
public Guid LoginId { get; }
public DateTime LoginTime { get; }
public static XmlDocument MainConfig { get; }
public IDictionary Params { get; }
public int Preview { get; set; }
public string PreviewUrl { get; set; }
public Guid ProjectId { get; }
public DateTime PublishingTime { get; set; }
public string SessionKey { get; }
public string SourceLanguageID { get; set; }
public string TargetLanguageID { get; set; }
public string ThemePath { get; set; }
public bool UseCache { get; set; }
public bool UsePublishingTime { get; set; }
public Guid UserId { get; }
public static string VirtualPath { get; }
public bool WithTempSaved { get; set; }
Probably all of that is unofficial in hindsight – forget I mentioned it.
You can’t do it.