Web上通用注册用户代码[带邮箱],大家快拷贝!

gjd111686 2002-01-16 04:15:52
Sub Initialize
Dim session As New notessession
Dim doc As notesdocument
Set doc=session.documentcontext

Dim item_name As notesitem
Dim item_password As notesitem
Dim item_login As notesitem
Set item_name=doc.getfirstitem("Num")
Set item_password=doc.getfirstitem("Password")
Set item_login=doc.getfirstitem("Loginer")

Dim item_nametemp As notesitem
Set item_nametemp=doc.getfirstitem("EnglishNameTemp")

Dim item_formattext As notesitem
Dim item_formattexttemp As notesitem
Set item_formattext=doc.getfirstitem("FormatText")
Set item_formattexttemp=doc.getfirstitem("FormatTextTemp")

Dim sysdb As New notesdatabase("","names.nsf")
REM Messagebox(sysdb.title)
Dim sysview As notesview
Dim sysdoc As notesdocument
Set sysview=sysdb.getview("people")
Set sysdoc=sysview.getdocumentbykey(item_nametemp.text)
Dim dbtemp1 As notesdatabase
Dim dbtemp2 As New notesdatabase("","自己的邮件模板")

Dim acl As notesacl
Dim entry As notesaclentry

If sysdoc Is Nothing Then
Set sysdoc=sysview.getdocumentbykey(item_name.text)
If sysdoc Is Nothing Then
Set sysdoc=sysview.getdocumentbykey(item_login.text)
REM Call sysdoc.copytodatabase(sysdb)

Set sysdoc=sysdb.createdocument
Call sysdoc.replaceitemvalue("form","Person")
Call sysdoc.replaceitemvalue("Type","Person")
sysdoc.lastname=item_name.text
sysdoc.fullname=item_name.text+"/"+item_formattexttemp.text
sysdoc.shortname=item_name.text
sysdoc.httppassword=item_password.text
sysdoc.mailsystem="POP 或 IMAP"
sysdoc.mailfile="mail\"+item_name.text
sysdoc.internetaddress=item_name.text+"@"+item_formattext.text+".com"
sysdoc.owner=item_name.text+"/"+item_formattexttemp.text
sysdoc.localadmin=item_name.text+"/"+item_formattexttemp.text
Call sysdoc.computewithform(False,False)
Call sysdoc.save(True,True)
Set dbtemp1=dbtemp2.createfromtemplate("","mail/"+item_name.text+".nsf",True)
REM 修改ACL
Messagebox("ACL")
Set acl=dbtemp1.acl
Set entry=acl.getentry("system/"+item_formattexttemp.text)
Messagebox("system/"+item_formattexttemp.text)
If Not (entry Is Nothing) Then
entry.name=item_name.text+"/"+item_formattexttemp.text
Call acl.save
Messagebox(entry.name)
Else
Messagebox("NULL")
End If
Set entry=acl.createaclentry("system",ACLLEVEL_MANAGER)
Call acl.save
Set entry=acl.createaclentry("Anonymous",ACLLEVEL_NOACCESS)
Call acl.save
Set entry=acl.getfirstentry
entry.level=ACLLEVEL_NOACCESS
Call acl.save
REM 结束
REM Call sysdoc.save(True,True)
doc.EnglishNameTemp=item_name.text
Call doc.save(True,True)
Else
End If
Else
If item_nametemp.text<>item_name.text Then
Set sysdoc=sysview.getdocumentbykey(item_name.text)
If sysdoc Is Nothing Then
Set sysdoc=sysview.getdocumentbykey(item_nametemp.text)
If sysdoc.getfirstitem("lastname").text<>item_name.text Then
Dim dbtemp3 As New notesdatabase("","mail/"+sysdoc.getfirstitem("lastname").text+".nsf")
Call dbtemp3.remove
Set dbtemp1=dbtemp2.createfromtemplate("","mail/"+item_name.text+".nsf",True)
REM 修改ACL
Messagebox("ACL")
Set acl=dbtemp1.acl
Set entry=acl.getentry("system/"+item_formattexttemp.text)
Messagebox("system/"+item_formattexttemp.text)
If Not (entry Is Nothing) Then
entry.name=item_name.text+"/"+item_formattexttemp.text
Call acl.save
Messagebox(entry.name)
Else
Messagebox("NULL")
End If
Set entry=acl.createaclentry("system",ACLLEVEL_MANAGER)
Call acl.save
Set entry=acl.createaclentry("Anonymous",ACLLEVEL_NOACCESS)
Call acl.save
Set entry=acl.getfirstentry
entry.level=ACLLEVEL_NOACCESS
Call acl.save
REM 结束
Else
End If
sysdoc.lastname=item_name.text
sysdoc.fullname=item_name.text+"/"+item_formattexttemp.text
sysdoc.shortname=item_name.text
sysdoc.httppassword=item_password.text
sysdoc.mailsystem="POP 或 IMAP"
sysdoc.mailfile="mail\"+item_name.text
sysdoc.internetaddress=item_name.text+"@"+item_formattext.text+".com"
sysdoc.owner=item_name.text+"/"+item_formattexttemp.text
sysdoc.localadmin=item_name.text+"/"+item_formattexttemp.text
Call sysdoc.save(True,True)
doc.EnglishNameTemp=item_name.text
Call doc.save(True,True)
End If
Else
sysdoc.lastname=item_name.text
sysdoc.fullname=item_name.text+"/"+item_formattexttemp.text
sysdoc.shortname=item_name.text
sysdoc.httppassword=item_password.text
sysdoc.mailsystem="POP 或 IMAP"
sysdoc.mailfile="mail\"+item_name.text
sysdoc.internetaddress=item_name.text+"@"+item_formattext.text+".com"
sysdoc.owner=item_name.text+"/"+item_formattexttemp.text
sysdoc.localadmin=item_name.text+"/"+item_formattexttemp.text
Call sysdoc.save(True,True)
doc.EnglishNameTemp=item_name.text
Call doc.save(True,True)
End If
End If
Call sysview.refresh
End Sub
...全文
142 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
gjd111686 2002-01-23
  • 打赏
  • 举报
回复
这是一个代理.可以在按钮或者连接中激活
代理中的条目名称根据意思可以理解的:
比如:Loginer域就是计算@name([CN];@username)
Num就是用户代码啦.
Ozz 2002-01-23
  • 打赏
  • 举报
回复
gjd111686(数字金刚)
这个怎么用啊??? :(
HWLee 2002-01-23
  • 打赏
  • 举报
回复
:-)
forrest_jun 2002-01-20
  • 打赏
  • 举报
回复
domino5.0的类库中有现在的类直接做,不需要这么复杂,这么长的代码真是碍眼!
hefeihong 2002-01-18
  • 打赏
  • 举报
回复
好!
roseyang 2002-01-18
  • 打赏
  • 举报
回复
一个菜鸟的问题:我不太明白你那几个域的作用,您能说说吗:Num;Loginer;EnglishNameTemp;FormatText;FormatTextTemp。

zhymerry 2002-01-17
  • 打赏
  • 举报
回复
用户注册要自己编码吗???
dachun 2002-01-17
  • 打赏
  • 举报
回复
收到,无以为报,到下面来领分
http://www.csdn.net/expert/topic/480/480518.shtm
gjd111686 2002-01-17
  • 打赏
  • 举报
回复
只是一个中英文转换
gjd111686 2002-01-16
  • 打赏
  • 举报
回复
有意见,赶紧提,我改正后继续发布

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧