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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationCustom Authentication Custom Authentication
Previous
 
Next
New Post
5/4/2010 11:47 PM
 
My friends:

I was trying to create authentication for my portal as the registration process has a business layer that i need to build however i get stuck at the "Declaration expected."
Please be patient with me as i am still a developer migrating from classic asp to .NET.

CODE: (I am using this from Michell Sellers site)

Using System.IO;
using DotNetNuke.Security.Permissions;
using DotNetNuke.UI.Skins;
using DotNetNuke.UI.Utilities;
using DotNetNuke.Application;
using DotNetNuke.Entities.Tabs;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Profile;
using DotNetNuke.Entities.Users;
using DotNetNuke.Entities.Host;

public partial class syncuser : System.Web.UI.Page
    

    //: System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        UserInfo oUser = new UserInfo();
        oUser.PortalID = this.PortalId;
        oUser.IsSuperUser = false;
        oUser.FirstName = "FirstName";
        oUser.LastName = "LastName";
        oUser.Email = "test@test.com";
        oUser.Username = "MyUsername";
        oUser.DisplayName = "FirstName LastName";

 //Fill MINIMUM Profile Items (KEY PIECE)
        oUser.Profile.PreferredLocale = PortalSettings.DefaultLanguage;
        oUser.Profile.TimeZone = PortalSettings.TimeZoneOffset;
        oUser.Profile.FirstName = oUser.FirstName;
        oUser.Profile.LastName = oUser.LastName;


ERROR:


Line 16: 'Dim oUser As DotNetNuke.Entities.Users.UserInfo = New UserInfo()
Line 17:
Line 18: oUser.PortalID = Me.PortalId
Line 19: oUser.IsSuperUser = False Line 20: oUser.FirstName = "FirstName"
 
New Post
5/5/2010 3:23 AM
 
Now i am getting this error:

CS1061: 'syncuser' does not contain a definition for 'PortalId' and no extension method 'PortalId' accepting a first argument of type 'syncuser' could be found (are you missing a using directive or an assembly reference?)
 
New Post
5/5/2010 4:43 AM
 
I defaulted the portalid to -1 which is not the right thing to do but just wanted to work around it. There is an additional problem of

CS1061: 'DotNetNuke.Entities.Portals.PortalAliasInfo' does not contain a definition for 'PortalId' and no extension method 'PortalId' accepting a first argument of type 'DotNetNuke.Entities.Portals.PortalAliasInfo' could be found (are you missing a using directive or an assembly reference?)

Because of .........

Line 47: int PID = -1; // Oportalsettings.PortalId();
Line 48:
Line 49: oUser.PortalID = Oportalsettings.PortalId; // PID; // oUserInfo.PortalID;
Line 50: oUser.IsSuperUser = false;
Line 51: oUser.FirstName = "Name1";
 
New Post
5/5/2010 11:08 PM
 
http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/111/postid/218939/scope/posts/Default.aspx did the magic for portal settings but not sure what to do with default language
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthenticationCustom Authentication Custom Authentication


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