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/3/2007 11:02 PM
 
can I force a log in depending on the information I passed? example, user clicks link to myportal in a main portal, main portal throws info, i get its username and let dotnetnuke know that its him/her? because we dont require people to log in. we will add their credentials ourselves, and when they enter the portal, dotnetnuke knows them already. thanks!
 
New Post
4/4/2007 11:28 AM
 
I am not sure if a module exists for this or not, but you could easily create a module that expects querystring values and then logs the user in using the information passed..

-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
4/10/2007 5:10 AM
 

Yes I can do that, get values passed by some other page. I can even just use the request.form of asp.net. but how can i pass it to dotnetnuke and log that username (preferably without a password) automatically? Thanks

 
New Post
4/10/2007 12:35 PM
 

Pardon the mess of the posted code... but it should serve as an example:

protected void Page_Load(System.Object sender, System.EventArgs e)
  {

   if (Request.UserHostAddress != null)
    _ipAddress = Request.UserHostAddress;

   try
   {
    if (!Page.IsPostBack)
    {
     if (Session["AutoLogonProcess"] != null)
      return;
     else
      Session["AutoLogonProcess"] = true;

     string fullUser = Request.ServerVariables["LOGON_USER"];
     string userName = fullUser.ToLower().Replace(@"macu_nt\", "");
     // see if user is already logged in...
     if (this.UserInfo.UserID > 0)//this.User != null && this.User.UserID > 0)
     {
     }
     else
     {
      // otherwise, log them in
      UserInfo objUser = UserController.GetUserByName(this.PortalId, userName);

      if (objUser != null && objUser.Membership.Approved && !objUser.Membership.LockedOut)
      {
       UserAuthorized(objUser, false);
      }
     }
    }
   }
   catch (Exception exc) //Module failed to load
   {
    Exceptions.ProcessModuleLoadException(this, exc);
   }
  }

  private void UserAuthorized(UserInfo objUser, bool canProceed)
  {
   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);
   }


   // check whether profile needs updating
   if (!updatePassword && this.RequireValidProfile)
   {
   }

   if (updatePassword)
   {
   }
   else if (updateProfile)
   {
   }
   else
   {
    // complete login
    UserController.UserLogin(PortalId, objUser, PortalSettings.PortalName, _ipAddress, false);
    try
    {
     int seconds = 0;
     string url = string.Empty;
     string port = Request.Url.IsDefaultPort ? string.Empty : ":" + Request.Url.Port.ToString();

     if (_hasRedirectUrl)
     {
      if (RedirectURL.IndexOf("http") == -1)
       url = "http://" + Request.Url.Host + port + RedirectURL;
      else
       url = RedirectURL;

     }
     else
     {
      url = "http://" + Request.Url.Host + port + Request.Url.Segments[0] + Request.Url.Segments[1];
     }

     Response.AppendHeader("Refresh", seconds.ToString() + "; URL=" + url); // give them a second or so to see the message, then redirect
    }
    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/10/2007 9:15 PM
 

sir, thank you very much for this, though I don't understand much of it, I will learn it and I hope it does what I really need. thanks again sir for helping a newbie!

 
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