How To programmically add/edit a user f


Author
Message
Jeff Pagley
Jeff Pagley
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi SF,

I have a need to add/edit users to RBS SFSUsers table without using the SF RBS interface.  How do I do this?

Thanks,

Jeff
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (2.7K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Use the RBS BOs. They are under the Security.BusinessObjects namespace.
Jeff Pagley
Jeff Pagley
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi Greg,

The following code is failing to add a new user.  What am I missing?



MicroFour.StrataFrame.Security.BusinessObjects.
SFSUsersBO users = new MicroFour.StrataFrame.Security.BusinessObjects.SFSUsersBO();

users.Add();

users.us_FirstName =
"New";

users.us_LastName =
"User";

users.us_PasswordNeverExpires =
true;

users.us_Username =
"NewUser";

users.us_Data =
"nu"; //password

if (users.Save() != MicroFour.StrataFrame.Data.SaveUndoResult.Success)

{

MessageBox.Show("Add user failed.");

return;

}


Greg McGuffey
Greg McGuffey
Strategic Support Team Member (2.7K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Jeff,

Very close. Set the us_PassWordPlaintext property instead of the us_data property. The data property is loaded with a bunch of other properties that are encrypted and stored as a single field in the database. The plain text password never leaves the machine. It is encrypted and placed in the data field and the data field is sent over the wire and saved.
Jeff Pagley
Jeff Pagley
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
It failed again.  So I debugged the SF assembly and found out I needed to set the us_ConfirmPassword property as well.  It works fine now.

Thanks, Jeff
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (2.7K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Excellent! Sorry I missed that, but I'm glad you getting competent at using source to figure out things like this.  It can seem a bit daunting at first, but it's really nice to be able to figure this sort of stuff out quickly yourself!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search