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 ...Forcing Users to Update Their ProfileForcing Users to Update Their Profile
Previous
 
Next
New Post
8/17/2006 12:22 PM
 
Hi, I'm adding users programmatically from a CSV file using the UserController. 

This is all working fine, but the users don't have a password or an email address.  I am giving each user a default password based on their username, and giving them a blank email.  The users get added fine.

However, I now want to force the user to update their password and email address when they first log in to something valid (a bit like the dotnetnuke site does).  Is this possible out of the box?

If not, any hints on developing my own module?  I know how to check the details of the current user, but I would need to direct them to the update profile page or write my own profile page.

Any clues?

TIA
 
New Post
8/17/2006 3:23 PM
 
i think a custom signin page makes more sense.

 
New Post
8/17/2006 4:49 PM
 
I thought so, I'll give that a go, cheers.
 
New Post
8/17/2006 5:38 PM
 

I see in 4.3.4 there is a "force password change" link in the user edit screen.  That must be saved in the database somewhere.

I am not sure about forcing them to update their profile.

 
New Post
8/18/2006 10:51 AM
 
jedgett wrote

I see in 4.3.4 there is a "force password change" link in the user edit screen.  That must be saved in the database somewhere.

I am not sure about forcing them to update their profile.



Exellent, I hadn't noticed that option.  All you have to do to foce a password update is set the Membership.UpdatePassword flag to true.  I won't worry about forcing an email update for now.  Hopefully the core team will add an UpdateProfile flag soon.

Here is the code I use to add a user if anyone is interested:

void AddUser(string firstname, string lastname, string username, string password)
{

UserCreateStatus userCreateStatus = UserCreateStatus.AddUser;

UserInfo objNewUser = new UserInfo();
                       
objNewUser.PortalID = PortalId;
objNewUser.Email = "";
objNewUser.IsSuperUser = false;
objNewUser.FirstName = userInfo.FirstName;
objNewUser.LastName = userInfo.LastName;
objNewUser.Username = userInfo.UserName;
userInfo.Password = MyPasswordGeneratingMethod();
objNewUser.Membership.Password = userInfo.Password;
objNewUser.Membership.Approved = true;                

// force the user to change their password on first login
objNewUser.Membership.UpdatePassword = true;       

userCreateStatus = UserController.CreateUser(ref objNewUser);
        
if (userCreateStatus == UserCreateStatus.Success)
{
UserInfo objUserInfo = UserController.GetUserByName(PortalId, userInfo.UserName, false);
objUserInfo.Profile.SetProfileProperty("FirstName", userInfo.FirstName);
objUserInfo.Profile.SetProfileProperty("LastName", userInfo.LastName);
... set other custom profile properties
}
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Forcing Users to Update Their ProfileForcing Users to Update Their Profile


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