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...Building ExtensionsBuilding ExtensionsOther Extension...Other Extension...AddUserAuthentication for supper user AddUserAuthentication for supper user
Previous
 
Next
New Post
7/30/2015 1:02 PM
 

HI there, 

I am trying to make a custom login for my skin. I coped the DNN\DesktopModules\Admin\Authentication\Login.ascx and put the code behind in a separated dll so I can debug that easily and edited it. I manage to make it work for normal users but  when a supper user (host) ties to log in I get an error at :

AuthenticationController.AddUserAuthentication(objUser.UserID, AuthenticationType, UserToken);

error :

An exception of type 'System.Data.SqlClient.SqlException' occurred in PetaPoco.dll but was not handled in user code

Additional information: Cannot insert duplicate key row in object 'dbo.UserAuthentication' with unique index 'IX_UserAuthentication'. The duplicate key value is (1, ).

I understand that for some reason this is not the way to handle supper user but how should I handle that then ?

Here is my code :

 protected void CostomLogin_Click(object sender, EventArgs e)

        {

             UserLoginStatus loginStatus = UserLoginStatus.LOGIN_FAILURE;
            UserInfo objUser = UserController.ValidateUser(PortalId,

                                                           tbEmail.Text,

                                                           tbPassword.Text,

                                                           "DNN",

                                                           "",

                                                           PortalSettings.PortalName,

                                                           AuthenticationLoginBase.GetIPAddress(),

                                                           ref loginStatus);

if (loginStatus == UserLoginStatus.LOGIN_SUCCESS || loginStatus == UserLoginStatus.LOGIN_SUPERUSER)
           {

                AuthenticationController.AddUserAuthentication(objUser.UserID, AuthenticationType, UserToken);

                if (objUser != null)

                {

                    UpdateProfile(objUser, true);

}

ValidateUser(objUser, true);

        }  

 

 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsOther Extension...Other Extension...AddUserAuthentication for supper user AddUserAuthentication for supper user


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