Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Torben Jensen 13 posts 35 karma points
    May 12, 2010 @ 14:55
    Torben Jensen
    0

    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

     

  • Stefan Kip 1614 posts 4131 karma points c-trib
    May 12, 2010 @ 15:26
    Stefan Kip
    0

    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...

  • Torben Jensen 13 posts 35 karma points
    May 13, 2010 @ 14:59
    Torben Jensen
    0

    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

     

  • Stefan Kip 1614 posts 4131 karma points c-trib
    May 18, 2010 @ 21:02
    Stefan Kip
    1

    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) ;-)

  • Torben Jensen 13 posts 35 karma points
    Jul 13, 2010 @ 08:51
    Torben Jensen
    0

    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

     

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jul 13, 2010 @ 10:17
    Matt Brailsford
    0

    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

  • Torben Jensen 13 posts 35 karma points
    Jul 13, 2010 @ 12:06
    Torben Jensen
    0

    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.

     

     

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jul 13, 2010 @ 12:13
    Matt Brailsford
    0

    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

  • Sascha Wolter 615 posts 1101 karma points
    Jul 13, 2010 @ 16:42
    Sascha Wolter
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft