Developer forum

Forum » Templates » Login/Logout boks

Login/Logout boks


Reply
I noticed you can select login boxes under various elements, but how do you insert them into the page?



Furthermore, how do you differ between showing the login form and the logout form? This element is to be displayed on all pages.



Thank you

Replies

 
Nicolai Høeg Pedersen
Reply
cpa@conceptivator.com wrote:

I noticed you can select login boxes under various elements, but how do you insert them into the page?







Furthermore, how do you differ between showing the login form and the logout form? This element is to be displayed on all pages.







Thank you



Hi


 


given you are talking about extranet module. you can choose the properties of a page, the tab security and add some extranet groups to the list. Then the selected login template/form will be displayed instead of the content: (http://manual.net.dynamicweb.dk/Default.aspx?ID=1497)


 


After login the content will be shown. Logout button/link can be done by making a normal page, add extranet groups to it so it will not be shown untill after login, and make a link to www.domain.com/admin/public/Extranet_logoff.aspx?ID=XX where xx is an ID of the page that should be shown after the logoff.

 
Reply
NP wrote:

cpa@conceptivator.com wrote:



I noticed you can select login boxes under various elements, but how do you insert them into the page?















Furthermore, how do you differ between showing the login form and the logout form? This element is to be displayed on all pages.















Thank you






Hi




 




given you are talking about extranet module. you can choose the properties of a page, the tab security and add some extranet groups to the list. Then the selected login template/form will be displayed instead of the content: (http://manual.net.dynamicweb.dk/Default.aspx?ID=1497)




 




After login the content will be shown. Logout button/link can be done by making a normal page, add extranet groups to it so it will not be shown untill after login, and make a link to www.domain.com/admin/public/Extranet_logoff.aspx?ID=XX where xx is an ID of the page that should be shown after the logoff.



Is it not possible in any way to detect whether a user is logged in or not? We really wanted a global login/out box on the page, but it wouldn't work if we had to display both at all times.

 
Nicolai Høeg Pedersen
Reply

In the page template you some extranet values (http://template.dynamicweb.dk/Default.aspx?ID=2132) that only holds values if the user is authenticated. Thats a way of doing it in the template.


 


When doing a custom module you can use Pageview.User object which holds the same information.

 
Reply

Hi,


 


What we figured out, was to create a javascript function that checks for the value of a tag with the extranet user ID or name (which is void is user is annonymous) and create an if function to write some more HTML when the user is logged on.


 


//nuno

 
Reply
It would be nice if we could control where on the page the login box is displayed
 
Nicolai Høeg Pedersen
Reply

Hi ML


 


If you use the login box selector from edit page, the login will be shown where the DwContent tag is in the pagetemplate. This is where the login will be shown if they try to access a page that is protected, and the user is not logged in with a username that gives access.


 


If needed, the content (the markup of the html file) of the extranetlogin template can just be added/hardcoded to any template - it will still work. In that way you can have a login box on the frontpage if that is what you need.

 

You must be logged in to post in the forum