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...DNN Platform (o...DNN Platform (o...PasswordsPasswords
Previous
 
Next
New Post
5/24/2010 1:40 PM
 
I hope that this is the proper place to post this.  I have a need to create a new users on a none DNN site programatically from DNN.  The customer requirement is that I use the same password as the DNN site.  Hence the reason I am posting my question.  I have spent the better part of 3 hours looking for this answer so I will post it here and hopefully someone can point me to the right direction.

Since I need to get the existing users password i need to verify that indeed it can be retrived in a decrypted format.
Secondly I could use a bit of a push to where I can find either some samples or a discussion of what I need to be doing inorder to get this data.
I can get the username and the portal ID I just seem to be missing the password piece.

Any help would be very much appreciated thanks.


Russ

Russ

 
New Post
5/25/2010 8:48 AM
 
OK I am either posting in the wrong place or maybe I just stumped a few people.  In the meantime I have come up with this.

UserInfo ui = new UserInfo();
  
int myPID = PortalSettings.Current.PortalId;
ui.Profile.InitialiseProfile(myPID);
  
ui.Membership.Password= UserController.GetPassword(ui, "");
However the last line seems to be wrong according to everything I can find I should be passing the UserInfo object in this case ui and since the passwords are encrypted an empty string.  However I am getting the error that I have some invalid arguments.

Any ideas? please

Russ

 
New Post
5/25/2010 9:54 AM
 
Getting passwords is a tricky business.  Here's some code that's worked for me:

var user = Membership.GetUser(userName);
user.GetPassword();

Hope that helps,

Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
5/25/2010 10:33 AM
 
Thanks for the suggestion. I am not sure however which namespace holds the Membership.  I know there is one in the System.Web.Security is the another one in DNN that overloads this? 
UserControl myUser = new UserControl();
UserInfo ui = new UserInfo();
ui = UserController.GetCurrentUserInfo();
int myPID = PortalSettings.Current.PortalId;
var user = Membership.GetUser(ui.Username);
string pw = user.GetPassword().ToString();
Using the above code I get a Object reference not set to an instance of an object. for string pw = user.GetPassword().ToString();

Again thanks for the help.

Russ

 
New Post
5/25/2010 11:07 AM
 
Update:  I now have it working, for anyone interested here is the code I used.
UserInfo ui = UserController.GetCurrentUserInfo();
int myPID = PortalSettings.Current.PortalId;
  
MembershipUser user = Membership.GetUser(ui.Username);
string pwd = user.GetPassword();

Hope this helps someone in the future.

Russ

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...PasswordsPasswords


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