Copied to clipboard

Flag this post as spam?

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


  • Shannon 148 posts 171 karma points
    Mar 05, 2011 @ 04:33
    Shannon
    0

    Converting a login page to use Umbraco from Community Server

    I have a page that basicly accepts the username/passwoord in a query string and returns the userid.

    http://www.pastie.org/private/6dkfb9k7rl2oxwzoawwdkw

    using System;
    using CommunityServer;
    using CommunityServer.Components;

    namespace CommunityServerWeb.speedtrap
    {
    public partial class login : System.Web.UI.Page
    {
    protected void Page_Load(object sender, EventArgs e)
    {
    if (Request.QueryString["un"] != null && Request.QueryString["pw"] != null)
    {
    string username = Request.QueryString["un"];
    string password = Request.QueryString["pw"];

    User userToLogin = new User();

    userToLogin.Username = username;
    userToLogin.Password = password;

    LoginUserStatus loginStatus = Users.ValidUser(userToLogin);
    if (loginStatus == LoginUserStatus.Success)
    {
    Response.Write( CSContext.Current.User.UserID);
    }
    else
    {
    Response.Write(loginStatus.ToString());
    }
    }
    }
    }
    }

    Anyone have any suggestions on how to convert it to use the Umbraco API and return the Userid?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Mar 07, 2011 @ 17:53
    Jan Skovgaard
    0

    Hi Shannon

    I guess you should be able to use any membership provider you fancy...but must admit I don't know how to use the above in an Umbraco context - But since Umbraco is using the ASP.NET membership provider this should perhaps be easy to achieve?

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft