I have installed the member controls in my Umbraco V4 website and I have pages stuctured as follows:
Client login page (this page has a login box) - Client 1 page - Client 2 page
I then have members called Client 1 and Client 2. Basically I want to know if it is possible that when Client 1 logs in on the Client login page they are taken to Client 1 page and when Client 2 logs in they are taken to Client 2 page. Is this something that can be done fairly simply?
I haven't used the member controls as I tend to use the plain asp.net login controls, which do have an event that's fired after successful login. If you'd use this technique, you could easily redirect the logged in member to its client page. you'll also need to establish a link between a member and its client page (most probably the node id of the page)
Just using the ones that I downloaded from the package repository in Umbraco developer section. So how do I use the asp.net ones and create a link between the member and the page? Would this link be something I would have to setup each time for a new client? I was hoping that the end user could just create a new client page and member login in Umbraco without having to do anything too difficult to associate them with each other.
Would it be better or maybe easier to have some sort of XSLT list on the login page that lists the child nodes of that page but only shows the ones that logged in member has access to? So when Client 1 logs in they would see something like this:
Click here to view Client 1 page (this would be a link to their page)
Rather than outputing a link, you could loop through the child pages.. find the first one that the user has access to and 301/302 redirect to this page.
Thanks Chris, that is exactly what I need although I still don't quite understand how I get the redirect to work, I have read the thread you posted above but I'm not too sure how I incorporate that into my XSLT to redirect instead of listing the pages. I know that I have to put something in between the xsl:if statements but not sure exactly what.
Below is an example using the .NET login controls:
<script runat="server"> protected void Login1_LoggedIn(object sender, EventArgs e) { // the context is not set yet?, so must lookup the user based on login username string name = umbraco.cms.businesslogic.member.Member.GetMemberFromLoginName(((Login)sender).UserName).Text if (name=="client") { Response.Redirect(umbraco.library.NiceUrl(1897), true); } } </script> <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
Thanks Casey, although I am still unsure how I make the method you have described work with the member controls I am using, I have tried the following code but this does not work:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets "> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="currentPage"/> <xsl:template match="/"> <xsl:for-each select="$currentPage/child::node [string(data [@alias='umbracoNaviHide']) != '1']"> <xsl:if test="umbraco.library:HasAccess(@id, @path) = true()"> <script runat="server"> Private Sub Page_Load(sender As Object, e As EventArgs) ' Check whether the browser remains ' connected to the server. If (Response.IsClientConnected) Then ' If still connected, redirect ' to another page.
Response.Redirect("umbraco.library:NiceUrl(@id)", false) Else ' If the browser is not connected ' stop all response processing. Response.End() End If End Sub </script>
Thanks for your response, I tried using the XSLT you suggested but I received the following error when trying to save the file, I assume I am missing a line that declares the namespace?
System.Xml.XmlException: 'msxsl' is an undeclared namespace. Line 11, position 4.
Member opens specific page when loggin in
Hi,
I have installed the member controls in my Umbraco V4 website and I have pages stuctured as follows:
Client login page (this page has a login box)
- Client 1 page
- Client 2 page
I then have members called Client 1 and Client 2. Basically I want to know if it is possible that when Client 1 logs in on the Client login page they are taken to Client 1 page and when Client 2 logs in they are taken to Client 2 page. Is this something that can be done fairly simply?
I haven't used the member controls as I tend to use the plain asp.net login controls, which do have an event that's fired after successful login. If you'd use this technique, you could easily redirect the logged in member to its client page. you'll also need to establish a link between a member and its client page (most probably the node id of the page)
And which member controls package are you using?
Hope this helps.
Regards,
/Dirk
Hi Dirk,
Just using the ones that I downloaded from the package repository in Umbraco developer section. So how do I use the asp.net ones and create a link between the member and the page? Would this link be something I would have to setup each time for a new client? I was hoping that the end user could just create a new client page and member login in Umbraco without having to do anything too difficult to associate them with each other.
Would it be better or maybe easier to have some sort of XSLT list on the login page that lists the child nodes of that page but only shows the ones that logged in member has access to? So when Client 1 logs in they would see something like this:
Click here to view Client 1 page (this would be a link to their page)
Rather than outputing a link, you could loop through the child pages.. find the first one that the user has access to and 301/302 redirect to this page.
You could accomplish the 301 redirect as described at http://our.umbraco.org/forum/using/ui-questions/5255-301-redirect-options
Where could I find the XSLT code that I would need to loop through the child pages and find one that the user has access to?
Something like...
The above will list the pages that the user has access to. You could perform a redirect rather than outputting the <li>
Thanks Chris, that is exactly what I need although I still don't quite understand how I get the redirect to work, I have read the thread you posted above but I'm not too sure how I incorporate that into my XSLT to redirect instead of listing the pages. I know that I have to put something in between the xsl:if statements but not sure exactly what.
Below is an example using the .NET login controls:
Thanks Casey, although I am still unsure how I make the method you have described work with the member controls I am using, I have tried the following code but this does not work:
Try changing your xslt as follows
However at this point i'd probably just write a C# usercontrol that sits on the page and performs the check/redirect.
Hi Chris,
Thanks for your response, I tried using the XSLT you suggested but I received the following error when trying to save the file, I assume I am missing a line that declares the namespace?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.