domino邮件服务器web用户注册代码
公司部署了一台domino邮件服务器。我想做一个web的用户管理库,包括:部门、公司层级、用户信息等。
首先就是web页面注册用户。按照帮助手册中,使用 NotesRegistration 的 RegisterNewUser 方法进行注册员工。注册后,人员信息生成,邮箱生成。
但是有点小问题。公司目前登录邮箱可以用 中文名(lastname) 和 英文名(shortname)。在方法说明中,并没有看到shortname 的参数。后来通过 直接查找该用户文档,在文档中添加shortname 。但是登录 用shortname 还是提示“无效的用户名和密码”。
请问这里是差什么步骤呢。感谢各位大神指点。
代理如下:
Visual Basic code?Sub Initialize On Error Goto errorhandler Dim session As New notessession Dim db As notesdatabase Set db = session.currentdatabase Dim reg As New NotesRegistration reg.createmaildb = True reg.certifieridfile = "E:\Lotus\Domino\data\cert.id" reg.expiration = Today + 2190 reg.registrationserver = db.server reg.idtype = ID_HIERARCHICAL reg.isnorthamerican = True reg.minpasswordlength = 5 reg.orgunit = "XX部门" reg.RegistrationLog = "log.nsf" reg.updateaddressbook = True reg.storeidinaddressbook = True Dim ShortName As String Dim lastname As String Dim FullName As String Call reg.RegisterNewUser("张三", _ ' last name "E:\Lotus\idss\hufeng.id", _ ' file to be created "CN=MailTest/O=test", _ ' mail server "", _ ' first name "", _ ' middle initial "password", _ ' certifier password "", _ ' location field "", _ ' comment field "mail\zhangsan.nsf", _ ' mail file "", _ ' forwarding domain "password", _ ' user password NOTES_LIMITED_CLIENT,_ ' user type "zhangsan" ) 'altname '通过lastname,在names.nsf中查找该用户 Dim dbnames As notesdatabase Set dbnames = session.getdatabase("","names.nsf",False) If dbnames.isopen = False Then Call dbnames.open("","names.nsf") End If Dim vwperson As notesview Set vwperson = dbnames.getview("($users)") Dim docuser As notesdocument Set docuser = vwperson.getdocumentbykey("张三") docuser.httppassword = "password" '增加shortname docuser.shortname = "zhangsan" Call docuser.save(True,False) Print "<font size=2>用户帐号已经注册成功了</font>" Print "<hr size=1 color=red>" Print "点击这里<a href='javascript:history.back();'><font size=2>返回</font></a>" Exit Suberrorhandler: Print Cstr(Erl)+" "+Error$ Exit SubEnd Sub
是服务器的安全性要设置一下。默认用shorname不能登录的