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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...FORCED LOGINFORCED LOGIN
Previous
 
Next
New Post
4/11/2007 3:08 AM
 

sir there are a lot of missing codes or atleast please expound on the parts on how it works sir. It also won't work if I put this in default.aspx page since it always says that it has declared a different laguage (vb) so I can't use C sharp.

anything also that goes with "this." wherein I have to do this in my default.aspx.vb code, please elaborate. Thanks for sharing your ideas sir...

by the way, I installed your autologon. I've set my website to integrated security on (in my IIS). but it still doesnt work or rather, I don't know how it should work. when I log in to windows would it pop the site and log the person in, or when you go to the site, it knows what username and password you used in windows so it would take you in?

anyway, I need to pass parameters from an existing portal to my portal. so from those parameters I should be able to "automatically log in a user." thank you very much sir for your consideration.

 
New Post
4/11/2007 9:34 AM
 

 I apologize, I misunderstood your experience with DNN and made a baseless assumption.
 DotNetNuke is very versatile in the fact that it is based on modules for expansion.  The default.aspx page is what drives the whole site, essentially, but it uses "virtual" urls to load up pages (otherwise known as tabs) from the database. Each tab is comprised of zero or more modules which are essentially glorified user controls (.ascx files).

 What my autologon module does, in essence, is captures a windows login (in my case, an active directory login) that gets passed along with Internet Exploder.nbsp; FireFox doesn't send it automatically, but if you turn off anonymous access and enable integrated security in IIS, it will prompt FireFox for credentials which it will then pass along.nbsp; My module is actually very specific and quot;specializedquot; for my needs at work, but I put it online more for an example that anything else.
 To better understand the module concept (and development cycle), I suggest going to Michael Washington's site http://dotnetnuke.adefwebserver.com/DotNetNuke/tabid/195/Default.aspx -OR- look for his tutorial which is somewhere here on the main DNN site.

 In regards to what you are looking for an how my example code would work, let me filter it down just a tad.
 You'd start off by creating a module (follow Michael's tutorial).nbsp; In the base ascx file (the View____.ascx), add some code similar to what follows:

 protected void Page_Load(System.Object sender, System.EventArgs e)
 {
  // get username from passed querystring value
  string someUserName = Request.QueryString["queryValue1"] != null ? Request.QueryString["queryValue1"] : string.empty;
  // get some other value
  string someOtherQueryValue = Request.QueryString["queryValue2"] != null ? Request.QueryString["queryValue2"] : string.empty;
  // check to make sure person isn't already logged in
  if (this.UserId > 0)
  {
   // perform some code maybe?  maybe just ignore it altogether
  }
  else
  {
   // perform some login code here
   UserInfo objUser = UserController.GetUserByName(this.PortalId, someUserName);
   // if we have a user now, and they meet login criteria, lets log them in
   if (objUser != null && objUser.Membership.Approved && !objUser.Membership.LockedOut)
   {
    UserAuthorized(objUser);
   }

  }
 }

 private void UserAuthorized(UserInfo objUser)
 {
  string strMessage = string.Empty;
  bool updatePassword = false;
  bool updateProfile = false;

  UserId = objUser.UserID;
  if ((!(objUser.Profile == null)) && (!(objUser.Profile.PreferredLocale == null)))
  {
   Localization.SetLanguage(objUser.Profile.PreferredLocale);
  }
  else
  {
   Localization.SetLanguage(PortalSettings.DefaultLanguage);
  }

  // complete login
  UserController.UserLogin(PortalId, objUser, PortalSettings.PortalName, _ipAddress, false);
  try
  {
   Response.Redirect("Default.aspx");
  }
  catch (Exception ex)
  {
   AddModuleMessage(ex.ToString(), DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.RedError, true);
  }
 }


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
New Post
4/12/2007 9:51 PM
 

sir! this is really helpful and I can grasp it more clearly now! one little thing you missed out sir... using this.portalId etc etc. it gave me an impression, that I have to import something in my default.aspx.vb. so what should I import? I thought, dotnetnuke.provider.aspnetmembershipprovider or something like that sir? in a simple language, where do I get the protalId? in my past experience, error would be - portalid is not part of the ASP page default.aspx or something similar...

with this I guess I can get going sir with my venture. thank you very much for sharing your knowledge sir, its greatly appreciated!

John

 
New Post
4/16/2007 5:56 AM
 

sir, I am greatful for your help! I have customized your code to suite my requirements! there is this one problem though: I can't log them out properly. "A critical error has occured. Object reference not set to an instance of an object" so because of this error, I suspect, that if an unknown user tries to enter, it logs as the previous person........

 

John

 
New Post
4/16/2007 7:12 AM
 

sir, it also doesnt get in the userAuthorized part.... because I keep on putting response.writes in sections of the method userAuthorized... it only enters he if statement --> if (me.userid >0) and it works properly. but then as i have said, there is a critical error when i log out. if i dont logout, and just close the window, and then go to the main portal and log in as a different user and click to my portal, it passes the info of the new user, but the one logged in is the previous user... thanks sir for your help on this!

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...FORCED LOGINFORCED LOGIN


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