Login / Logout without using javascript - possible ?
I have followed the video tutorial, and have finally made login / logout work.
However I would like to make login/ logout work without using Javascript (meaning that the form button has a GET / POST URL, instead of javascript:_dopostback href). So far I have not been able to identify any sources about how to do.
I am a newbie at ASP, but do know PHP and some XSLT, so not completely newbie. Did not create VisualStudio projects before, but honestly think it should be possible without, no ? So, can someone post or point to a complete example of a login / logout function in Umbraco using only plain HTML and get/post URLs ? I know too little to get from API documentation to developing a complete login macro myself.
You could just use a normal HTML Form without the runat="server" attribute and set the 'method' and 'action' to a page you've created to do some login stuff...
Well, this is just basic HTML / ASP.NET and has nothing to do with Umbraco, except for checking the user (which is documented all over our.umbraco.org) ;-)
thank you for the reply. Would it be possible for you to give me some links to get started ?
I am quite new to Umbraco and ASP.NET, and all the documentation I can find about authentification deals with server-based login and postback. I can't find anything about checking users based on [@uid] querystring variable. There is a link around to a site at ruben.3click.be, but site is gone.
some code examples (macros / XSLT /..) would be awesome also.
Matt, I read the instructions. I understand the basic concept of logging in/out. The only thing I do not get is WHERE (or how) to use the code. Some examples would be excellent in the Umbraco documentation.
Elsewhere, I have found the book on how to extend XSLT using CS. Does this mean I will put the CS code you linked to in an XSLT template within <msxsl:script language="CSharp" implements-prefix="mycustomprefix"> [code here to parse queryparams </msxsl>. If yes, do I also put the "using umbraco.cms.businesslogic.member;" within that code ?
Once I know where to put the CS code from the API to use, I should be up running.
For a login control, I'd probably just use a standard .NET user control (Macros can be either XSLT files or .NET user controls), so just define a series of inputs and a button, then in the Page_Load event check the values and log the user in / out accordingly. If you just use standard HTML input controls, and use Request.Form["fieldName"], it won't use postbacks (and therfore wont use javascript) so should work as you need it.
just wanted to add that you need a <form runat="server"> element on your templates for the Edit on canvas to work, so that pretty much means you can have only either of Edit in canvas or non-JS login (might be some tricky way around that though, haven't found one so far).
For the logout you could just add a link "/?logout=true" to your page, then add a control to the top master template which logs the current user out whenever a query item 'logout' with content 'true' is found.
Login / Logout without using javascript - possible ?
I have followed the video tutorial, and have finally made login / logout work.
However I would like to make login/ logout work without using Javascript (meaning that the form button has a GET / POST URL, instead of javascript:_dopostback href). So far I have not been able to identify any sources about how to do.
I am a newbie at ASP, but do know PHP and some XSLT, so not completely newbie. Did not create VisualStudio projects before, but honestly think it should be possible without, no ? So, can someone post or point to a complete example of a login / logout function in Umbraco using only plain HTML and get/post URLs ? I know too little to get from API documentation to developing a complete login macro myself.
Thanks for any help
You could just use a normal HTML Form without the runat="server" attribute and set the 'method' and 'action' to a page you've created to do some login stuff...
OK, the HTML form should be simple to create.
But can you point me to some place that demonstrates handling of GET and POST variables ?
I guess the following procedure should work:
* read GET or POST from form
* check in appropriate database for user/pass
* if acceptable, programatically login user, and redirect
Well, this is just basic HTML / ASP.NET and has nothing to do with Umbraco, except for checking the user (which is documented all over our.umbraco.org) ;-)
Kipusoep,
thank you for the reply. Would it be possible for you to give me some links to get started ?
I am quite new to Umbraco and ASP.NET, and all the documentation I can find about authentification deals with server-based login and postback. I can't find anything about checking users based on [@uid] querystring variable. There is a link around to a site at ruben.3click.be, but site is gone.
some code examples (macros / XSLT /..) would be awesome also.
- torben
Hi Torben,
I'd take a look at the working with members wiki page, specificaly the logging memebers in and out bit at the bottom:
http://umbraco.org/documentation/books/api-cheatsheet/working-with-members
For the basic .NET stuff, I would probably just go through ASP.NETs getting started section:
http://www.asp.net/get-started
Give it a try, and come back with any questions.
Matt
Matt, I read the instructions. I understand the basic concept of logging in/out. The only thing I do not get is WHERE (or how) to use the code. Some examples would be excellent in the Umbraco documentation.
Elsewhere, I have found the book on how to extend XSLT using CS. Does this mean I will put the CS code you linked to in an XSLT template within <msxsl:script language="CSharp" implements-prefix="mycustomprefix"> [code here to parse queryparams </msxsl>. If yes, do I also put the "using umbraco.cms.businesslogic.member;" within that code ?
Once I know where to put the CS code from the API to use, I should be up running.
Hi Torben,
For a login control, I'd probably just use a standard .NET user control (Macros can be either XSLT files or .NET user controls), so just define a series of inputs and a button, then in the Page_Load event check the values and log the user in / out accordingly. If you just use standard HTML input controls, and use Request.Form["fieldName"], it won't use postbacks (and therfore wont use javascript) so should work as you need it.
Cheers
Matt
Hi Torben,
just wanted to add that you need a <form runat="server"> element on your templates for the Edit on canvas to work, so that pretty much means you can have only either of Edit in canvas or non-JS login (might be some tricky way around that though, haven't found one so far).
For the logout you could just add a link "/?logout=true" to your page, then add a control to the top master template which logs the current user out whenever a query item 'logout' with content 'true' is found.
Sascha
is working on a reply...