Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedHow to do custom Login control?How to do custom Login control?
Previous
 
Next
New Post
4/10/2012 11:03 AM
 

I need to create a simple module for user login, because the design requires a custom appearenace that the dnn login module can't do.

I set a textbox for username and another for password and a button, but I need to know how to perform the login as dnn would do, so the user gets properly logged in or show a message for wrong username / password.

Any help would be appreciated.

Thanks in advance.

 
New Post
4/10/2012 12:48 PM
 
you would need to write the codebehind to support that. There are a number of login modules (some free) that give you more flexibility over the look and feel. Also, if you search google for 'DNN cutom login code' you'll find a bunch.

This post should get you started on the code you'll need

http://www.mindfiresolutions.com/How-to-create-custom-Login--Registration-module-in-Dotnetnuke-1101.php


Steven Webster
Manager, Community Platform
F5 Networks, DevCentral
 
New Post
4/11/2012 3:18 AM
 

Thanks. I managed to do it with some modifications to the code from the URL you posted.

In case someone needs it here it is ( the code is not complete, I still need to add a message when the login or password is wrong, etc.. ) :

 protected void lnkLogin_Click(object sender, EventArgs e)
        {
            string AuthType = "DNN";

            DotNetNuke.Security.Membership.UserLoginStatus status = new DotNetNuke.Security.Membership.UserLoginStatus();
            DotNetNuke.Entities.Users.UserInfo userInfo = DotNetNuke.Entities.Users.UserController.ValidateUser(PortalId, txtUsername.Text, txtPassword.Text, AuthType, "", PortalSettings.PortalName, DotNetNuke.Services.Authentication.AuthenticationLoginBase.GetIPAddress(), ref status);

            switch (status)
            {
                case DotNetNuke.Security.Membership.UserLoginStatus.LOGIN_SUCCESS:
                    UserInfo.Membership.Password = txtPassword.Text;
                    UserInfo.Username = txtUsername.Text;

                    DotNetNuke.Entities.Users.UserController.UserLogin(PortalId, UserInfo, PortalSettings.PortalName, DotNetNuke.Services.Authentication.AuthenticationLoginBase.GetIPAddress(), true);

                    Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true);
                    break;
                case DotNetNuke.Security.Membership.UserLoginStatus.LOGIN_SUPERUSER:
                    UserInfo.Membership.Password = txtPassword.Text;
                    UserInfo.Username = txtUsername.Text;

                    DotNetNuke.Entities.Users.UserController.UserLogin(PortalId, UserInfo, PortalSettings.PortalName, DotNetNuke.Services.Authentication.AuthenticationLoginBase.GetIPAddress(), true);

                    Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true);
                    break;
                default:
                    break;
            }
        }

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedHow to do custom Login control?How to do custom Login control?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out