import users

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/26/2008 4:29:45 PM
Gravatar
Total Posts 33

import users

Hi Joe,

I have configured mojo to use LDAP login, I know that when a user signs in, it will automatically creates the account in mojo.

Is there a way to import all the users in our database into mojo?

Cheers

James

8/27/2008 6:27:39 AM
Gravatar
Total Posts 18444

Re: import users

Hi James,

No there is not currently any feature for importing users. You could potentially write one.

Best,

Joe

8/27/2008 1:25:59 PM
Gravatar
Total Posts 19

Re: import users

I've created a page to import users from a .csv file.  It works well if anyone needs this functionality.

It basically parses a .csv file into a datatable, displays the records in a gidview by binding to the datatable, and then creates the users from each row in the datatable.  After creating each user,  the datatable is updated with results and errors and the grid is rebound to show the results.

If the user exists, the user is updated with the data in the file.

8/27/2008 3:43:28 PM
Gravatar
Total Posts 33

Re: import users

Hi Joe and Scott,

Mojo does automatically creates the record if it is hooked up to LDAP, perhaps you could tell me which page, which function is doing that? so I can hijack that and pump the data in?

Scott, I have the users in oracle table, so I need to push the users into mojo.

 

Cheers

James

8/27/2008 4:36:41 PM
Gravatar
Total Posts 33

Re: import users

Hi Joe,

I am able to add  the user into the database programmatically

SiteUser user = new SiteUser(siteSettings);
user.LoginName = "jw1234";
user.Name = "Julie Woods";
user.SetProperty("StaffNumber", "1234", SettingsSerializeAs.String);
user.Save();

however, I am not able to save the custom property "StaffNumber" when creating the new user, given the fact that I have added the entry in mojoProfile.config and ProfileResource.resx.

Have I used the incorrect method?

Cheers

James

8/27/2008 4:40:29 PM
Gravatar
Total Posts 18444

Re: import users

call user.Save() before setting your custom property, then set your property. You may need to call.Save again or maybe not, test it to see for sure.

Hope it helps,

Joe

8/27/2008 4:45:52 PM
Gravatar
Total Posts 33

Re: import users

Hi Joe,

thanks very much, it worked.

for those who had similar problem, here is the code to add the new user and set the properties

SiteUser user = new SiteUser(siteSettings);
user.LoginName = "jw1234";
user.Name = "Julie Woods";
user.Save();
user.SetProperty("StaffNumber", "1234", SettingsSerializeAs.String);

Cheers

James

 

8/28/2008 6:26:14 AM
Gravatar
Total Posts 18444

Re: import users

I think the second call to save may not be needed and if not its better not to call it. Custom properties are stored in a different table and I think the call to SetProperty does persist it. But a userid is needed and that why you must first save the user (this creates the user id), then you can set the property.

So I would comment out that second call to save and if it works then leave it out.

Best,

Joe

8/28/2008 3:40:54 PM
Gravatar
Total Posts 33

Re: import users

Thanks Joe, I have corrected my last post.

1/20/2010 8:07:56 PM
Gravatar
Total Posts 29

Re: import users

Joie

When I populate the table mp_users from the database of DNN,

The users online stop of working, I tryed to populate the mp_userroles table, but didnt solve the problem

Is there anything missing:?

BW

Evencio

1/21/2010 12:54:53 PM
Gravatar
Total Posts 29

Re: import users

I found a stored procedure to insert a user,

So I saw the basic fields that was missing.

Best Wishes

Evencio

You must sign in to post in the forums. This thread is closed to new posts.