New user registration code

zhaozj2021-02-16  79

1. User Login: You use a template library (Domcfg5.NTF) to generate a library (Domcfg.nsf) and then modify a form ($$ loginuserform). 2, new user registration code for your reference: 'Define the object DIM session as new notessession "defined in the agent DIM session as new notessession" Defines the server session variable, a user a thread DIM DB AS NOTESDATABASE' Defines a Notes Database Object DIM DBN AS NotesDatabase Dim ACL AS NOTESACL 'Defines a NOTES database to control list object DIM Entry as notesaclenTry' Defines an entry object in the access control list in a Notes database DIM VIEW AS NOTESVIEW 'Defines a view object in a Notes database DIM DOC AS NOTESDocument' define a Notes document object in the database 'e-mail messages Dim MailDb as NotesDatabase Dim CopyMailDB as Notesdatabase Dim template as NotesDatabase Dim MailACL as NotesACL Dim MailEntry as NotesACLEntry Dim fileName as String Dim cgi as NotesDocument Set cgi = session.DocumentContext' if the account is empty Then prompt IF (cgi.lastname (0) = ""

The msgbox cgi.referer (0) PRINT " User account enters a null value, cannot register " print "


" print "Click here Return "EXIT SUB ELSE DIM LETTERCODE AS Long Dim Ln AS String Diml) Long LN = CGI.lastname (0 ) L = LEN (CGI.lastname (0)) for i = 1 to l lettercode = ASC (LCase (MID (LN, I, 1))) IF lettercode ASC (" Z ")) The IF lettercode ASC (" 9 ") Then Print" User account contains illegal characters "print"
" Print "Click here Return "EXIT SUB END IF End End End IF" If the user password is empty, it is prompted if (cgi.httpassword (0) = "") "") " Your password is not confirmed, you can't register "Print"

PRINT "Click here Return " EXIT SUB END IF 'If the confirmation password is empty, then prompt IF ( CGI.Password (0) = "" "" "" The password entered the null value, not to register "print"


"print" Click here < A href = 'javascript: history.back ();'> Return "EXIT SUB END IF 'If the real name is empty, then prompt IF (cgi.peopleename (0 ) = "" "" "" "" Print "
" print "clicks Return "EXIT SUB END IF SET DB = session.getdatabase (" "" "" "" Names.nsf ")' Point DB to Domino Directory SET View = DB.GetView ("People") 'Take the Domino Directory PEOPLE view set doc = view.getdocumentbykey (cgi.lastname (0), true)' gets the account named LastName domain value user document IF NOT (DOC Is nothing) THEN 'If there is already the same account existence, then prompt " user account is:" cgi.lastname (0) "user already exists, can not register " Print "
"print" Click here Return <

/ a> "EXIT SUB END IF (cgi.user (0) =" WebAdmini ") OR (cgi.user (0) =" kmhwadmin ") or (cgi.user (0) =" developer ") THEN SET DOC = db.createdocument () 'Create a new document Doc Doc.form = "Person" in the Domino Directory (a hidden domain) Doc.Type = "Person"' Fill in the DOC Domain Type Doc.lastname = cgi.lastname (0) 'Fill in the domain fullname doc.fullname = cgi.lastname (0)' Fill in the DOC domain lastname doc.httpassword = cgi.httpassword (0) 'Fill in the DOC domain httppassord doc.password = CGI .Password (0) 'Fill in the domain passord doc.peopleName = cgi.peopleName (0)' Fill in the domain of DOC PEOPLEN AME DOC.MAILSYSTEM = "6" Doc.mailServer = session.username doc.mailfile = Trim ("Mail" / " cgi.lastname (0)) Doc.mails = cgi.domain (0) Call Doc.SAVE (True, False) 'Save DOC SET ACL = DB.ACL' Extracts the Domino Directory Acquisition Control List Set entry = acl.createaclenTry (cgi.lastname (0), acllevel_manager "Add registered user to access control list, and set it as management Member] entry.candeletedocuments = false 'Can't delete document call acl.save () Save modification results to Domino directory set db = session.currentDatabase'

Point DB to the current database SET ACL = DB.ACL 'Extract the current database access control list set entry = acl.createraclentry (cgi.lastname (0), acllevel_manager) Add entries to the current database Acquisition Control list Entry .Candeletedocuments = false call acl.save () Save Result 'Create a Mail Database Set Maildb = New NotesDatabase ("Mail.nsf")' Mail System Template FileName = TRIM ("Mail /" CGI.lastname (0 ) ". nsf") 'target mail database file name set copyMAildb = maildb.createcopy (", filename)' mail database (personal) CopymAildb.title = cgi.peopleName (0) " Personal Mailbox "mail database title Set MailACL = CopyMailDB.ACL Set MailEntry = MailACL.CreateACLEntry (cgi.lastName (0), ACLLEVEL_MANAGER) Call MailACL.save 'Set MailEntry = MailACL.CreateACLEntry (cgi.user (0), ACLLEVEL_MANAGER)' Call MailACL.save Print " User account " cgi.lastname (0) " has been registered in "Print" and has created " cgi.peopleName (0)" personal mailbox (" CopymAildb.FileName ") "print"


"print" Click here
Return You are not a system administrator, you can't register "Print"
"print" Click here