-API- Unable to save the fullname.

To the Ipswitch web site

Ipswitch Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



-API- Unable to save the fullname.Expand / Collapse
Author
Message
Posted 12/1/2008 2:41:39 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 12/1/2008 3:15:17 PM
Posts: 8, Visits: 17
Good day,

I'm trying to figure out why the fullname field is not saved on creation or update.

I tried:
- using the setFullName method (now in comment)
- Saving twice (setting the fullname in between both times)
- Saving, loading the user, change the name, then save again.
- Using the saveuser method with the Fullname parameter (in byte() ). This one crashes.

I looked at the .ASP code provided in the IAdmin folder, but ASP doesn't seem to use the same version of the code, since it uses methods and properties that are unavailable in the .Net version (ex: in asp, you would create a user with the following: "newUser = oDomain.CreateUser();", which doesn't exist on the .Net version).



Here's the code:

Public Sub AddUser( _
ByVal aDomain As String, _
ByVal UserID As String, _
ByVal Password As String, _
ByVal Name As String, _
ByVal FullName As String, _
ByVal type As T_Employe_Type _
)

Dim IMailDomain As IMailAPI_NET.DomainData = New IMailAPI_NET.DomainCollection().Item(aDomain)

If Not IMailDomain Is Nothing Then

Dim MyUserCollection As IMailAPI_NET.UserCollection = IMailDomain.GetUsers()
Dim newUser As IMailAPI_NET.UserData = New IMailAPI_NET.UserData()

newUser.MailAddress = UserID
newUser.UserID = UserID
newUser.Name = UserID
newUser.FullName = FullName
'newUser.setFullName(Encoding.Convert(Encoding.Unicode, Encoding.UTF8, Encoding.Unicode.GetBytes(FullName)), Encoding.UTF8)
newUser.Password = Password
newUser.Domain = aDomain

newUser.EnableWebAccess = True
newUser.AllowPassChange = False

MyUserCollection.Add(newUser)

Try
If Not newUser.SaveUser() Then
'If Not newUser.SaveUser(Encoding.Convert(Encoding.Unicode, Encoding.UTF8, Encoding.Unicode.GetBytes(FullName))) Then
Throw New Exception("Error, Data save error.")
End If
Catch ex As Exception
Throw New Exception("Error: Error while saving. " & ex.Message)
End Try

' Some other stuff...

end if
End Sub
Post #49102
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Dave, Mark Singh, kevin r gillis, Jason Benton, Brandon Felger, Ben Henderson, Tripp Allen, Jason Henline, Will Sansbury, Jason Williams, Hush, FTPplanet.com, Hugh Garber, WUP-PM, Tom Lewis, mmulryan@ipswitch.com, mswimm, Brad Senter

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 5:01pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.047. 9 queries. Compression Enabled.